I wanted to blacklist words in a table but it doesn’t work
What is my mistake?
local blacklist = {
"test",
"okay"
}
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local chat = string.split(msg," ")
if string.find(chat,tostring(table.find(blacklist,chat))) then
print("action")
plr:Kick()
end
end)
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local lowerMsg = string.lower(msg)
for _, v in pairs(blacklist) do
if string.match(lowerMsg, string.lower(v)) then
print("action")
end
end
end)
end)