I don’t know. I’ve been so frustrated by this, from the attempts I’ve been through, sometimes It didn’t output anything in the server, sometimes It didn’t filter the text whenever I put in bad words…
save me…
Client Script:
local textBox = script.Parent.TextBox
textBox.FocusLost:Connect(function()
script.Parent.TextEvent:FireServer(textBox.Text)
end)
Server Script:
script.Parent.TextEvent.OnServerEvent:Connect(function(player, inputText)
local success, filteredText = pcall(function()
local result = game:GetService("TextService"):FilterStringAsync(inputText, player.UserId)
return result:GetNonChatStringForBroadcastAsync()
end)
if success and filteredText then
script.Parent.TextBox.Text = filteredText
end
end)