Idea about defence system calculation

I made an armor system and each armor has a defence value.

So everytime a player gets damaged, the damage dealt will be calculated depending on the defence of the armor but I have no idea how could I calculate this so I want to ask if someone has an idea about doing this?

are you trying to mean the player’s damage or the armor’s durability? I honestly can’t understand it properly if u wondering.

I meant calculating the damage the player gets whenever another player or an enemy damages them by taking account the defence the armor has
It has nothing to do with the armor’s durability

if the defense level is counts as the armor’s toughness, u can use it by dividing the damage rate by the defense level, for example, the armor has 9 defense levels and the damage is about 60 which will only give us 6 which the health, although with this way u need to keep track to the player’s last health before they took the damage if u have all of that u can use the 6 from the result and basically remove 6 from the last health, example the player has 70 health before they took damage and after calculations u got 6 and just do 70 - 6, to be sure I not really experienced with making armor defense system so u could try another way if u would like to

oh and the 70 - 6 is the health which u can easily overwrite the humanoid’s health by changing the value to it

What have you tried so far?

Remember, this is scripting support, where we help you with existing problems with code.

Have you tried looping through the list of armour and summing the total armour?

Do you want the armour to Negate all damage until it breaks, or simply reduce the damage inflicted?

Don’t know where I should post this kind of posts so I assumed I could do this here
but anyways It’s about reducing the damage inflicted

I prefer not using this as it decreases the damage by a lot by just increasing once but thx for the help

Whenever you’re dealing damage to a player’s humanoid instance just negate from the damage dealt however much damage the armor (protection) should provide, this can be a simple numerical deduction like reducing the damage dealt by 10 or 20, or a magnitude such as decreasing the damage dealt by a divisor of 2 (halve the amount of damage received).

I was discussing about this with friends and we agreed on using this one

DmgInflicted = DMG * DMG / (DMG + DEF)

By testing some values looks pretty good and fair
Going to mark this as solution so people know I already found something