Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Count the number of heroes who enter the event and store it in a global integer. Every time one of them dies you decrement the integer (reduce by 1). Check if the integer is equal to 1 (1 hero alive) and then do whatever you want to the winner. You can use a unit group to keep track of the heroes in the event, when the integer is at 1 you can check the unit group for the hero that is still alive in the event and so know who won.
You could also use some kind of list structure and remove dying players from it until the list size is 1. In this case you know the last element in the list must be the winner.
If you remove heroes on player leave or there is some event dropout you may want to add a check to decrement the integer or remove from the list in those cases otherwise you might end up with 1 hero alive and it thing there are still more.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.