function BuyDirt(p: player):
if {DirtPurchased.%{_p}%} is not set: # makes it so you can only purchase once
if {balance::%{_p}'s uuid%} >= 20000: # check if player has sufficent balance
set {DirtPurchased.%{_p}%} to true # makes it so you can only purchase once
remove 20000 from {balance::%{_p}'s uuid%} # removes money from balance
make console execute command "SetBooster %{_p}% 2" # sets players boost from console
else:
send "&4&lError: &cInsufficent Balance!" to {_p} # message saying not enough money
else:
send "&4&lError: &cYou already purchased this!" to {_p} # message saying already purchase
Im having trouble with this. When i click a GUI item its supposed to do this, yet it dosent. Heres the line:
format slot 0 of player with dirt named "&7&lDirt Boost" with lore "&7This booster multiplys", "&7money by 2!" and "&6Cost: 20000" to run [set {DirtPP.%player%} to true]