Here is the script
Filtered = {"Word1","Word2","Word3"} game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(msg) for i,v in pairs(Filtered) do if msg == v then p:Kick() end end end) end)
Whenever a player says a word in the Filtered table it should kick them. But it only works if they say the word in it so it cannot detect it in a sentence D: Please help!
For this script, you're going to want to use the find method. And I would also advise in using the lower method to match a word more easily. So, I have edited your script below, it should detect for the words in the wordlist whether the message was in caps or all lower case letters.
Filtered = {"Word1","Word2","Word3"} game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(msg) for i,v in pairs(Filtered) do if string.find(msg:lower(), v:lower()) then p:Kick() end end end) end)