Guest User

Untitled

a guest
May 20th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. function shop(player: player, item: item, cost: integer):
  2. wait 1 second
  3. set {amount.%{_player}%} to 1
  4. set {guiopen.%{_player}%} to true
  5. open virtual chest inventory with 3 rows named "&6Buy" to {_player}
  6. loop all numbers between 0 to 26:
  7. format gui slot loop-number of {_player} with black glass pane named " "
  8. format gui slot 10 of {_player} with red glass pane named "&c-64" to run:
  9. loop 64 times:
  10. if {amount.%{_player}%} is more than 1:
  11. remove 1 from {amount.%{_player}%}
  12. format gui slot 11 of {_player} with red glass pane named "&c-10" to run:
  13. loop 10 times:
  14. if {amount.%{_player}%} is more than 1:
  15. remove 1 from {amount.%{_player}%}
  16. format gui slot 12 of {_player} with red glass pane named "&c-1" to run:
  17. if {amount.%{_player}%} is more than 1:
  18. remove 1 from {amount.%{_player}%}
  19. format gui slot 14 of {_player} with lime glass pane named "&a+1" to run:
  20. if {amount.%{_player}%} is less than 2304:
  21. add 1 to {amount.%{_player}%}
  22. format gui slot 15 of {_player} with lime glass pane named "&a+10" to run:
  23. loop 10 times:
  24. if {amount.%{_player}%} is less than 2304:
  25. add 1 to {amount.%{_player}%}
  26. format gui slot 16 of {_player} with lime glass pane named "&a+64" to run:
  27. loop 64 times:
  28. if {amount.%{_player}%} is less than 2304:
  29. add 1 to {amount.%{_player}%}
  30. while {amount.%{_player}%} is more than 0:
  31. format gui slot 13 of {_player} with 1 of {_item} named "&6%{_item}%" with lore "&aCurrent amount: %{amount.%{_player}%}%" to close:
  32. if {balance::%{_player}%} is less than {_cost}*{amount.%{_player}%}:
  33. send "&5&lPURG&d&lRB &e>> &cYour balance is insufficient! You'd need %{_cost}*{amount.%{_player}%}-{balance::%{_player}%}% more to buy this." to {_player}
  34. set {amount.%{_player}%} to 0
  35. if {balance::%{_player}%} is more than {_cost}*{amount.%{_player}%}-1:
  36. remove {_cost}*{amount.%{_player}%} from {balance::%{_player}%}
  37. give {_player} {amount.%{_player}%} of {_item}
  38. send "&5&lPURG&d&lRB &e>> &bPurchase successful! You got %{amount.%{_player}%}% of %{_item}%"
  39. set {amount.%{_player}%} to 0
  40. wait 1 second
  41. on inventory close:
  42. set {amount.%{_player}%} to 0
  43. command /eco <player> <integer>:
  44. permission: xevi.eco
  45. trigger:
  46. add arg-2 to {balance::%arg-1%}
  47. send "&5&lPURG&d&lRB &e>> &bYou gave &a&l%arg-1% &6$%arg-2%&b!"
  48. command /balance [<player>]:
  49. trigger:
  50. if arg-1 is not set:
  51. send "&5&lPURG&d&lRB &e>> &bYour balance is &6$%{balance::%player%}%."
  52. if arg-1 is set:
  53. send "&5&lPURG&d&lRB &e>> &bThe balance of &a%arg-1%&b is &6$%{balance::%arg-1%}%."
  54. command /shop [<string>]:
  55. trigger:
  56. if arg-1 is not set:
  57. open virtual chest inventory with 6 rows named "&6Shop" to player
  58. loop all numbers between 0 to 53:
  59. format gui slot loop-number of player with black glass pane named " " to close
  60. format gui slot 1 of player with stone block named "&8Stone" with lore "&cCost: $30" to run:
  61. shop(player, stone, 30)
Advertisement
Add Comment
Please, Sign In to add comment