Skip to main content

GetItemBy

Returns an item with the specified search options.

  • inv: number or string
  • findBy: table
    • name? string
    • itemHash? string
    • x? number
    • y? number
    • isWeared? boolean
    • meta? ItemMetaData

The inv argument can be a number (as player ID) or the inventory uniqueID.

Returns InventoryItem

exports["avp_grid_inventory"]:GetItemBy(inv, findBy)
Example
local res = exports["grid_inventory"]:GetItemBy("stash-1", {
name = "backpack",
meta ={
drawable = 40
}
})
print(json.encode(res, {indent=true}))
--[[
{
"itemHash": "1676773287-239214",
"y": 3,
"isRotated": false,
"x": 2,
"quantity": 1,
"meta": {
"texture": 0,
"drawable": 40
},
"isWeared": false,
"item": "backpack"
}
]]