• 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.

Variable Question Income

Status
Not open for further replies.
Level 4
Joined
Apr 24, 2009
Messages
115
Hi everyone,

I am trying to figure out how to give a player periodic income based on if they own a hero of hero type and I am having trouble. Help? Any suggestions are appreciated.

- Lordrake
 
  • Tr
  • Events
    • Time - Every 10.00 seconds of game-time
  • Conditions
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Life of Hero[(Player number of (Picked player))]) Greater than (0.41 - 0.05)
          • Then - Actions
            • Player - Add 20 to (Picked player)'s Current gold
          • Else - Actions
Hero[] is a Unit variable, that you have saved upon the creation of the hero for each respective player.
 
Level 4
Joined
Apr 24, 2009
Messages
115
  • Tr
  • Events
    • Time - Every 10.00 seconds of game-time
  • Conditions
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Life of Hero[(Player number of (Picked player))]) Greater than (0.41 - 0.05)
          • Then - Actions
            • Player - Add 20 to (Picked player)'s Current gold
          • Else - Actions
Hero[] is a Unit variable, that you have saved upon the creation of the hero for each respective player.

I think I get it, thanks for the help.
 
Status
Not open for further replies.
Top