• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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