I had this trigger in my map to let it automatically choose hero for players, including Computer players, who had not yet choose a hero. But the problem is it just creates one hero, like it just run once and stopped.
Thanks in advance, will +rep for those who helped.
-
Untitled Trigger 001
-

Events
-

Conditions
-

Actions
-


For each (Integer B) from 1 to 5, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Players_Heroes[(Integer B)] Equal to No unit
-
-





Then - Actions
-






Set Players_TempIndex = (Player number of (Player((Integer B))))
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








Players_Hero_PlaChosen Equal to False
-
-







Then - Actions
-








Unit - Create 1 Paladin for (Player((Integer B))) at (Random point in Player Spawn <gen>) facing Default building facing degrees
-








Set Players_Heroes[Players_TempIndex] = (Last created unit)
-








Set Players_IsPlaying[Players_TempIndex] = True
-








Set Players_IsRage[Players_TempIndex] = False
-








Set Players_IsSpell[Players_TempIndex] = True
-








Set Players_IsPhy[Players_TempIndex] = False
-








Set Players_Spellpower[Players_TempIndex] = 0.00
-








Set Players_Physical[Players_TempIndex] = 0.00
-








Set Players_HealerCount = (Players_HealerCount + 1)
-








Set Players_TankCount = (Players_TankCount + 1)
-








Set Players_Hero_PlaChosen = True
-
-







Else - Actions
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










Players_Hero_ArcChosen Equal to False
-
-









Then - Actions
-










Unit - Create 1 Archer for (Player((Integer B))) at (Random point in Player Spawn <gen>) facing Default building facing degrees
-










Set Players_Heroes[Players_TempIndex] = (Last created unit)
-










Set Players_IsPlaying[Players_TempIndex] = True
-










Set Players_IsRage[Players_TempIndex] = False
-










Set Players_IsSpell[Players_TempIndex] = False
-










Set Players_IsPhy[Players_TempIndex] = True
-










Set Players_Spellpower[Players_TempIndex] = 0.00
-










Set Players_Physical[Players_TempIndex] = 0.00
-










Set Players_DDealerCount = (Players_DDealerCount + 1)
-










Set Players_Hero_ArcChosen = True
-
-









Else - Actions
-










If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-











If - Conditions
-












Players_Hero_DkChosen Equal to False
-
-











Then - Actions
-












Unit - Create 1 Deathknight for (Player((Integer B))) at (Random point in Player Spawn <gen>) facing Default building facing degrees
-












Set Players_Heroes[Players_TempIndex] = (Last created unit)
-












Set Players_IsPlaying[Players_TempIndex] = True
-












Set Players_IsRage[Players_TempIndex] = True
-












Set Players_IsSpell[Players_TempIndex] = False
-












Set Players_IsPhy[Players_TempIndex] = True
-












Set Players_Spellpower[Players_TempIndex] = 0.00
-












Set Players_Physical[Players_TempIndex] = 0.00
-












Set Players_TankCount = (Players_TankCount + 1)
-












Set Players_Hero_DkChosen = True
-
-











Else - Actions
-












If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-













If - Conditions
-














Players_Hero_RogChosen Equal to False
-
-













Then - Actions
-














Unit - Create 1 Rouge for (Player((Integer B))) at (Random point in Player Spawn <gen>) facing Default building facing degrees
-














Set Players_Heroes[Players_TempIndex] = (Last created unit)
-














Set Players_IsPlaying[Players_TempIndex] = True
-














Set Players_IsRage[Players_TempIndex] = False
-














Set Players_IsSpell[Players_TempIndex] = False
-














Set Players_IsPhy[Players_TempIndex] = True
-














Set Players_Spellpower[Players_TempIndex] = 0.00
-














Set Players_Physical[Players_TempIndex] = 0.00
-














Set Players_DDealerCount = (Players_DDealerCount + 1)
-














Set Players_Hero_RogChosen = True
-
-













Else - Actions
-














If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-















If - Conditions
-
















Players_Hero_ShmChosen Equal to False
-
-















Then - Actions
-
















Unit - Create 1 Shaman for (Player((Integer B))) at (Random point in Player Spawn <gen>) facing Default building facing degrees
-
















Set Players_Heroes[Players_TempIndex] = (Last created unit)
-
















Set Players_IsPlaying[Players_TempIndex] = True
-
















Set Players_IsRage[Players_TempIndex] = False
-
















Set Players_IsSpell[Players_TempIndex] = True
-
















Set Players_IsPhy[Players_TempIndex] = False
-
















Set Players_Spellpower[Players_TempIndex] = 0.00
-
















Set Players_Physical[Players_TempIndex] = 0.00
-
















Set Players_HealerCount = (Players_HealerCount + 1)
-
















Set Players_Hero_ShmChosen = True
-
-















Else - Actions
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Thanks in advance, will +rep for those who helped.
Last edited:









