SetMetaData
Sets the metadata for an item found with the findBy options.
- inv:
number
orstring
- findBy:
table
- name?
string
- name?
- itemHash?
string
- itemHash?
- x?
number
- x?
- y?
number
- y?
- isWeared?
boolean
- isWeared?
- meta?
ItemMetaData
- meta?
- metaData:
{ [string]: any }
The inv argument can be a number (as player ID) or the inventory uniqueID.
Returns the updated InventoryItem
.
exports["avp_grid_inventory"]:SetMetaData(inv, findBy, metaData)
Example
local source = source
local bodyArmourItem = exports["avp_grid_inventory"]:GetItemBy({ isWeared = true, name = "armour" })
if not bodyArmourItem then return end
bodyArmourItem.meta.durability = 100
bodyArmourItem.meta.drawable = 20
exports["avp_grid_inventory"]:SetMetaData(source, { itemHash = bodyArmourItem.itemHash }, bodyArmourItem.meta)