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.
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
