Hi,
I know this has been asked before but I can’t seem to find an answer.
What I want to achieve is a system that detects messages and prevents the user from sending them (example use: preventing bots from flooding the chat).
I can’t seem to find a function/method that prevents someone from sending the message, you can only kick him/disable his chat after he sent it.
Someone said that you can edit the ChatScripts so that the word belongs to the filtered words and gets filtered out, but I don’t really know how to do that (can’t find the script that has the table in it)
This isn’t possible. You need to check if they sent the message first. What you should be doing is looking on how to delete a message from chat.
You can not detect a message not sent in chat. So what you should do is, Player.Chatted, and check if the chat is what you want it to be. This would look something like this:
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message) --Checks for chats
if Message == "InsertBannedMessageHere" then --Checks if the chat sent is the banned message
print("Someone said a banned word!")
--Delete Chat Code Here
end
end)
end)
You can also use ChatSpeaker! Link below…
Now what you want to do is DELETE the message sent. Sadly, not much documentation is available so you should have to look into this. Please correct me if I’m wrong on deleting chat messages.
They can still send messages if you do this. (Exploiting). If you want to prevent them from broadcasting messages you will have to directly modify the chat modules
Sorry for bumping this after a long time, I thought this solution would be better for some people. The solution is pretty new since it was implemented with the new chat system. Took me some time to figure out lol.
You can disable a player’s chat input textbox by running (on a LocalScript):
This will prevent users from sending message but still let them view the messages others are sending in the chat. Although I’m not sure if it can prevent an exploiter from sending message who might try to fire a remote to send a message.