Skip to content

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.

GetPlayerInventory(pid)
Parameter Type
pid number the player

table - a list of {class=, amount=, health=}

local arrows = 0
for _, stack in ipairs(GetPlayerInventory(pid)) do
local info = GetItemInfo(stack.class)
if info and info.category == "Ammo" then arrows = arrows + stack.amount end
end

GetPlayerEquipment · GivePlayerItem · GetItemInfo · the Items and inventory group of the index