GetInventory
What the player carries, with each item’s condition.
The player’s own items as their game holds them right now: one entry per item or stack, with the item class (a GUID of the
game’s tables), the count and the condition in percent as the game’s inventory shows it (0 = broken, 100 = new or fully
repaired). The purse is among them as the game’s
money item. The list is a copy to read - giving and taking items is the server’s (the game mode’s GivePlayerItem,
SetPlayerInventory), and the server knows the same conditions (its GetPlayerInventory).
Syntax
Section titled “Syntax”GetInventory()Returns
Section titled “Returns”table - a list of {class = string, amount = number, health = number}; empty before the player exists
Example
Section titled “Example”-- a repair menu: how worn is what they carryfor _, item in ipairs(GetInventory()) do if item.health < 50 then print(item.class .. " is at " .. item.health .. "%") endendSee also
Section titled “See also”GetPlayerId · the The player, the level and the frame group of the index
