Kick
Disconnects the player with a reason.
The player’s client shows the reason and leaves; OnPlayerDisconnect follows with "kicked: <reason>". The server tells
nobody else - not for a kick, a Ban, the built-in /kick and /kickban or the audit’s kicks: a mode that wants the
others to know says it, in OnPlayerDisconnect (its example) or right after the call. Nothing keeps them from rejoining -
for that, Ban.
Syntax
Section titled “Syntax”Kick(pid [, reason])| Parameter | Type | |
|---|---|---|
pid |
number | the player |
reason |
string | shown to the player ("kicked" without one) (optional) |
Returns
Section titled “Returns”boolean - false when not connected
Example
Section titled “Example”function OnPlayerText(pid, text) if text:find("%f[%w]cheat%f[%W]") then Kick(pid, "no talk of cheats") return false end return trueendSee also
Section titled “See also”Ban · OnPlayerDisconnect · the Players group of the index
