• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

trigger works only for P1

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
  • Start Timer
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to (Player((Integer A)))
              • ((Triggering unit) is A Hero) Equal to True
            • Then - Actions
              • Set RespawnHero[(Integer A)] = (Triggering unit)
              • Player - Add -20000 to (Player((Integer A))) Current gold
              • Set PlayerGroup = (Player group((Player((Integer A)))))
              • Game - Display to PlayerGroup the text: ((Name of (Player((Integer A)))) + |c00FFD700You lost 20 000 Gold and will respawn after 5 minutes.)
              • Custom script: call DestroyForce(udg_PlayerGroup)
              • Countdown Timer - Start TimerRespawn[(Integer A)] as a One-shot timer that will expire in 300.00 seconds
              • Countdown Timer - Create a timer window for (Last started timer) with title Respawn in:
              • Set TimerWindowRespawn[(Integer A)] = (Last created timer window)
              • Countdown Timer - Hide TimerWindowRespawn[(Integer A)]
              • Countdown Timer - Show TimerWindowRespawn[(Integer A)] for (Owner of RespawnHero[(Integer A)])
            • Else - Actions
 
Level 6
Joined
Nov 24, 2012
Messages
218
Then why do you suppose this fine trigger is working for p1 only?
First, like other ppl said, replace integer A with ur own loop A variable.
Integer A is a global and can conflict with other loops.
Then, timer array index size must be initialized likewise to few other variable array types.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
HesitationSnow unless you use Wait or PolledWait, you dont need to replace it because function runs at whole not by pieces, the game wont jump from one thread to another, it does thread by thread and loop goes until it stops or crashes the thread
 
Status
Not open for further replies.
Top