1

The Winner Detection (NEED HELP)

Devil_The_Killer's Avatar Devil_The_Killer2/5/17 10:45 am
1 emeralds 390 2
2/7/2017 11:12 am
Devil_The_Killer's Avatar Devil_The_Killer
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 :<)
Posted by Devil_The_Killer's Avatar
Devil_The_Killer
Level 1 : New Crafter
0

Create an account or sign in to comment.

2

1
02/07/2017 11:12 am
Level 1 : New Crafter
Devil_The_Killer
Devil_The_Killer's Avatar
Thx
1
02/07/2017 8:24 am
Level 57 : Grandmaster Cyborg
Pepijn
Pepijn's Avatar
One time only
/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.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome