Need help with Coomand Blocks

1 emeralds6 replies497 views
Roadkill2552 started 05/17/2014 4:35 pm
AetherMaster replied 05/23/2014 12:11 am
Ok, so im making this map, you see. and i have amulti money system. im having 1 issue,
because of the location of the shop, i can only fit 1 command block, and the item that your buying costs 2 different types of money. Gold & Resources. So is there a coomand similar to the one below that will not just remove x amount from 1 time of money, but 2 different types of points.

scoreboard players remove @p[score_TeamGold_min=100] TeamGold 100

Ya see there i can take away 100$ from the Team Gold Deposit. But The Item the player buys costs 500 Resources as well. so i need to know if there is a way and a coomand that will take away 100 From Team Gold and 500 from Resources with 1 coomand block.

Ive always had problems, stringing togeather commands so im not sure about this.
IF Anyone can help and supply a valid answer, That would be super fantastic.
and Very Much Appreciated!

Posted by avatar
Level 24 : Expert Engineer

6 replies

05/23/2014 12:11 am
Level 44 : Master Demolitionist
Clicking the button will activate a setblock to the 2 command blocks BUT if the players have less than 500 resources or 100 gold than they could just click the button to get a bunch of the item and their score or money would go negative.
Therefore if your not use /testfor @p[score_scorenamehere_min=500] and let the signal it outputs go into another command block that takes away that amount of score.
That way the player can't have infinite amounts of the item that's being sold.
05/17/2014 9:39 pm
Level 24 : Expert Engineer
05/17/2014 4:44 pm
Level 38 : Artisan Electrician
What you could do is have two command blocks somewhere else on the map. One takes off money and one takes off currency. When you press the button to buy it, the command block behind the button sets a redstone block next to the two command blocks with /setblock.
05/17/2014 5:41 pm
Level 24 : Expert Engineer
This is a good idea. i never would have thought of that. and then i can just have my two currency commad blocks that take away the money, and then it will replace the redstone block with air. Thankyou so much.

05/17/2014 5:09 pm
Level 21 : Expert Artist
You could do this 2 ways:

You would need 3 command blocks, since you'd be placing a redstone block but not removing it. So, set up your command block behind the button to have /setblock and the redstone block, then have 3 command block somewhere else, with 2 having your currency things and one having another setblock, but when powered, it replaces the redstone block with air.

Or, if "/gamerule doTileDrops" is false (which will make it so you can't get any drops from blocks at all sadly) you can simply paste this code in:
/setblock x y z redstone_block 0 destroy
It will turn the old redstone block into air for a tick then replace the air with a redstone block automatically.

Either way, your choice, as I was merely expanding on WaffleKing's idea.
05/17/2014 5:08 pm
Level 20 : Expert Nerd
Make it /fill an area with redstone blocks to activate multiple command blocks, but the above is basically right.
Planet Minecraft Logo


© 2010 - 2020