Skip to main content
Inventory 4.0

Client inventory

Read the local inventory and open stashes from client-side resources.

API reference

Inventory exports

Access and control the local player's inventory.

5 exports
GetInventoryItems()

Returns every item in the local inventory.

None
InventoryItem[]
GetItemBy(findBy)

Returns one local inventory item matching the supplied search options.

findBytable
InventoryItem
GetItemQuantityBy(findBy)

Returns the combined quantity of matching local items.

findBytable
number
GetWeight()

Returns the current weight of the local inventory.

None
number
OpenStash(inv)

Opens a stash inventory.

invstring

The findBy argument can match an item by name, itemHash, slot, quantity or meta.

Configuration

Find a local item

Search the local inventory by item name and metadata.

local res = exports["avp_inv_4"]:GetItemBy({
name = "backpack",
meta = {
drawable = 40
}
})
print(json.encode(res, {indent=true}))
Configuration

Read an item quantity

Return the total amount of gold in the local inventory.

local res = exports["avp_inv_4"]:GetItemQuantityBy({
name = "gold"
})
print(json.encode(res, {indent=true}))

OpenStash can be called from a targeting system to open shelves or other stash inventories.