OnPlayerPickpocket
The thief’s game took a stack - return false to leave it.
After the minigame, before anything moves: the server has held the claim to the offer and cut each stack to what the victim still
holds - amount is what would move. Returning false vetoes that stack alone: it stays where it is, and the others go on. Not
called for a claim the server refused, nor for a thief the game caught (nothing moves for him).
class is the item class; the purse is the Groschen’s class
(5ef63059-322e-4e1b-abe8-926e100c770e) with the amount in tenths of a Groschen, as everywhere in the item functions.
Syntax
Section titled “Syntax”function OnPlayerPickpocket(pid, victim, actor, class, amount) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the thief |
victim |
number | the player robbed; -1 for an actor |
actor |
number | the NPC actor robbed; -1 for a player |
class |
string | the item class that would move |
amount |
number | how many of it |
Returns
Section titled “Returns”false leaves the stack; nothing, nil or true lets it move
Example
Section titled “Example”-- nobody steals a sword out of a pocket in this modefunction OnPlayerPickpocket(pid, victim, actor, class, amount) local info = GetItemInfo(class) if info and info.category == "MeleeWeapon" then return false endendSee also
Section titled “See also”OnPlayerPickpocketStart · OnPlayerPickpocketEnd · the Pickpocketing group of the index
