How could I create a formula to come up with a number (cost) to repair an item, based on the % of health the item has left.
EG:
Armor has 10% of health remaining out of 400.
Cost to repair the armor should be 90% of 400
How could I create a formula to come up with a number (cost) to repair an item, based on the % of health the item has left.
EG:
Armor has 10% of health remaining out of 400.
Cost to repair the armor should be 90% of 400
local remainingHealthProportion = health / maxHealth
local toRepairProportion = 1 - remainingHealthProportion
local cost = fullRepairCost * toRepairProportion
Thanks works great
30-characters
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.