How do you make a helmet that reflects damage from an enemy

How do you make a helmet that reflects damage from an enemy

For example: I have a reflect helmet and a mob deal 100k, and the helmet would deal 100k to the enemy.

2 Likes

every sec for all unit, if item type helmet is in inventory of unit, set player variable reflect as 1
when unit get attack, if last attacked unit for all player if selected unti = LAST attacked and if reflect of selected player == 1
set life of attacker unit as life of attack - (max health of unit - health of unit)
exemple : 25 dmg = attacker hp100 - hp max 100 - current hp 75

1 Like

I would just check if the unit owns a helmet when it gets attacked instead of all the every second and variable stuff

1 Like