So, basically I want to stop messages from being sent only if they meet a requirement to not be sent.
I already have this figured out, what I need help with is actually blocking the message.
While searching for solutions, I found a post about Chat:RegisterChatCallback()
which I tried, and I couldn’t get it to work.
function CheckMessage(Message)
print(Message)
local Blacklisted = false
-- non-important code removed
if Blacklisted then
Message.ShouldDeliver = false
end
return Message
end
Chat:RegisterChatCallback(Enum.ChatCallbackType.OnServerReceivingMessage, CheckMessage)
Note, the print(Message)
doesn’t even get activated.
Is there a new way to do this, and if so how can I do it?