I’m making a commands module where everything is fully server-sided (because of hackers/exploiters obviously)
I want to make a system where when you send a command, it hides the message
I have a
player.Chatted base because that’s the only reliable server connection in this case
local message = msg:split(" ")
local commandWithPrefix = message
for _, v in Prefixes do
if commandWithPrefix:sub(1, 1) == v then
usedPrefix = v
if not usedPrefix then return end
local command = string.lower(commandWithPrefix:split(usedPrefix))
for customCommand, _ in CustomCommands do
if customCommand:lower() ~= command then continue end
foundCommand = CustomCommands[customCommand].Function
for currentCommand, _ in getCommands() do
if currentCommand:lower() ~= command then continue end
foundCommand = getCommands()[currentCommand]
if not foundCommand then return end
local args = message
foundCommand(player, args, msg)
This might give you an idea if I understood what you want to do.
I don’t understand how this works but I’ve found something that might work.
I’ve found this at
OnServerReceivingMessage but what does it mean by the ‘Message’ object
Probably callback function’s parameter. I’m not home right now but a quick test should show it.
I’ve tried printing it and it printed nothing, absolutely nothing, no errors
I’ve further tested it and found it gets passed by
local chat = game:GetService("Chat")
print(message) --> "hello"
player.Chatted:Connect(function(message) --> lets pretend message is "hello"
Can anyone else help me? I know how to filter messages with server-client communication. Though, I want to keep the module safe to use with no exploit threats.
Edit: Updated Information:
Using this code:
local shouldHideMessage = false
if Random.new():NextInteger(1, 2) == 1 then --give 50/50 chance of appearing the message lol
shouldHideMessage = true
shouldHideMessage = false
Works great for LegacyChatService.
However, I still want to make it compatible with TextChatService and not just LegacyChatService.
well uh according to my knowledge
roblox didnt add Event on server to recieve messages (at least i tried connecting to events like .MessageRecieved on server but no hope it wasnt fired at all)
If it was that simple, this post wouldn’t even exist.