Hi I would like to make a trigger so that the player with the highest kills wins, so it goes like this:
Everytime you get a kill it adds 1 to the integer Kills (player number of (owner of killing unit)
Now lets say that at the end of the game the kills go as follows:
Kills [1]=50
Kills [2]=23
Kills [3]=17
How would I make a trigger that identifies which one of these is the highest?
In other words, how would I make it so that the Player Number of the Player with the highest kills wins?
you need 2 for loops, one to go through all the integer arrays and the 2nd to compare them to the rest, or you can do 1 for loop that takes the kills and goes through and if its higher than the current, it makes that the highest
Create a variable 'Max' with an initial value of 0. Loop through the array and if the value of the current index in the array is greater than 'Max', then set 'Max' to that value and set some player variable to that player.