# Comparing multiple scores - The new way (minigame win detection)

• 3,273 views, 0 today
• 6
• 4
• 5
Jmal116
Level 33 : Artisan Engineer
87
Before this, the best way to compare multiple player's scores was to repeatedly subtract 1 from every player's score until all but one reached 0. There are some obvious problems with this:

1) Depending on how many points the players have, this can take quite a while

2) All the players scores will be changed after you check for a winner, meaning you can't do an in-game status check.

This method aims to fix those problems, by keeping the comparison of scores completely within scoreboards. This fixes both problems by being able to testfor and display a winner with just the push of a button.

That's pretty much what it does in a nutshell, if you want to see it in action, the video above explains it pretty well.

Text Explanation:

This works using a system that can compare two teams scores within command blocks.

An objective that will keep track of which team is in the lead, rather than what each team's total score is. Whenever one teams gets a point, it adds 1 point to that team's score, and removes 1 from the other's. Whatever team has a positive score on this objective at the end of the game is the winner between the two.

In the system in the video, it compares teams 1 and 2 together, and also compares 3 and 4. It then takes the leader from each of these two groups, and compares their scores.

So if the scores are as follows:

Player 1 = 5

Player 2 = 3

Player 3 = 8

Player 4 = 4

It will compare the two small groups and find their leader, which in this example will come out to be players 1 and 3. It will then compare players 1 and 3 scores, and will output that player 3 is the winner.
 Progress 100% complete Tags

1
02/22/2014 11:44 pm
Level 1 : New Crafter
marmig0404
Couldn't you have taken points from teams without players on the teams so it works then in single player? I don't know too much about scoreboard but i think this will work.
1
11/11/2013 8:44 pm
Level 54 : Grandmaster Programmer
Cyentw
I would luv a download so that I can see it for myself :)
1
08/26/2013 7:33 pm
Level 56 : Grandmaster Taco
Mgreat
Nice! Very helpful. :D I can't believe I didn't know about the "@p[name=]" thingy. XD
1
08/26/2013 10:01 pm
Level 33 : Artisan Engineer
Jmal116
haha it's not something that comes up very often, I just used it so I wouldn't have to bother using different scores for us XD
1
08/27/2013 3:04 pm
Level 56 : Grandmaster Taco
Mgreat
Ah, ok. XD I should check, and see if I'm missing any others like that.