• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] Damage Detection

Status
Not open for further replies.
Level 11
Joined
Sep 12, 2008
Messages
657
Hey.. i wanted to make my own Damage detection..
so i tried to it this way:
  • Damaging unit
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set UnitLifeCheak[0] = (Max life of (Attacked unit))
      • Set UnitLifeCheak[1] = (Life of (Attacked unit))
      • Unit - Set life of (Attacked unit) to 100.00%
      • Set UnitLifeCheak[2] = (UnitLifeCheak[1] - UnitLifeCheak[0])
      • Floating Text - Create floating text that reads (|c00ff0033 + ((String(UnitLifeCheak[2])) + |r)) above (Attacked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
At start i remove the unit - heal part.. but it just keeps increasing, since unitlife 1 = Life of the unit.. then i figured out if i heal, it would work... but i kind of dont need that heal^^

- Can you help me please? -
 
Status
Not open for further replies.
Top