GetItemBy
Returns an item with the specified search options.
- inv:
number
orstring
- findBy:
table
- name?
string
- name?
- itemHash?
string
- itemHash?
- x?
number
- x?
- y?
number
- y?
- isWeared?
boolean
- isWeared?
- meta?
ItemMetaData
- meta?
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"
}
]]