SetMetaData
Sets the metadata for an item found with the findBy options.
- inv:
number
orstring
- findBy:
table
- name?
string
- name?
- itemHash?
string
- itemHash?
- slot?
number
- slot?
- quantity?
number
- quantity?
- 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_inv_4"]:SetMetaData(inv, findBy, metaData)
Example
local source = source
local bodyArmourItem = exports["avp_inv_4"]:GetItemBy({ name = "body_armour" })
if not bodyArmourItem then return end
bodyArmourItem.meta.durability = 100
bodyArmourItem.meta.drawable = 20
exports["avp_inv_4"]:SetMetaData(source, { itemHash = bodyArmourItem.itemHash }, bodyArmourItem.meta)