How to get the real damage?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

pepper82

Member
Jan 26, 2017
272
1
18
41
Hi all,
I need to respawn a player once he is "dead" but not really dead. He will respawn once he receives enough damage to be dead.

I have this:

code_language.skript:
if damage is greater than or equal to health of victim:
#do something

Example is a spider. It makes 1.5 damage but ignores the armour type that I am wearing.
When wearing armour (diamond etc.) I get less than 1.5 hearts damage but Skript's damage variable is always 1.5 (in the exmaple of the spider). Also tried "final damage" from skellett which results in 3 damage.

So how would I do it correctly?
 
Why not just check the player's health?

code_language.skript:
On damage of player:
   if attacker is a spider:
       if victim's health is 0:
           #Do stuff

Haven't tested this, but it should work fine
 
Status
Not open for further replies.