So I have this code that is supposed to delete the message a player makes if it contains "hello", and then kick the player. But whenever I try to run it it doesn't get destroyed, here's the code:
local bad = "hello" game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg, recipient) msg = msg:lower() if msg.find(bad) then msg:Destroy() plr:Kick() end end) end)
I have no idea why this is happening, any help is appreciated!