mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 22:22:46 +00:00
new docs
This commit is contained in:
1 parent
3cebaf7fa5
commit
b5eba8423f
229 files changed
+6238
-10690
No files matched your search
@@ -0,0 +1,27 @@
|
||||
Sets durability onto the specified slot.
|
||||
|
||||
Can be used for repairing weapons.
|
||||
|
||||
```lua
|
||||
exports.ox_inventory:SetDurability(inv, slot, durability)
|
||||
```
|
||||
|
||||
* inv: `table` or `string` or `number`
|
||||
* slot: `number`
|
||||
* durability: `number`
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
local ox_inventory = exports.ox_inventory
|
||||
|
||||
-- Set the durability of the item in slot 3 of source player's inventory to 100
|
||||
ox_inventory:SetDurability(source, 3, 100)
|
||||
|
||||
-- Set the durability of the source player's current weapon to 100
|
||||
local weapon = ox_inventory:GetCurrentWeapon(source)
|
||||
|
||||
if weapon then
|
||||
ox_inventory:SetDurability(source, weapon.slot, 100)
|
||||
end
|
||||
```
|
||||
Reference in new issue
Block a user