Hey guys. I was creating a system on my server that has it so when you buy something, it takes it out of your balance and gives you the item. I know found out that you can have negative funds. I was wondering if there was a way to testfor a balance of zero or lower and if they did, the output would be to say tp them to a jail where they will slowly make their money back. Is there any way I can do this? Please put it in simpler terms because I'm not the best at commands!
Hey guys. I was creating a system on my server that has it so when you buy something, it takes it out of your balance and gives you the item. I know found out that you can have negative funds. I was wondering if there was a way to testfor a balance of zero or lower and if they did, the output would be to say tp them to a jail where they will slowly make their money back. Is there any way I can do this? Please put it in simpler terms because I'm not the best at commands!
@a[score_balance=-1] will return all players with a negative balance. I think it would be better to make the system not let them buy the item instead though. (also, @a[score_balance_min=0] will return all players with a non-negative balance)
Im sorry FirEmerald but this did not work for me. When I tried to do this, I attached a comparator to the command block and set my balance to -1. When I did this, the comparator did not light up. Is there something I did wrong?
Also, Im afraid that the command using anyone that is above the balance of 0 is instantly going to be teleported to my spawn. Is there a way I can select an area and only that specific area to make someone go to spawn if they have enough money?
Im sorry FirEmerald but this did not work for me. When I tried to do this, I attached a comparator to the command block and set my balance to -1. When I did this, the comparator did not light up. Is there something I did wrong?
would be better to use /execute @a[score_balance=-1] ~ ~ ~ tp [coords]
the @a[score_balance=-1] is just a player selector.
This still didn't work for me. In the attachment I set my balance to -1 yet again, and hit done, but I have no clue what to do now. What am I doing wrong now?
This still didn't work for me. In the attachment I set my balance to -1 yet again, and hit done, but I have no clue what to do now. What am I doing wrong now?
okay, is your balance a scoreboard objective or is it a plugin? I was going off of it as a scoreboard objective named "balance".
Hey guys. I was creating a system on my server that has it so when you buy something, it takes it out of your balance and gives you the item. I know found out that you can have negative funds. I was wondering if there was a way to testfor a balance of zero or lower and if they did, the output would be to say tp them to a jail where they will slowly make their money back. Is there any way I can do this? Please put it in simpler terms because I'm not the best at commands!
@a[score_balance=-1] will return all players with a negative balance. I think it would be better to make the system not let them buy the item instead though. (also, @a[score_balance_min=0] will return all players with a non-negative balance)
Creator of Metroid Cubed 3, a Metroid-themed mod! Become a donator today!
Im sorry FirEmerald but this did not work for me. When I tried to do this, I attached a comparator to the command block and set my balance to -1. When I did this, the comparator did not light up. Is there something I did wrong?
Also, Im afraid that the command using anyone that is above the balance of 0 is instantly going to be teleported to my spawn. Is there a way I can select an area and only that specific area to make someone go to spawn if they have enough money?
would be better to use /execute @a[score_balance=-1] ~ ~ ~ tp [coords]
the @a[score_balance=-1] is just a player selector.
Creator of Metroid Cubed 3, a Metroid-themed mod! Become a donator today!
This still didn't work for me. In the attachment I set my balance to -1 yet again, and hit done, but I have no clue what to do now. What am I doing wrong now?
okay, is your balance a scoreboard objective or is it a plugin? I was going off of it as a scoreboard objective named "balance".
Creator of Metroid Cubed 3, a Metroid-themed mod! Become a donator today!
its a plugin, Im using essentials