Skip to content

OnPlayerPickpocketStart

A player reaches for another’s pockets with the game’s “Rob” - return false to refuse.

Only while pickpocketing is on (SetPickpocketing). The server has checked the reach, the world, who is busy, the cooldown and that the victim can be robbed and has something to take; the mode has the last word. Returning false stops it - the thief is told he cannot rob them - anything else lets the minigame start. The mode does its own bookkeeping here (a cooldown of its own, a guard who watches); a later refusal of the server’s own does not call this again.

Exactly one of victim and actor is a real id: victim is the player id of the player robbed, actor the entity id of an NPC actor with pockets; the other is -1.

function OnPlayerPickpocketStart(pid, victim, actor)
-- ...
end
Parameter Type
pid number the thief
victim number the player whose pockets they reach for; -1 for an actor
actor number the NPC actor whose pockets they reach for; -1 for a player

false refuses; nothing, nil or true lets it start

-- guards (team 1) may not be robbed, and a thief is only let near a victim who is not on duty
function OnPlayerPickpocketStart(pid, victim, actor)
if victim >= 0 and GetPlayerTeam(victim) == 1 then
SendClientMessage(pid, COLOR_RED, "Nobody picks a guard's pockets.")
return false
end
end

OnPlayerPickpocket · OnPlayerPickpocketEnd · SetPickpocketing · the Pickpocketing group of the index