How do I make certain messages not show up in chat

I’m trying to modify my admin commands so that when a player uses a command it doesn’t show up in chat. I know how to match string patterns so that’s not the problem, I need to know WHERE exactly in the CoreScripts I can go to add in the desired behavior.

Thanks in advance <3

If you use the Roblox Chat Modules to register commands, those don’t show up in chat by default.

I highly doubt he’s processing them through the generic chat commands framework. As for your question, fetch the chat modules from a running game and modify them to ignore chat that your scripts interpret as commands.

This is most likely not enough info for you to know know to do. If someone else with access to studio can, pls tell him where to find said module.

EDIT: In case you never got the memo, the entire chat system was ported a while ago.

I’ve already modified the chat modules for my game to add in compatibility for other chat features, I just don’t know which part of them to modify for a feature that would involve checking messages before they’re sent to the server.

Look for remote event and function firings. That should tighten up your scope a bit.

Thanks for the tip @Kiansjet, I was able to find the code that handled sending the message to the RemoteEvent. Sorry it took so long to get back, I was out of town.

For future reference to anyone reading this in the future, the code that handles the RemoteEvent firing for chat messages starts at line 15 of MessageSender.

image

Compare the “message” string passed into this method to whatever your command symbol is (In my case it was !). If it matches, send a signal to a seperate RemoteEvent that your Command Script on the server listens for, and if it doesn’t match, signal the default RemoteEvent that was there before to send a normal chat message.

5 Likes
--	// FileName: MessageSender.lua
--	// Written by: Xsitsu
--	// Description: Module to centralize sending message functionality.

local module = {}
--////////////////////////////// Include
--//////////////////////////////////////
local modulesFolder = script.Parent

--////////////////////////////// Methods
--//////////////////////////////////////
local methods = {"/"}
methods.__index = methods

function methods:SendMessage(message, toChannel)
	self.SayMessageRequest:FireServer(message, toChannel)
end

function methods:RegisterSayMessageFunction(func)
	self.SayMessageRequest = func
end

--///////////////////////// Constructors
--//////////////////////////////////////

function module.new()
	local obj = setmetatable({}, methods)
	obj.SayMessageRequest = nil

	return obj
end

return module.new()

it won’t work

Please try this

-- // FileName: MessageSender.lua
-- // Written by: Xsitsu
-- // Description: Module to centralize sending message functionality.
-- // Edit by: jumpogpo

local module = {}

--////////////////////////////// Include

--//////////////////////////////////////

local modulesFolder = script.Parent

--////////////////////////////// Methods

--//////////////////////////////////////

local methods = {}

methods.__index = methods

function methods:SendMessage(message, toChannel)

if string.sub(message, 1, 1) ~= "/" then

self.SayMessageRequest:FireServer(message, toChannel)

end

end

function methods:RegisterSayMessageFunction(func)

self.SayMessageRequest = func

end

--///////////////////////// Constructors

--//////////////////////////////////////

function module.new()

local obj = setmetatable({}, methods)

obj.SayMessageRequest = nil

return obj

end

return module.new()
1 Like