How to kill someone when a score reaches 0
I'm trying to make a minigame that's in a space station. Everyone gets a certain amount of oxygen using scoreboards.
I am stuck on how I can kill a player when they reach 0 oxygen. I have tried
/testfor @a["scoreboard name"=0]
but this does not seem to work. How can I kill the player when they reach 0 oxygen?
I am using Minecraft version 1.7.10.
Best Answer
if you're still on 1.7 (the other answer only works on 1.8+), then try:
/effect @a[score_O2remaining=0] 20 5 100
to give those players a strong Wither effect for 5 seconds.
Pictures about "How to kill someone when a score reaches 0"



4 Tips To IMPROVE Your CS and Farm Like The Pros - League of Legends
More answers regarding how to kill someone when a score reaches 0
Answer 2
Try this looped on a fill clock:
/kill @a[score_NAME_min=0,score_NAME=0]
This should kill all players that have a score of zero. All you need to do after that is set the killed players oxygen score back to 10 so that they don't keep getting killed.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Engin Akyurt, Mike, Brett Sayles, Joe Calomeni
