Skip to content

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.

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)

boolean - false when there was no session to end

-- a guard's shout ends a robbery that runs
function OnPlayerText(pid, text)
if text:lower() == "guards!" then
for _, id in ipairs(GetPlayers()) do CancelPickpocket(id, "guards called") end
end
end

GetPickpocketTarget · OnPlayerPickpocketEnd · the Pickpocketing group of the index