Weapon Durability and Repair

Hello I am having an issue on figuring out how to make a gun lose durability when someone shoots it, and once the gun durability is at 0 you will be able to repair it with a certain item. I can give more information on this issue if needed.

1 Like

There’s alot of way to accomplish this, you can use IntValue instance, Variables or Attributes. But lets say we choose an IntValue for example, you can then set the current durability there, for example lets say we have 10 durability or 10 ammo. everytime we shoot we could decrement that value by 1 or to any amount you want. Then we can use if statements to check if we still have remaining value IE: if Instance.Value > 0 then dosomething end now if the value is 0 we can use the else statement to do something like repair/reload etc.

if Instance.Value > 0 then
Instance.Value -= 1
shoot()
else
repair/reload()
end
3 Likes