RegisterChatCallback needs to be made before the Chatted event as the chatted event is called:
local Chat = game:GetService("Chat")
Chat:RegisterChatCallback("OnServerReceivingMessage", function(message)
if string.sub(message.Message, 1, 1) == ":" then
message.ShouldDeliver = false
return message
end
end)
Thanks, also do u know how to make it so I can send a message to the layer client sided. (so other people won’t see it. only the person who sent the message)