Help w/ Muting Players

Hi, how would I mute someone from a server script?

Various ways to do this, I’m going to explain the easiest:

  1. Put a remote event

  2. In the server script fire the remote event with the parameters you want

  3. In the local script of the player listen to the remote event and when it’s called, disable his chat (startergui set core)

2 Likes

Can’t DarkDex get around this and destroy the local script?

Use chat’s service function mutespeaker() then

How would I access ChatService?

Example:

local channel = ChatService:GetChannel("ALL")
-- somewhere else in your code
channel:MuteSpeaker(--[[some name]])
-- to unmute
channel:UnmuteSpeaker(--[[some name]])```

ChatService isn’t defined though…

and you would get chatservice by game:getservice

image

Sorry I’m on mobile, let me see

Tell me if this works (your script is in serverscriptservice i assume)

local ChatService = script.Parent:WaitForChild("ChatServiceRunner").ChatService

Alr brb ima make the script im now on pc

Oops i forgot the require thing, btw you should wait for the player to load as well and use a pcall to prevent errors if the player you want to mute doesn’t exist

local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild ("ChatService"))
local channel = ChatService:GetChannel("ALL")

channel:MuteSpeaker()

channel:UnmuteSpeaker()
1 Like

also, if you need it, Lua Chat System — Server API — ChatChannel , there’s the parameters it takes

You’re a live saver, thanks so much man. I totally forgot that you had to require it since it’s a module script.

1 Like

Thank you! I was the one who forgot actually!

Would I use the player name for this or the player instance?