How would you delete/hide a chat message?

So using the event / listener PlayerObj.Chatted, I’m creating chat commands and I would like to make sure that no one can actually see your chat commands. How would I be able to remove it?
https://gyazo.com/2f87cbea76db59bc04e5b641d7e206e8

So I don’t want players to see the previous message.

1 Like

Please search first before asking. This question has been raised several other times.
https://devforum.roblox.com/search?q=delete%20chat%20message%20category:55

I made a mini tutorial which you can salvage code from. The idea is to not allow a message to be processed if a certain condition is met. In your case, it’d be if the message starts with your command prefix.

You can also reference existing command modules in the LuaChatService when you fork it, such as the PlayEmote module (/e commands, you’ll notice they don’t show up in chat).

5 Likes

That’s not what I was asking, my question was how delete certain messages from everyones chat for example commands. I don’t want players seeing all the commands being typed.

This is exactly what you’re asking and the solutions here provide you methods for doing that. You can’t delete chat service messages without hacking it together or experiencing unintended bugs. Using native support, the way to “delete” a chat message is not to process it at all.

Read my messages again. The code I provided can be salvaged. Bubble chat will not show by extension of a chat not being processed, though it works for both classic and bubble chats. You can prevent commands from showing by disallowing a message with a command to process.