1

Problem with testfor score going negative

FinalFormSora 11/20/13 5:38 pm
1.7k
1/8/2014 11:33 am
Using this tutorial
https://www.youtube.com/watch?v=iZIRp688GSI

I built a nice shop setup. Problem is when I set the command block that takes the money from the players using /testfor @p[score_Gold_min=5] it goes into negative numbers and still gives them the item.

Basically, it means they only have to initially have the 5 'once' it seems. After that they can keep jumping on the pressure plate getting the item, and going further negative.

I tried doing something like /testfor @p[score_Gold_min=-100] in a different command block to have another once set the player back to 0. Either testfor can't use negative number or I am missing something. I even tried /testfor @p[score_Gold_min=-1,score_Gold-500] to try and set a min and max. Also tried it using 2 separate command blocks.

as it stands it would seem that /testfor @p[score_Gold_min=5] is slightly broken and does not know to stop at 0.

Any help would be appreciated thank you.
Posted by
FinalFormSora
Level 13 : Journeyman Explorer
7

  Have something to say?

JoinSign in

3

aboveordinary
01/08/2014 10:39 am
Level 43 : Master System
you used the string 'min' which means that anything less than 5 is going to trigger it. I would make it 'score_Gold=5,score_Gold_min=5' so if they have exactly 5 then it activates. If you want it to say "if they have more than 5 gold, activate, use this command 'score_Gold=5'. Or if you want anything but negative #'s you can use 'score_Gold=5,score_Gold_min=0'
1
Jmal116
01/08/2014 11:33 am
Level 34 : Artisan System
You have it backwards, score_Gold_min=5 testfors a MINIMUM of 5, meaning 5 or above. score_Gold=5 testfors a MAXIMUM of 5, so 5 or below.

This being said, the design that OP originally had with /testfor @p[score_Gold_min=5] should work fine, OP just has to remember to make all of the commands to remove gold and give the items after this testfor, so that they only execute if they have a score above 5.
1
Mr Chucky
01/08/2014 10:35 am
Level 44 : Master Lumberjack
Hey PunJedi,

In the tutorial you used is no Testfor command, So what is your setup?

Regards,
Mr Chucky
1

Welcome