This is a rather serious issue with this resourse. If players are new to chat filtering and they want to copy and paste the code to avoid creating their own (which I highly suspect has already been done lots), they’re copying and pasting something which puts their game at risk of moderation.
The page I’m referring to is this article on the Developer Hub. The specific example I’m referring to is the first one given, for sending private messages.
The problem is all down to the server script, on line 38. I’ve extracted the block of code and annotated it to highlight the problem:
local function onSendMessage(sender, recipient, message)
if message ~= "" then
-- Filter the incoming message and send the filtered message
local messageObject = getTextObject(message, sender.UserId)
if messageObject then
local filteredMessage = getFilteredMessage(messageObject, recipient.UserId)
sendMessageEvent:FireClient(recipient, sender, message) -- line 38
-- Problem is here ^ message being sent instead of filteredMessage
end
end
end
sendMessageEvent.OnServerEvent:Connect(onSendMessage)
At first glance, it all looks fine, but looking more deeply at the example you’ll notice how it triggers a client event sending the originally recieved message instead of the filtered message.
All that needs to be changed is update message
to filteredMessage
.
When moderating games in the future, moderators should be mindful of this as the cause of the moderation may actually be down to Roblox themselves. uno reverse card
The example game on the is actually affected by this too!