Skip to content

Kick

Disconnects the player with a reason.

The player’s client shows the reason and leaves; OnPlayerDisconnect follows with "kicked: <reason>". Nothing keeps them from rejoining - for that, Ban.

Kick(pid [, reason])
Parameter Type
pid number the player
reason string shown to the player ("kicked" without one) (optional)

boolean - false when not connected

function OnPlayerText(pid, text)
if text:find("%f[%w]cheat%f[%W]") then
Kick(pid, "no talk of cheats")
return false
end
return true
end

Ban · OnPlayerDisconnect · the Players group of the index