I have recently worked on a hero arena with a battle function - every time a hero kills a unit it is stored and when the timer expires all heroes will be teleported to the battle arena where the creeps they have killed when spawn and fight for them
However some why it is only team 1 heroes that get teleported and I have no idea why
Hope u can help me
I have attached the map too
However some why it is only team 1 heroes that get teleported and I have no idea why
Code:
Battle setup
Events
Time - Battle_timer expires
Conditions
Actions
Trigger - Turn on Creeps attack <gen>
Sound - Play Doom
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player - Set (Picked player) Current lumber to 0
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is an ally of Player 1 (Red)) Equal to True
Then - Actions
Camera - Pan camera for (Picked player) to (Center of Team1battlespawn <gen>) over 0.00 seconds
Unit Group - Pick every unit in (Units owned by (Picked player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
Loop - Actions
If (((Picked unit) is dead) Equal to True) then do (Hero - Instantly revive (Picked unit) at (Center of Team1battlespawn <gen>), Hide revival graphics) else do (Do nothing)
Unit - Move (Picked unit) instantly to (Center of Team1battlespawn <gen>)
Unit - Make (Picked unit) face 270.00 over 0.00 seconds
Unit - Set mana of (Picked unit) to 100.00%
Unit - Set life of (Picked unit) to 100.00%
Unit - Reset ability cooldowns for (Picked unit)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is an ally of Player 7 (Green)) Equal to True
Then - Actions
Camera - Pan camera for (Picked player) to (Center of Team2battlespawn <gen>) over 0.00 seconds
Unit Group - Pick every unit in (Units owned by (Picked player) matching (((Picked unit) is A Hero) Equal to True)) and do (Actions)
Loop - Actions
If (((Picked unit) is dead) Equal to True) then do (Hero - Instantly revive (Picked unit) at (Center of Team2battlespawn <gen>), Hide revival graphics) else do (Do nothing)
Unit - Move (Picked unit) instantly to (Center of Team2battlespawn <gen>)
Unit - Make (Picked unit) face 0.00 over 0.00 seconds
Unit - Set mana of (Picked unit) to 100.00%
Unit - Set life of (Picked unit) to 100.00%
Unit - Reset ability cooldowns for (Picked unit)
Else - Actions
Do nothing
Game - Display to (All players) the text: Time for war ! Des...
-------- Heroes can't gain experience while in battle --------
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
If ((Owner of (Picked unit)) Not equal to Neutral Hostile) then do (Hero - Disable experience gain for (Picked unit)) else do (Do nothing)
Hope u can help me
I have attached the map too