SetDurability
Sets the durability on an item found by the findBy 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?
- durability:
number
The inv argument can be a number (as player ID) or the inventory uniqueID.
Returns the updated InventoryItem
.
exports["avp_grid_inventory"]:SetDurability(inv, findBy, durability)
Example
local source = source
local usedWeaponItem = exports["avp_grid_inventory"]:GetUsedWeapon(source)
if not usedWeaponItem then return end
exports["avp_grid_inventory"]:SetDurability(source, { itemHash = usedWeaponItem.itemHash }, 100)