Hello, I am working on an admin command system, but I want to make it so when an admin dose a command in chat the message doesn’t show up in the chat, and I want to make it so the person who did the command gets a message in chat saying it was executed.
When the game starts, a folder is created in the Chat service called “ChatModules”. In that folder you can put a ModuleScript. So you can set it up like this…
Inside the “ChatCommands” ModuleScript will have this code…
function check(speakerName,chatRequest)
if chatRequest == '/test' then
return true
else
return false
end
end
return function(chatService)
if chatService then
chatService:RegisterProcessCommandsFunction('Check',check)
end
end
returning true will make it not show up in the chat, but returning false will show up.
So they know it was executed, you can use StarterGui:ChatMakeSystemMessage() on the client.
I cant add any more it just under lines the code with red
You must be doing something wrong, just paste that code into a ModuleScript and put the ModuleScript into a folder named “ChatModules” then put that folder into the Chat service
@bronsonman You can’t just create a ChatModules folder and make a ModuleScript. Inside it. If you do that, all the other ModuleScripts will be missing
@MasonX890
Here’s the solution:
In Studio, click play. Then, while you’re in the game, copy the entire chat modules folder. Then stop the testing and paste the entire ChatModules Folder into Chat.
Make sure that InsertDefaultChatModules is enabled. (Its a boolvalue located in the ChatModules folder)
Then you can create a ModuleScript inside the ChatModules folder and paste the code @bronsonman provided above.
That should work. If it still errors, let me know.
You’re right, I was just saying to do that so MasonX890 could test it out. It doesn’t throw any errors so I assumed it would be fine, my guess is MasonX890 just missed some of the code when he was copying it.
If it were me I would clone the ModuleScript into the ChatModules folder when the game starts so I wouldn’t have to mess around with all the Roblox chat stuff.