Advertisement
Guest User

Untitled

a guest
May 19th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.24 KB | None | 0 0
  1. on rightclick on a barrier:
  2. add {APC.%player%} to {apples.%player%}
  3.  
  4. on first join:
  5. set {APC.%player%} to 1
  6. set {APS.%player%} to 0
  7. set {apples.%player%} to 0
  8.  
  9. command /upgrades [<text>]:
  10. trigger:
  11. if arg-1 is not set:
  12. open chest with 1 rows named "&a&lUPGRADES" to player
  13. wait 1 tick
  14. format slot 3 of player with magma cream named "&7&lAPC &a&lUPGRADES" to run [make player execute "/upgrades apc"]
  15. format slot 5 of player with magma cream named "&7&lAPS &a&lUPGRADES" to run [make player execute "/upgrades aps"]
  16. if arg-1 is "apc":
  17. open chest with 1 rows named "&7&lAPC &a&lUPGRADES" to player
  18. wait 1 tick
  19. format slot 0 of player with arrow named "&c&lBack" to run [make player execute "/upgrades"]
  20. format slot 2 of player with apple named "&2+1 &a(200 Apples)" to run [apc(1, 200, player)]
  21. format slot 3 of player with apple named "&2+10 &a(2,000 Apples)" to run [apc(10, 2000, player)]
  22. format slot 4 of player with apple named "&2+100 &a(20,000 Apples)" to run [apc(100, 20000, player)]
  23. format slot 5 of player with apple named "&2+1,000 &a(200,000 Apples)" to run [apc(1000, 200000, player)]
  24. format slot 6 of player with apple named "&2+10,000 &a(2,000,000 Apples)" to run [apc(10000, 2000000, player)]
  25. format slot 7 of player with apple named "&2+100,000 &a(20,000,000 Apples)" to run [apc(100000, 20000000, player)]
  26. format slot 8 of player with apple named "&2+1,000,000 &a(200,000,000 Apples)" to run [apc(1000000, 200000000, player)]
  27. if arg-1 is "aps":
  28. open chest with 1 rows named "&7&lAPS &a&lUPGRADES" to player
  29. wait 1 tick
  30. format slot 1 of player with arrow named "&c&lBack" to run [make player execute "/upgrades"]
  31. format slot 2 of player with apple named "&2+1 &a(200 Apples)" to run [aps(1, 200, player)]
  32. format slot 3 of player with apple named "&2+10 &a(2,000 Apples)" to run [aps(10, 2000, player)]
  33. format slot 4 of player with apple named "&2+100 &a(1,000,000 Apples)" to run [aps(100, 1000000, player)]
  34. format slot 5 of player with apple named "&2+1,000 &a(10,000,000 Apples)" to run [aps(1000, 10000000, player)]
  35. format slot 6 of player with apple named "&2+10,000 &a(100,000,000 Apples)" to run [aps(10000, 100000000, player)]
  36. format slot 7 of player with apple named "&2+100,000 &a(1,000,000,000 Apples)" to run [aps(100000, 1000000000, player)]
  37. format slot 8 of player with apple named "&2+1,000,000 &a(10,000,000,000 Apples)" to run [aps(1000000, 10000000000, player)]
  38.  
  39. function apc(n: number , m: number , p: player):
  40. if {apples.%{_p}%} is greater than {_m} - 1:
  41. add {_n} to {APC.%{_p}%}
  42. send "&2You purchased &a+%{_n}% &2APC" to {_p}
  43. remove {_m} from {apples.%{_p}%}
  44. else if {apples.%{_p}%} is less than {_m}:
  45. send "&cYou don't have enough apples to purchase this! &7(%{apples.%{_p}%}%/%{_m}%)" to {_p}
  46.  
  47. function aps(n: number , m: number , p: player):
  48. if {apples.%{_p}%} is greater than {_m} - 1:
  49. add {_n} to {APS.%{_p}%}
  50. send "&2You purchased &a+%{_n}% &2APS" to {_p}
  51. remove {_m} from {apples.%{_p}%}
  52. else if {apples.%{_p}%} is less than {_m}:
  53. send "&cYou don't have enough Apples to purchase this! &7(%{apples.%{_p}%}%/%{_m}%)" to {_p}
  54.  
  55. command /reset <player>:
  56. permission: stats.reset
  57. trigger:
  58. set {apples.%arg-1%} to 0
  59. set {APS.%arg-1%} to 0
  60. set {APC.%arg-1%} to 1
  61.  
  62. command /set <text> <player> <number>:
  63. permission: stats.reset
  64. trigger:
  65. if arg-1 is "apples":
  66. set {apples.%arg-2%} to arg-3
  67. if arg-1 is "aps":
  68. set {APS.%arg-2%} to arg-3
  69. if arg-1 is "apc":
  70. set {APC.%arg-2%} to arg-3
  71.  
  72. every second:
  73. loop all players:
  74. if {APS.%loop-player%} is greater than 0:
  75. add {APS.%loop-player%} to {apples.%loop-player%}
  76.  
  77. every tick:
  78. loop all players:
  79. set action bar of loop-player to "&4&lApples: &c%{apples.%loop-player%}% &8| &4&lAPC: &c%{APC.%loop-player%}% &8| &4&lAPS: &c%{APS.%loop-player%}%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement