Home / Server

server.mute()

server.mute(name [, seconds [, reason [, source]]]) server.unmute(name) server.isMuted(name)

Mutes or unmutes a player, or checks the remaining mute duration.

Parameters

NameTypeDescription
namestringPlayer name.
secondsnumber, optionalMute duration in seconds. The default is 0.
reasonstring, optionalReason stored with the mute. The default is an empty string.
sourcestring, optionalWho issued the mute. Defaults to the plugin name.

Returns

mute() returns nothing. unmute() returns whether a mute was removed. isMuted() returns false, or true, secondsRemaining, with the duration in seconds.

Example

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)