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

For every integer...

Status
Not open for further replies.
Level 7
Joined
Sep 9, 2007
Messages
253
  • For each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) slot status) Equal to Is playing
        • Then - Actions
          • Player - Set (Player((Integer A))) Current gold to 120
        • Else - Actions
This trigger will loop for each integer A from 1-6. ie. it will run six times. the first time Integer A = 1. the second time it runs integer A = 2. etc etc.
so if player 1 slot status is playing then give player 1 some gold, if player 2 is playing then give player 2 some gold etc etc. You only make 1 trigger instead of 6 different triggers
 
It is a loop. It will perform the actions within that loop the number of times specified from A to B. In the example you posted, it is 1 to 10, so it will execute the actions within that loop from 1 to 10. (1, 2, 3, 4.... 8, 9, 10 end. 10 times)

As greenwhy posted, the numbers you input for the "x to y" part can be used within the loop if you want to do something for different players. If you use his example, it will set the gold of Player((Integer A)) to 120. Since it is within the loop, "Integer A" represents the current number it is on. Since it is from 1 to 6, it will perform that action 6 times, and in this case, it will set each player's gold (player 1 to player 6) to 120.
 
Status
Not open for further replies.
Top