I want to, edit my code, that kicks player after, saying a bad word. But I want to, system kick player, without the developer needing to duplicate, the script and write In another match of bypasses of curse words, like I have to capitalize curse word, for e.g: If I write In the script, curse and then player joins the game and says curse, he/she will be kicked, but they can bypass It, by capitalizing one letter, Also If I say It like this: Curse Curse or curse, It doesn’t do anything (before the developer, adds the duplicated word, In a script, like a sentence So I need help with It.
local msg = "curse word"
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(m)
if m == msg then
player:Kick()
end
end)
end)
If you want to have your own set of blacklisted phrases on top of the Roblox filter, you could do something like this:
local bannedWords = { -- should be all lowercase
"curse1",
"curse2",
"curse3"
}
game:GetService("Players").PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
msg = msg:lower()
for _, phrase in ipairs(bannedWords) do
if (msg:find(phrase) ~= nil) then
player:Kick("You said a bad word.")
end
end
end)
end)
Developers are not allowed to disable or bypass the chat filter.
But I also have, one question that I asked, In my topic. What If they bypass, curse words by capitalizing It, like I don’t want a player to say, hello for example, what If they say like HElLo? I will have to, write down all possible matches then, and It takes a time.