Hidden Admin Commands Default Chat

How do I make it so admin commands that are entered in the default chat are own shown for certain people (other admins)? I know it has to go to the server first because that’s where I would check so see the the command caller is a valid admin.

This is how I’m detecting if a message was sent to the server:

local ServerScriptService = game:GetService('ServerScriptService')

local ChatService = require(ServerScriptService:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))


ChatService.SpeakerAdded:Connect(function(PlayerName)
	Speaker.SaidMessage:connect(function(chatMessage, channel)
		--check for valid admin command here
	end)
end)
2 Likes

You should be using a CommandModule for this. I have a lengthy explanation for a similar problem where someone wanted to hide bubble chats if a radio was on. I don’t want to re-explain command modules or anything so you can read that here:

Essentially though, what you’ll be looking to do is block a chat based on if a certain pattern is met.

Example:

local function Run(ChatService)
	local function processChat(speakerName, message, channelName)
        -- Prevent any message beginning with "/" from showing up
		return message:sub(1, 1) == "/"
	end
 
	ChatService:RegisterProcessCommandsFunction("ChatCommandBlock", processChat)
end
 
return Run
7 Likes

Yeah but that still won’t make it show just for other admins. It’s like the /e dance command, where you can type and enter it but it doesn’t show for anyone.

How would I go about making the chat only appear in the chat log for other admins only?