• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Gold loss trigger help

Status
Not open for further replies.
Level 3
Joined
Jan 5, 2008
Messages
26
I need help with making a trigger that makes you lose gold (specifically 20%) when your hero dies. This is my trigger so far, but it's not working.

  • Death Town
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Owner of (Triggering unit)) Not equal to Player 7 (Green)
    • Actions
      • Set TempUnleakerLoc = (Position of (Dying unit))
      • Floating Text - Create floating text that reads (- + (String((((Owner of (Dying unit)) Current gold) x (1 / 5))))) at TempUnleakerLoc with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Custom script: call RemoveLocation (udg_TempUnleakerLoc)
      • Wait 3.00 seconds
      • Floating Text - Destroy (Last created floating text)
      • Wait 2.00 seconds
      • Hero - Instantly revive (Triggering unit) at (Center of Hero Spawn <gen>), Show revival graphics
      • Player - Add ((((Owner of (Dying unit)) Current gold) x (1 / 5)) x -1) to (Owner of (Dying unit)) Current gold
Could someone please tell me what is wrong? The message always shows up as 0 when the hero dies, and no gold is lost either. And also, are there any leaks in this trigger? I'm not sure if I removed the leaks correctly, if there are any. I'm not good with triggers :sad: Thanks in advance.
 
Status
Not open for further replies.
Top