I am currently making a Admin System for a Club Game as we get 5 players per server generally and there may be rule breakers: however, I was making a mute command and I did not get muted after typing.
Code:
local config = require(game:GetService("ServerScriptService").customAdmin.config)
local ChatServiceModule = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(config.group) >= config.rankNeeded then
plr.Chatted:Connect(function(msg)
local split = string.split(msg, " ")
local command, username, time, reason = split[1], split[2], split[3], table.concat(split, " ", 4)
if command == ":smute" then
if not username then return end
if reason == "" then return reason == "No reason(s) provided." end
if not game:GetService("Players"):FindFirstChild(username) then return end
ChatServiceModule:GetChannel("All"):MuteSpeaker(username, reason, time)
end
end)
end
end)