I’m making a mute command for an admin panel that I’m working on, though I don’t remember how to mute someone from the game
1 Like
Try doing something like this:
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild ("ChatService"))
local Channel = ChatService:GetChannel("All") -- We get the the All channel that is equal to every channel
speakerName = "ExcessEnergy"
Channel:MuteSpeaker(speakerName) -- Mute the speaker by their name
This uses MuteSpeaker to disable a certain player from chatting my name, in all channels.
2 Likes
Is your Chat variable equal to game.ChatService?
Chat is equal to
game:GetService("Chat")
Since ChatService gave an error saying that it wasn’t a valid service name
That’s not a thing. I would recommend reading on the wiki about how the chat system is organized:
3 Likes
I have read through the documentation many a time, but somehow got it in my head that you could reference the ChatService module directly with GetService().
I made an oopsie. I believe you need to reference the ChatService ModuleScript from inside the ChatServiceRunner, that is cloned into ServerScriptService when the server starts.
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild ("ChatService"))
1 Like