Prevent a Chat from sending

I am trying to make a chat message not show up. For example if I type “/fakedonate” then that message will not show up in chat. All help is much appreciated!

2 Likes

There seems to be a similar topic about this. Try reading the Solution and see if it helps:

2 Likes

I have already tried this and it does not seem to work.

3 Likes

How about using the OnIncomingMessage event for TextChatService to detect the message you want to hide? Something like:

local ChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")

ChatService.OnIncomingMessage = function(message: TextChatMessage)
	local property = Instance.new("TextChatMessageProperties")

    if message.Text == “/fakedonate” then
      property.Text = “” -- Returns a blank message.
    else
      property.Text = message.Text -- Sends original message.
    end

    return properties
end
2 Likes

I am not sure what to put here where the error is. Should it just be property?
image

2 Likes

I change it to property and it did not do anything

2 Likes

You would have to tell the TextSource that it cannot send any messages using the Property CanSend, this property when set to false will prevent chat messages from being sent to other players, however it will still appear for other players, so you would have to remove the content from the TextChatMessage, or rewrite the message to say they cannot send any messages.

Within the TextChatMessage Instance, you are able to access the TextSource
This has to be done on the Server, otherwise it will still send the Message.

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.