Client inventory
Read the local inventory and open stashes from client-side resources.
API reference
5 exportsInventory exports
Access and control the local player's inventory.
GetInventoryItems()Returns every item in the local inventory.
None
InventoryItem[]GetItemBy(findBy)Returns one local inventory item matching the supplied search options.
findBytableInventoryItemGetItemQuantityBy(findBy)Returns the combined quantity of matching local items.
findBytablenumberGetWeight()Returns the current weight of the local inventory.
None
numberOpenStash(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.