How to prevent a message from being sent

What is the best way to check a request message from a player and make a filter if it is sent or not?

I tried to check the TextChatService documentation, but I didn’t understand (I don’t speak mainly English and Google apart from not being able to translate the page translates it badly and the translation doesn’t make sense) and even less if there are no code examples.

It would be very helpful if someone could help me! ty

Use TextChannel.ShouldDeliverCallback:

Server code:

local defaultChannel = game:GetService("TextChatService").RBXGeneral
defaultChannel.ShouldDeliverCallback = function(chatMessage, textSource)
    local DontSendMsg = chatMessage.Text == "if this is the text, don't send"
    return DontSendMsg
end

TextChatMessage:

2 Likes

Thank you so much!!! <3ㅤㅤㅤㅤㅤㅤㅤ

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