Most kills win

bessomi

New Member
Reaction score
9
I have an integer array that counts the amount of kills each player has.
What i want is a trigger that lets the player with the most kills to win.
Simple enough?

Remember

I don't want a variable that counts the kills, i already have that


Thanks in return:D
 

vypur85

Hibernate
Reaction score
803
Code:
Event
 A unit dies
Condition
 [I]Whatever thing you want to add[/I]
Action
 Set Integer_Var = 0 <-- [I]Not so necessary but just for clarity[/I]
 For every Integer A loop from 1 to 4 do actions
   Loop - Actions
     If then else conditions
        Condition
           Your_Kill_Integer_Array[Integer A] Greater than Integer_Var
        Then
           Set Integer_Var = Your_Kill_Integer_Array[Integer A]
        Else
 For every Integer A loop from 1 to 4 do actions
   Loop - Actions
     If then else conditions
        Condition
           Your_Kill_Integer_Array[Integer A] Equal to Integer_Var
        Then
           Game - Make Player[Integer A] Victorious
        Else

Something like the above might work. It's up to you to try and play around with the values. Actually, in your previous thread, there was someone who suggested the Leaderboard method, which should also work. Not sure why you created another thread for this. Confusion?

Edit:
Basically, Integer_Var will be set as the max integer value. Your_Kill_Integer_Array[array] is your kill integer array (as the name suggest). The Integer A 1 to 4 is depending on how many players you have (adjust the '4' to your number of players, you can also use Player Group loop but I choose not to complicate things :p).
 

bessomi

New Member
Reaction score
9
Am i supposed to replace your_Kill_Integer with my integer that counts kills?

Also, what do i do if i want to put own actions to the winning player and all other players. Like for example add the winning player to a player group and add the losing player/players to a group, then i do something with those groups?

Thank you for helping, i owe you one
 

vypur85

Hibernate
Reaction score
803
> replace your_Kill_Integer with my integer that counts kills?
Yeah


> put own actions to...
This:
Code:
Event
 A unit dies
Condition
 Whatever thing you want to add
Action
 Set Integer_Var = 0 <-- Not so necessary but just for clarity
 For every Integer A loop from 1 to 4 do actions
   Loop - Actions
     If then else conditions
        Condition
           Your_Kill_Integer_Array[Integer A] Greater than Integer_Var
        Then
           Set Integer_Var = Your_Kill_Integer_Array[Integer A]
        Else
 For every Integer A loop from 1 to 4 do actions
   Loop - Actions
     If then else conditions
        Condition
           Your_Kill_Integer_Array[Integer A] Equal to Integer_Var
        Then
           Game - Make Player[Integer A] Victorious
           -[I]Your other actions for [B]winning[/B] players is here[/I]-
        Else
           -[I]Your other actions for [B]losing[/B] players is here[/I]-
 
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