I'm doing this to prepare for haters. So basically if they say something hateful towards my game like "This game is stupid" or "I hate this game" they get kicked with a custom message like "Please don't say anything hateful" or something.
So first we need to check if the player chatted something. There is a .Chatted event. You will use it like this in this case:
game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(msg) -- do stuff with msg and player if msg == "I hate this game!" then player:Kick("Please don't say hate stuff.") end end) end)
Although it shoudn't be like this. i.e People can say anything they want in the chat. Like @Benbebop said. But if you still want a way to do it. It is here. Hope it helps
Well, to start off, this is not a very good idea for two reasons.
There shouldn't be a need to do this. If people are criticizing your game A LOT, that means there is either something wrong with it or your playerbase doesn't like it. Most successful games / content creators take a lot of criticism, but even then they still succeed - if you have to filter people criticizing your game, that means that it is not a successful game. Censorship is only reasonable when it genuinely causes problems.
They can easily bypass the filter. There are many synonyms of hate, different ways of spelling it, etc.. if you put in every possible "hate" synonym and phrase, you are not only going to slow your game down but realize that you will also have to check for alternate spellings or bypass spellings, like"hete", which will pretty much slow down your game even more.
Having said that, the solution would be to do what Soban06 did, only make a table of keywords, and check for bypass spellings. Then you can kick those players.