Kicks an online player.
| Name | Type | Description |
|---|---|---|
name | string | Player name. |
reason | string, optional | Shown to the player on the disconnect screen. |
A boolean indicating whether the player was found.
command('kickout', {
op = true,
usage = '/kickout <name> [reason]',
description = 'Kick a player'
}, function(sender, args)
if not args[1] then return false end
local reason = args[2] or 'Kicked by admin'
local found = server.kick(args[1], reason)
if found then
sender:send(args[1] .. ' was kicked.')
else
sender:send('Player not found.')
end
return true
end)