GetPlayerInventory
The player’s whole inventory as their client last reported it.
One entry per stack: the class GUID, how many, the item’s condition in percent. Reported 1.5 s after a spawn, then every 10 s
or within a second of a change; {} before the first report. Money is not reported.
Syntax
Section titled “Syntax”GetPlayerInventory(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”table - a list of {class=, amount=, health=}
Example
Section titled “Example”local arrows = 0for _, stack in ipairs(GetPlayerInventory(pid)) do local info = GetItemInfo(stack.class) if info and info.category == "Ammo" then arrows = arrows + stack.amount endendSee also
Section titled “See also”GetPlayerEquipment · GivePlayerItem · GetItemInfo · the Items and inventory group of the index
