How to detect when a button is pressed 3 times using commands

I'm making a Minecraft adventure map, and its an army game and I'm having trouble giving the boss at the end health. It's a tank, and it has a self destruct button, but I want to make so you have to press it 3 times to win. I'm using a scoreboard command.

At the start of the map it sets the health to 1. I used this:

/scoreboard players set @a Tank 1

At the end, you press the self destruct button and it should add 1, and when it gets to 4, it should end. When you press the self destruct button, it runs the command:

/scoreboard players add 1 Tank

And I used a /testfor command that's supposed to test for the score at 4. I used:

/testfor @p[score_Tank=4]

And for the command I used to add the scoreboard was:

/scoreboard objectives add Tank dummy

Can someone find the command I did wrong and correct it?


score_<objective>=# is checking for a maximum score, which means score_Tank=4 is looking for a score of 4 or lower. You'll want to use score_<objective>_min=# to check for a minimum score, so that it'll check for a score of 4 or higher:

/testfor @p[score_Tank_min=4]