Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do you remove a player's ability to chat via the text box inside of the chat bar? [ANSWERED]

Asked by
Aztralzz 169
4 years ago
Edited 4 years ago

So, I'm making an admin script, and I'm trying to mute someone. I can't seem to do it, but here's a command for example:

Commands.speed = function(Sender,Arguments)
    local Argument = PartialMatch(Arguments[1]);
    if not Argument then return false end;
    Argument.Character.Humanoid.WalkSpeed = Arguments[2]
end

How could I mute someone without destroying the script, because I still need it for the unmute command?

1 answer

Log in to vote
1
Answered by
exobyteXL 290 Moderation Voter
4 years ago
Edited 4 years ago

To mute someone, you need to use a LocalScript.

game.StarterGui:SetCore("ChatBarEnabled",false)

Learn more about SetCore

View post for muting someone via server script

Okay, fine. Here's the code you want.

local ChatService = require(game.ServerScriptService.ChatServiceRunner.ChatService)
local Channel = ChatService:GetChannel("ALL")
Channel:MuteSpeaker(string.lower(Argument.Name)) end
Ad

Answer this question