1
The Winner Detection (NEED HELP)
Hey! I Just Have a doubt.
Suppose There are 7 people playing my map!
Now the players left are x, y, z.
a, b, c, and d are dead. After 2 min, y and z die.
How do I detect that all players have died except x??
:- Sorry If This Was a Bit Too Long.
Thx in Advance :<)
Suppose There are 7 people playing my map!
Now the players left are x, y, z.
a, b, c, and d are dead. After 2 min, y and z die.
How do I detect that all players have died except x??
:- Sorry If This Was a Bit Too Long.
Thx in Advance :<)
Create an account or sign in to comment.
2
1
Thx
1
One time only
On a clock
When the testfor command succesfully runs it means there's only one player left alive, that player can be targeted by @a[score_Deaths=0] (so first test if only one person is left alive before targeting that player). Make sure to reset the Deaths scores when restarting the game.
I don't know if this is the best possible way, this is just what I first thought of.
/scoreboard objectives add Deaths deathCount
/scoreboard objectives add alive
On a clock
/scoreboard players add @a Deaths 0
/scoreboard players set @a alive 0
/execute @a[score_Deaths=0] ~ ~ ~ scoreboard players add @a alive 1
/testfor @a[score_alive_min=1,score_alive=1]
When the testfor command succesfully runs it means there's only one player left alive, that player can be targeted by @a[score_Deaths=0] (so first test if only one person is left alive before targeting that player). Make sure to reset the Deaths scores when restarting the game.
I don't know if this is the best possible way, this is just what I first thought of.