Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Ho do you filter a string for curse words?

Any good tutorials on how to filter a string for curse words?

3 comments

0

Lets see if I can get downvoted on this question to. If I find the person doing this, I'm adding them to my banlist.

0

Called it, I knew someone would downvote this, getting to the bottom of it.

0

Just upvoted this question to neutralize the reputation. In the future, please try to do some research into the Roblox Wiki or Google search. Come back, show us what you've tried, explain what your intended plans were, if there were any errors with the script you tried, and we'll be able to help you.

2 answers

##Solution

The Wiki is jam packed with information, it's just the matter of finding it. Whether it be through google search or through the search of the actual wiki. If you search the terms filter site:wiki.roblox.com in google, you will quickly stumble upon FilterStringForPlayerAsync(). You will also quickly learn that that function is becoming deprecated and use FilterStringAsync().

FilterStringAsync will take three arguments; The string to be filtered, the player the string is being sent from, and the player the string is being sent to. You will have to manipulate the script to your favor, but I will give you an example.


##Script

game.Players.PlayerAdded:connect(function(Player) --This line will get who enters the server and run a function every time a player enters the server. The event will provide a Player value which we can give the variable "Player".
    Player.Chatted:connect(function(Chat) --That "Player" is now connected to a chatted event. If they speak, then the event will run.
        game:GetService("Chat"):FilterStringForPlayerAsync(Chat, Player, Player2) --Once again, you're going to have to modify this script to your liking we can not make the entire script for you. The first argument is the string being what Player had said. The second argument being who said the string being Player. Player2 is a nil value which you will have to add yourself.
    end)
end)

##Advice

Do not just post requests on this site, this is not a request site. We like to see attempts at making a script or doing research at least. Posting requests for people to fix your scripts providing minimal information, or posting requesting scripts in general will get your post moderated and removed. Also being reasons for downvoting. Please check out this Help Article to get more advice about posting good questions and answers. While you're reading up on the help article, why want to take a look at the Community Guidelines.


######Hopefully this answered your question, if so do not forget to hit the accept answer button. If you have any questions, feel free to leave them in the comments below and I will get back to you.

This discussion is preserved as it was. New answers, comments, and votes are closed.