So I constantly get errors on my chat at random points
http://puu.sh/qi8xI/47529b52ee.jpg -- Errors
The errors just stop the script entirely(which is expected), and I'm not sure what causes it.
It's whenever the players chat and the messages are filtered - it errors.
filteredMessage = ChatService:FilterStringAsync(message, sender, player)
is the line it errors at.(message/sender/player are defined before it already.)
What is causing the error, and can I do anything about it?
create ur own filter
local cuss = {"****", "****", "damn", "crap"} -- etc function filter(msg) for i,v in pairs(cuss) do if msg == v then return true end end return false end game.Players.PlayerAdded:connect(function(Player) Player.Chatted:connect(function(msg) if filter(msg) then Player:Kick("Please do not cuss in game!") end end) end)
hope this helps