Skip to main content

SetDurability

Sets the durability on an item found by the findBy search options.

  • inv: number or string
  • findBy: table
    • name? string
    • itemHash? string
    • x? number
    • y? number
    • isWeared? boolean
    • meta? ItemMetaData
  • 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)