Mine and I want to make a Minecraft city server on (private) and want a money system. I have already created a scoreboard (dummy) and we both have the value 1000. Now I want a purchase system. Maybe with the commands "scoreboard get NAME" to get the value of the account balance. How do I process this value in a command block so that the person can't get debts?
Scoreboard players remove @s [scores = {money = 500.}] money 500
This only deducts 500 if the player has the same or more than 500.
The German Minecraft Wiki also has a lot to offer: https://minecraft-de.gamepedia.com/...scoreboard
You should read this through if you want to do something in the direction.
If you want to give the player an item or something, you have to do it like this:
give @s [scores = {money = 500.}] apple
(of course before you withdraw the money)
Hope this helps you!
Thank you. I would have withdrawn the money and worked on it with a conditional command block. Means that you only have one apple z. B. Get if you have also sent the money.
Perfect!
I would also recommend that you take a look at datapacks and functions, they make life a lot easier on large projects. Even if, admittedly, they can have a somewhat deterrent effect.