Muting a speaker from the default Roblox core chat

Hello developers,
I just ran into an issue with the ChatChannel:MuteSpeaker function and I’m really confused with the issue.


My Solution

local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"));

local isSuccessful, channel = pcall(ChatService.GetChannel, ChatService, "All");
if not isSuccessful then
repeat until ChatService.ChannelAdded:Wait() == "All";
      channel = ChatService:GetChannel("All");
end
local leftDur = actionData["punishmentLength"] + actionData["punishmentTime"];
channel:MuteSpeaker(player.Name, actionData["punishmentReason"], os.time() -  leftDur);

The error


Any help will be much appreciated.
Cheers.

1 Like