Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function shop(player: player, item: item, cost: integer):
- wait 1 second
- set {amount.%{_player}%} to 1
- set {guiopen.%{_player}%} to true
- open virtual chest inventory with 3 rows named "&6Buy" to {_player}
- loop all numbers between 0 to 26:
- format gui slot loop-number of {_player} with black glass pane named " "
- format gui slot 10 of {_player} with red glass pane named "&c-64" to run:
- loop 64 times:
- if {amount.%{_player}%} is more than 1:
- remove 1 from {amount.%{_player}%}
- format gui slot 11 of {_player} with red glass pane named "&c-10" to run:
- loop 10 times:
- if {amount.%{_player}%} is more than 1:
- remove 1 from {amount.%{_player}%}
- format gui slot 12 of {_player} with red glass pane named "&c-1" to run:
- if {amount.%{_player}%} is more than 1:
- remove 1 from {amount.%{_player}%}
- format gui slot 14 of {_player} with lime glass pane named "&a+1" to run:
- if {amount.%{_player}%} is less than 2304:
- add 1 to {amount.%{_player}%}
- format gui slot 15 of {_player} with lime glass pane named "&a+10" to run:
- loop 10 times:
- if {amount.%{_player}%} is less than 2304:
- add 1 to {amount.%{_player}%}
- format gui slot 16 of {_player} with lime glass pane named "&a+64" to run:
- loop 64 times:
- if {amount.%{_player}%} is less than 2304:
- add 1 to {amount.%{_player}%}
- while {amount.%{_player}%} is more than 0:
- format gui slot 13 of {_player} with 1 of {_item} named "&6%{_item}%" with lore "&aCurrent amount: %{amount.%{_player}%}%" to close:
- if {balance::%{_player}%} is less than {_cost}*{amount.%{_player}%}:
- send "&5&lPURG&d&lRB &e>> &cYour balance is insufficient! You'd need %{_cost}*{amount.%{_player}%}-{balance::%{_player}%}% more to buy this." to {_player}
- set {amount.%{_player}%} to 0
- if {balance::%{_player}%} is more than {_cost}*{amount.%{_player}%}-1:
- remove {_cost}*{amount.%{_player}%} from {balance::%{_player}%}
- give {_player} {amount.%{_player}%} of {_item}
- send "&5&lPURG&d&lRB &e>> &bPurchase successful! You got %{amount.%{_player}%}% of %{_item}%"
- set {amount.%{_player}%} to 0
- wait 1 second
- on inventory close:
- set {amount.%{_player}%} to 0
- command /eco <player> <integer>:
- permission: xevi.eco
- trigger:
- add arg-2 to {balance::%arg-1%}
- send "&5&lPURG&d&lRB &e>> &bYou gave &a&l%arg-1% &6$%arg-2%&b!"
- command /balance [<player>]:
- trigger:
- if arg-1 is not set:
- send "&5&lPURG&d&lRB &e>> &bYour balance is &6$%{balance::%player%}%."
- if arg-1 is set:
- send "&5&lPURG&d&lRB &e>> &bThe balance of &a%arg-1%&b is &6$%{balance::%arg-1%}%."
- command /shop [<string>]:
- trigger:
- if arg-1 is not set:
- open virtual chest inventory with 6 rows named "&6Shop" to player
- loop all numbers between 0 to 53:
- format gui slot loop-number of player with black glass pane named " " to close
- format gui slot 1 of player with stone block named "&8Stone" with lore "&cCost: $30" to run:
- shop(player, stone, 30)
Advertisement
Add Comment
Please, Sign In to add comment