Home / Server

server.tempban()

server.tempban(name, seconds [, reason, source])

Records a temporary ban for the requested duration.

Parameters

NameTypeDescription
namestringPlayer name.
secondsnumberBan duration in seconds.
reasonstring, optionalShown to the player.
sourcestring, optionalWho issued the ban. Defaults to the plugin name.

Returns

Nothing.

Example

command('tban', { op = true }, function(sender, args)
  if not args[1] or not args[2] then return false end

  local duration = server.parseTime(args[2])
  if not duration then return false end

  server.tempban(args[1], duration, "Timeout", sender.name)
  sender:send("Banned " .. args[1] .. " temporarily.")
  return true
end)