Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i check if a player inputed a bad word?

Asked by 7 years ago

Please help! I really need it, it's for when a player puts in text inside a TextBox. I've tried making my own filter but it didn't work.. Anything would be awesome!

3 answers

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

use FilteredString = game.ChatService:FilterStringForBroadcast(playerSend,Message)

FilteredString will be the Message with all the bad words as #'s.

http://wiki.roblox.com/index.php?title=API:Class/Chat/FilterStringForBroadcast

Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Use FilterStringForPlayerAsync(). It filters the text for whatever age the user is. Example:

local text = "[swear] you"
FilterStringForPlayerAsync(text, plr) -- make sure you have defined plr, this is just an example.

Here is the wiki page.

Log in to vote
0
Answered by 7 years ago

It's for a Normal textbox, ik how to do the rest all i need to do tis filter out anything the player may put that's bad i've tried the chat thing but of course won't unless it's a chat script whcih it's not, Please anymore help?

0
Mine isn't meant for a chat. It's meant to filter any string. It works for me in studio, so I don't know what's wrong with what you are doing. Operation_Meme 890 — 7y
0
FilterStringForBroadcast can be used normaly too. It just returns a string with no bad words. It's not only used for chats. RubenKan 3615 — 7y

Answer this question