1
Scoreboard shop help
hey guys im making an arena map and there will be a shop included in it in which the currency is kill points, but the only problem it the command /scoreboard players remove @p[score_kills_min=10] Kills 10. The command in the command block works but once it activates the comparator to give the player the item the comparator wont deactivate so the item can only be bought once, is there anything i can do to make the item be able to be bought more then once thanks
Create an account or sign in to comment.
6
Use this:
Just make sure the redstone activating the command block also turns off the torch.
Just make sure the redstone activating the command block also turns off the torch.
Em simply don't use comparators. Make a commandblock that does /give [item] [amount] @p[score_kills_min=10,r=*put a range here*]. Than one that does /scoreboard players remove @p[score_kills_min=10,r=*put range here*] Kills 10.
You REALLY need to entre in a max range cuz otherwise if a player with 9 kills pushed it and someone else does has 10 kills, that other person is the nearest player with 10 kills and buys something he might not want!
You REALLY need to entre in a max range cuz otherwise if a player with 9 kills pushed it and someone else does has 10 kills, that other person is the nearest player with 10 kills and buys something he might not want!
Here's how I did it on SPCraft.
Button Signal goes to Both the following:
CMD Block [Set Dummy Objective "ShopTransaction" to 0 - to clear existing states]
Repeater with 3 tick delay to ensure above command block completes its action.
Repeater Signal then goes to the following:
A command block to check testfor on the "ShopTransaction" to ensure it is 0 [No Transactions In Progress]
The command block is connected to a comparitor/repeater chain
The output from this comparitor/repeater chain will then run to 2 command blocks
One to set the "ShopTransaction" to 1 [In Progress]
One to deduct the scoreboard balance from the user (with your @p conditional mentioned above)
The output from the comparitor/repeater chain should also loop back (with a delay of say, 6 ticks) to the Comparitor itself as a B-Signal to reset the state, as well as to the command block that tests the "ShopTransaction" state (with a delay of 3 ticks)
This will force a re-test of the transactional state causing the output of the command block to be false, and thus not resending the signal through again. The loop back to the comparitor on the B-Signal will reset it's state to off, ready for the next use.
the output should also be looped back to both the comparitor (with a few ticks delay) to initiate disabling of it as well as a loop back to the original testfor command block to retest the balance
Button Signal goes to Both the following:
CMD Block [Set Dummy Objective "ShopTransaction" to 0 - to clear existing states]
Repeater with 3 tick delay to ensure above command block completes its action.
Repeater Signal then goes to the following:
A command block to check testfor on the "ShopTransaction" to ensure it is 0 [No Transactions In Progress]
The command block is connected to a comparitor/repeater chain
The output from this comparitor/repeater chain will then run to 2 command blocks
One to set the "ShopTransaction" to 1 [In Progress]
One to deduct the scoreboard balance from the user (with your @p conditional mentioned above)
The output from the comparitor/repeater chain should also loop back (with a delay of say, 6 ticks) to the Comparitor itself as a B-Signal to reset the state, as well as to the command block that tests the "ShopTransaction" state (with a delay of 3 ticks)
This will force a re-test of the transactional state causing the output of the command block to be false, and thus not resending the signal through again. The loop back to the comparitor on the B-Signal will reset it's state to off, ready for the next use.
the output should also be looped back to both the comparitor (with a few ticks delay) to initiate disabling of it as well as a loop back to the original testfor command block to retest the balance
Hook the switch/lever up to a timer that will check for that amount of kills each time they click it. The lever/switch will have to be deactivated after using the shop or the player will constantly get those items after they reach that certain amount of kills
could i have a clock and a player presses a button which deactivates a piston in a inverteer so the command block will only check when the button is pushed