Mutes or unmutes a player, or checks the remaining mute duration.
| Name | Type | Description |
|---|---|---|
name | string | Player name. |
seconds | number, optional | Mute duration in seconds. The default is 0. |
reason | string, optional | Reason stored with the mute. The default is an empty string. |
source | string, optional | Who issued the mute. Defaults to the plugin name. |
mute() returns nothing. unmute() returns whether a mute was removed. isMuted() returns false, or true, secondsRemaining, with the duration in seconds.
command('mutechat', { op = true }, function(sender, args)
if not args[1] then return false end
server.mute(args[1], 300, "Please keep chat friendly", sender.name)
sender:send("Muted " .. args[1] .. " for 5 minutes.")
return true
end)