How to disable swearing on TextBox

Pretty self explanatory…

Should i make a table with every swear word on it? That would take alot of time also i dont know if it tags it automaticly

5 Likes
1 Like

Wow that was fast, but how do i use it?

1 Like

Right under methods it explains how you can add a filter inside your textbox;

TextService:FilterStringAsync(text, userId)
1 Like

Can u show me an example, like where should i use that line in a script

Sure, if I can find one of my old scripts lol

do u want it to filter every time they enter a new character, or when they finish typing?

When they finish typing, i have added a 'Done" button. Also all of this happens on a surface gui

okay, this should work:

local textService = game:GetService('TextService')
local player = game.Players.LocalPlayer

--Make sure 'yourTextBox' is a variable.
yourTextBox.FocusLost:Connect(function()
    yourTextBox.Text = textService:FilterStringAsync(yourTextBox.Text, player.UserId)
end)
2 Likes

Thanks you! it works very fine.!

You’re welcome! Hope your game goes well!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.