i have searched about how to filter text from a textbox, after many tutorials and forum posts i have came to this
client side
script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
if script.Parent.Text ~= "" then
game:GetService("ReplicatedStorage"):FindFirstChild("filter"):FireServer(script.Parent.Text)
end
end)
game:GetService("ReplicatedStorage"):FindFirstChild("filter").OnClientEvent:Connect(function(filteredtext)
if filteredtext then
print(filteredtext)
script.Parent.Text = filteredtext
end
end)
server side
local textService = game:GetService("TextChatService")
game:GetService("ReplicatedStorage"):FindFirstChild("filter").OnServerEvent:Connect(function(player, text)
local filteredtext = nil;
local success, err = pcall(function()
filteredtext = textService:FilterStringAsync(text, player.UserId)
end)
if success then
game:GetService("ReplicatedStorage"):FindFirstChild("Eventos").filtro:FireClient(player, filteredtext)
else
game:GetService("ReplicatedStorage"):FindFirstChild("Eventos").filtro:FireClient(player, false)
end
end)
and its not working, im aware that it doesnt work on studio, published the changes and still not working on the game