Annoying_Brother Posted November 1, 2020 Share Posted November 1, 2020 variables: {money} = 0 command /balance: aliases: /bal trigger: send "&aYou have %{money}% &ain your bank!" command /pay <player> <integer>: trigger: if {money} >= arg-integer: subtract arg-integer from {uuid::%player%::money} add arg-integer to {uuid::%arg-player%::money} else: send "You don't have enough money!" to player every 1 second: loop all players: add 1 to {{uuid::%loop-player%}::money} This doesn't work at all as all the money is the same as 1 person and it doesn't give any money at all! Please help. Thank you! Link to comment Share on other sites More sharing options...
Satellq Posted November 1, 2020 Share Posted November 1, 2020 variables: {%player%.balance} = 0 # Starting balance command /balance: aliases: /bal trigger: send "&7Balance: &2$&a%{%player%.balance}%" command /pay <player> <integer>: trigger: if {%player%.balance} >= arg-2: remove arg-2 from {%player%.balance} add arg-2 to {%arg-1%.balance} send "&7You sent &2$&a%arg-2% &7to &a%arg-1%" to player send "&7You received &2$&a%arg-2% &7from &a%player%" to %arg-1% else: send "&7You don't have enough money." to player every second: loop all players: add 1 to {%loop-player%.balance} I didn't test it but hopefully it works, by the way you can use Vault instead of creating a variable for player's balance. It would be much easier: add 1 to player's balance / remove 1 to player's balance / if player's balance >= x: 1 Link to comment Share on other sites More sharing options...
AgentGamerPro Posted November 1, 2020 Share Posted November 1, 2020 5 hours ago, Annoying_Brother said: variables: {money} = 0 command /balance: aliases: /bal trigger: send "&aYou have %{money}% &ain your bank!" command /pay <player> <integer>: trigger: if {money} >= arg-integer: subtract arg-integer from {uuid::%player%::money} add arg-integer to {uuid::%arg-player%::money} else: send "You don't have enough money!" to player every 1 second: loop all players: add 1 to {{uuid::%loop-player%}::money} This doesn't work at all as all the money is the same as 1 person and it doesn't give any money at all! Please help. Thank you! you are setting your {money} variable as the whole server. you would need to change it to a player variable. for example, {money.%player%}. This is also used as attacker and victim for damage and death events, like so. {money.%victim%} and {money.%attacker%} Another reminder, when variables are going in text like in line 7, you need to put percent signs before and after the variable, like this. %{money.%player%}% Lifestealed | Minecraft Servers OG [VIP] 12/26/20 - 10/27/2021 OG [PRO] 12/27/21 - 11/18/2022 OG [LEGEND] 11/18/2022 - 3/14/2023 [DEFAULT] 3/14/2023 - Present Link to comment Share on other sites More sharing options...
RedstoneGamer54 Posted November 2, 2020 Share Posted November 2, 2020 it is better to use list variables over nest variables Link to comment Share on other sites More sharing options...
Annoying_Brother Posted November 23, 2020 Author Share Posted November 23, 2020 What I did to fix it is {money::%player's uuid%} Works perfectly! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now