FFA ending

twisterghost

New Member
Reaction score
3
How can I tell if there is only one unit left in an array and know which one it is?
The array "heroes" for me is an array which stores the chosen heroes in a hero arena using the player number as the index. I just need a trigger to know when a unit is killed if it is the last unit besides the killer.
 

Squishy

You can change this now in User CP.
Reaction score
127
Something like this:
Code:
Trigger
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Set Integer = 0
        For each (Integer A) from 1 to (However big your Array is), do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit_Array[(Integer A)] is dead) Equal to False
                    Then - Actions
                        Set Integer = (Integer + 1)
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Integer Equal to 1
            Then - Actions
                Your Actions
            Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top