CancelPickpocket
Ends the pickpocket session a player is in - nothing is taken.
pid is either party - the thief or the one robbed (a player who is both is cancelled as the thief first). The thief’s game ends
its minigame at once; OnPlayerPickpocketEnd follows with "cancelled" and reason ("mode" when none is given or it is
empty; the text is trimmed and cut to 48 characters). false when the player is in no session.
Syntax
Section titled “Syntax”CancelPickpocket(pid [, reason])| Parameter | Type | |
|---|---|---|
pid |
number | the thief, or the player robbed |
reason |
string | what the mode’s callback hears, at most 48 characters; "mode" by default or when empty (optional) |
Returns
Section titled “Returns”boolean - false when there was no session to end
Example
Section titled “Example”-- a guard's shout ends a robbery that runsfunction OnPlayerText(pid, text) if text:lower() == "guards!" then for _, id in ipairs(GetPlayers()) do CancelPickpocket(id, "guards called") end endendSee also
Section titled “See also”GetPickpocketTarget · OnPlayerPickpocketEnd · the Pickpocketing group of the index
