1
Hi, So I have 2 scoreboards. 1 named ATA , and DTA! (Attacker Team Amount, Defender Team Amount) Both teams have a player named Amount. The scoreboard is a dummy score and everytime you join the game, it will do this command: /scoreboard players add amount DA 1. (Defender Amount) Same thing with the Attackers but this time it is AA (Attacker Amount). On leave the game, it is /scoreboard players remove amount DA 1. Same thing with attackers but its AA. And I have a testfor commandblock that does this: testfor @a[score_DA_min=0]
And when that happens, I have at Comparator that goes to another commandblock! If anyone can help, that would be great!
And when that happens, I have at Comparator that goes to another commandblock! If anyone can help, that would be great!
Create an account or sign in to comment.
6
1
Sorry I am very confused, if you could walk me through it
1
Hi. This system works fine, but there is a much more efficient and faster way added with the /execute command (1.8+). This command forces entities matching the selectors to run a command. For your case, you would use the following command:
/execute @a[score_DA_min=0] ~ ~ ~ scoreboard players add amount DA 1
This basically makes everyone with a score on DA add 1 to the DA for the player "amount". I would recommend teams for separating groups though, example:
/scoreboard teams add [player] Defense
/execute @a[team=Defense] ~ ~ ~ scoreboard players add amount DA 1
/execute @a[score_DA_min=0] ~ ~ ~ scoreboard players add amount DA 1
This basically makes everyone with a score on DA add 1 to the DA for the player "amount". I would recommend teams for separating groups though, example:
/scoreboard teams add [player] Defense
/execute @a[team=Defense] ~ ~ ~ scoreboard players add amount DA 1
1
So there is no way to testfor a scoreboard player's score? Because what I said is not working. It cannot find the entity. But I did something and now it says [16:33:42] Selector '@a[score_DA_min=0]' found nothing.
The score DA is at 0 but it still isn't finding anything
The score DA is at 0 but it still isn't finding anything
1
So I think the problem you have is you're trying to check if someone doesn't have a score for DA. This cannot be done with objectives, as you are checking if they have a minimum of zero, and the default score for players does not exist, so it is not equal to zero. The only way to do this is with scoreboard teams, you can use a target selector @a[team=DA] to check for anyone on team DA, as well as @a[team=!] which just checks for anyone NOT on any team. Or you could use @a[team=!DA] which would select anyone NOT on the DA team specifically.