I'm making a map with money as a part of it, and I'm using the scoreboard as a bank, so I need help with some commands.

The first thing I need is a command (command+1) to make a scoreboard command:

/scoreboard players add Dollar Bank #

In a command block to go up by 1 multiple times. This is so you can multiply how much you make.

For example, before command+1:

/scoreboard players add Dollar Bank 1

After command+1:

/scoreboard players add Dollar Bank 2

Secondly, I need a way of checking the amount in the bank to tell me if there's enough Dollars for purchases and upgrades.

If there's not enough, play command:

/say Not Enough Dollars

If there is enough, play commands:

/scoreboard players remove Dollars Bank #
/say Purchase was successful, # of dollars removed

If an upgrade, play command+1.

enter image description here

  • I think you need a different way of adding Dollers. (Or do you mean Dollars?) That is because the add command would increase the number of money by the amount stated - so first 1, then 2, then 3 and so on, making the total 1, then 3, then 6... – Auro Oct 10 '16 at 5:58
  • the command {/scoreboard add players add Dollar Bank #} would add the set # of Dollar(s) per redstone tic. I need a command that would increase the set # by 1. so if the command was {/scoreboard add players add Dollar Bank 7} you would get 7 Dollars per tic. – RagingCreeper44 Oct 10 '16 at 6:29
  • That seems a bit too... Fast, don't you think? I would rather have it on a repeater timer or similar to slow down it, or have them be cents (basically 1/100th of a Dollar) instead. – Auro Oct 10 '16 at 10:53
  • 1
    i have it set to a redstone timer. and to get money you have to stand on a Pressure witch turns the timer on. In the later game when you get more money there willl be an upgrade that will do the tic a sec thing. – RagingCreeper44 Oct 10 '16 at 16:18

first off, when you're making a scoreboard you use /scoreboard objectives not players, players is when you've made the objective and are ready to use it, it can not make objectives for you

secondly, bank is not a scoreboard type, dummy is when you want a scoreboard to hold a value for you

so you'll need

/scoreboard objectives add <name> dummy <displayName>

for the adding of currency to a persons bank you'll use some thing like this:

/scoreboard players add <player name> bank <int>

subtracting is somewhat harder, I'm going to use constant values in another scoreboard, namely const for the scoreboard and a dummy player ONE for the value 1

/scoreboard players operation <player name> bank -= ONE const

the shown command will subtract one from the players bank

for testing if someone has enough of the currency in their bank to purchase something, that's even harder

you'll have to use a /scoreboard players test <player name> <objective> <min> <max> (max isn't needed if you want to see if they have more then min), then in a conditional commandblock complete the purchase, for each item

  • as you can see in the picture the reason i use /scoreboard players you can see multiple currencies at one time. – RagingCreeper44 Oct 11 '16 at 22:01
  • all so thx for the /scoreboard players test <player name> <objective> <min> <max – RagingCreeper44 Oct 11 '16 at 22:10
  • so you want to know how to add a scoreboard value to another one? if so you can use /scoreboard players operation <player name> <objective> += <player> <objective> and the answer will go into the first objective, note: you can also use *= and /= for multiplication and division – Venya Oct 11 '16 at 22:14
  • yes thx you for the help – RagingCreeper44 Oct 11 '16 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.