Advertisement
Guest User

Untitled

a guest
Jul 14th, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.85 KB | None | 0 0
  1.  
  2.  
  3.  
  4. options:
  5. prefix: &2[&aEconomy Plus&2] &a
  6. startingbal: 100 # starting bal
  7. sign: $ # The eco sign for stuff
  8. aminecost: 110
  9.  
  10. # prices
  11. cobblestoneprice: 1
  12. coalprice: 2
  13. ironprice: 5
  14.  
  15. on load:
  16. clear {economy::blocks::*}
  17. add cobblestone to {economy::blocks::*}
  18. add coal to {economy::blocks::*}
  19. add iron ore to {economy::blocks::*}
  20. set {_i} to 1
  21.  
  22. on connect:
  23. if {economy::bal::%player%} is not set:
  24. set {economy::bal::%player%} to 100
  25.  
  26.  
  27. command /shop [<text>] [<text>]:
  28. trigger:
  29. if arg 1 is not set:
  30. wait 2 ticks
  31. open chest with 6 rows named "&cShop" to player
  32. wait 2 ticks
  33. loop integers between 0 and 54 - 1:
  34. format slot loop-number of player with gray stained glass pane named "&r" to be unstealable
  35. format slot 20 of player with red wool named "&cSell Items" with lore "&7Sell your mined items here" to close then run [make player execute command "/shop sell"]
  36. format slot 24 of player with green wool named "&aBuy Items" with lore "&7Buy tools, armor, and wepons here" to close then run [make player execute command "/shop buy"]
  37. format slot 31 of player with magenta glazed terracotta named "&dRank &5Upgrade" with lore "&7Rankup and get acess to higher level mines" to close then run [make player execute command "/shop rankup"]
  38. else:
  39. if arg 1 is "sell" or "buy" or "rankup":
  40. #sell
  41. if arg 1 is "sell":
  42. if arg 2 is not set:
  43. wait 2 ticks
  44. open chest with 6 rows named "&cShop" to player
  45. wait 2 ticks
  46. loop integers between 0 and 54 - 1:
  47. format slot loop-number of player with gray stained glass pane named "&r" to be unstealable
  48. format slot 10 of player with cobblestone named "&fcobblestone" with lore "" to close then run [make player execute command "/shop sell cobblestone"]
  49. format slot 11 of player with coal named "&fCoal" to close then run [make player execute command "/shop sell coal"]
  50. format slot 12 of player with iron ore named "&fIron ore" to close then run [make player execute command "/shop sell iron ore"]
  51. else:
  52. if {economy::blocks::*} contains arg 2:
  53. message "{@prefix}Executing sell"
  54. set {_i} to arg 2
  55. set {_p} to player
  56. if {_i} is cobblestone:
  57. set {_price} to {@cobblestoneprice}
  58. if {_i} is coal:
  59. set {_price} to {@coalprice}
  60. if {_i} is iron ore:
  61. set {_price} to {@ironprice}
  62. set {_itemstheyhave} to number of {_i} in {_p}'s inventory
  63. if {_itemstheyhave} > 0:
  64. set {_amnttoadd} to {_price}*{_itemstheyhave}
  65. add {_amnttoadd} to {economy::bal::%player%}
  66.  
  67. remove all {_i} from {_p}
  68. send "{@prefix}Sold %{_itemstheyhave}% item(s) totaling {@sign}%{_amnttoadd}%" to {_p}
  69. else:
  70. message "{@prefix}You need to have at least 1 of that item!"
  71. else:
  72. message "{@prefix}Unknown item!"
  73. #buy
  74. if arg 1 is "buy":
  75. if arg 2 is not set:
  76. wait 2 ticks
  77. open chest with 6 rows named "&aBuy Items" to player
  78. wait 2 ticks
  79. loop integers between 0 and 54 - 1:
  80. format slot loop-number of player with gray stained glass pane named "&r" to be unstealable
  81. format slot 20 of player with diamond pickaxe named "&bPickaxes" with lore "&7Upgrade and enchant your pickaxe here" to close then run [make player execute command "/shop buy pickaxe"]
  82. format slot 22 of player with iron horse armor named "&cWepons" with lore "&7Buy tools, armor, and wepons here" to close then run [make player execute command "/shop buy wepons"]
  83. format slot 24 of player with chainmail chestplate named "&aArmor" with lore "&7Sell your mined items here" to close then run [make player execute command "/shop buy armor"]
  84. format slot 40 of player with barrier named "&cBack" with lore "&7Sell your mined items here" to close then run [make player execute command "/shop"]
  85. else if arg 2 is "pickaxe" or "wepons" or "armor":
  86. if arg 2 is "pickaxe":
  87. wait 2 ticks
  88. open chest with 3 rows named "&3Pickaxe" to player
  89. wait 2 ticks
  90. loop integers between 0 and 27 - 1:
  91. format slot loop-number of player with gray stained glass pane named "&r" to be unstealable
  92. format slot 0 of player with paper named "&fInfo" with lore "&fHere you can upgrade your pickaxe with just one click, assuming you have the right amount of experiance and money." to be unstealable
  93. format slot 18 of player with Sunflower named "&a%{economy::bal::%player%}% &2Credits" to be unstealable
  94. #rankup
  95. if arg 1 is "rankup":
  96. rankupgrade(player)
  97. if {economy::rankup::%player%} is true:
  98. wait 2 ticks
  99. open chest with 3 rows named "&dRank &5Upgrade" to player
  100. wait 2 ticks
  101. loop integers between 0 and 27 - 1:
  102. format slot loop-number of player with gray stained glass pane named "&r" to be unstealable
  103. format slot 0 of player with paper named "&fInfo" with lore "&fHere you can upgrade your rank with just one click, assuming you have a high enough balance." to be unstealable
  104. format slot 18 of player with Sunflower named "&a%{economy::bal::%player%}% &2Credits" to be unstealable
  105. format slot 13 of player with diamond pickaxe named "%{price::%player%}%" to be unstealable
  106. else:
  107.  
  108. else:
  109. message "{@prefix}Unknown category!"
  110.  
  111. command /bal [<offline player>]:
  112. aliases: /balance, /money, /coins
  113. trigger:
  114. if arg 1 is not set:
  115. message "{@prefix}Your current balance is {@sign}%{economy::bal::%player%}%"
  116. else:
  117. if {economy::bal::%arg 1%} is not set:
  118. message "{@prefix}%arg 1% has not logged on to the server before!"
  119. else:
  120. message "{@prefix}%arg 1% current bal is {@sign}%{economy::bal::%arg 1%}%"
  121.  
  122. function sellitm(p: player, i: item):
  123. set {_price} to {economy::shop::price::%{_i}%}
  124. set {_itemstheyhave} to number of {_i} in {_p}'s inventory
  125. if {_itemstheyhave} > 1:
  126. set {_amnttoadd} to {_price} * {_itemstheyhave}
  127. add {_amnttoadd} to {economy::bal::%{_p}%}
  128. loop integers between 1 and {_itemstheyhave}:
  129. remove all {_i} from {_p}
  130. send "{@prefix}Sold %{_itemstheyhave}% items totaling {@sign}%{_amnttoadd}%" to {_p}
  131.  
  132. function rankupgrade(p: player):
  133. set {_prices} to {aminecost}*{rankup::teir::%{_p}%}
  134. set {price::%{_p}%} to {_prices}
  135. if {economy::bal::%{_p}%} > {_prices}:
  136. set {economy::rankup::%{_p}%} to true
  137. else:
  138. set {economy::rankup::%{_p}%} to false
  139.  
  140. command /setbal [<integer>] [<player>]:
  141. aliases: /setbalance, /balset, /balanceset
  142. permission: economy.admin.resetbal
  143. permission message: "&4You do not have the permission required to preform this command."
  144. trigger:
  145. if arg 1 is not set:
  146. message "{@prefix}&cPlease specify a number"
  147. else if arg 1 is set:
  148. if arg 2 is not set:
  149. set {economy::bal::%player%} to arg 1
  150. message "{@prefix}%player%&a's bal was set to &2{@sign}%arg 1%"
  151. else:
  152. set {economy::bal::%arg 2%} to arg 1
  153. message "{@prefix}%arg 2%'s bal was set to %arg 1%"
  154.  
  155. command /balreset [<offlineplayer>]:
  156. aliases: /balancereset
  157. permission: economy.admin.resetbal
  158. permission message: "&4You do not have the permission required to preform this command."
  159. trigger:
  160. set {economy::bal::%arg 1%} to {@startingbal}
  161. message "{@prefix}%arg 1%&a's bal was reset"
  162.  
  163. command /ecohelp [<integer>]:
  164. aliases: /helpeco, /economyhelp, /helpeconomy
  165. trigger:
  166. message "{@prefix} Help &7---[Page 1 of 1]---"
  167. message "&c/bal &fView the amount of money you have"
  168. message "&c/shop &fAllows you to sell and buy items"
  169. message "&c/ecohelp &fThis page your looking at right now"
  170. message "&c/rankup &fOpens up the rankup menu"
  171. message "&c/setbal <number> <player> &fChange someones balance &7(admin only)"
  172. message "&c/resetbal &fResets a players balance &7(admin only)"
  173.  
  174. command /rankup:
  175. trigger:
  176. make player execute command "/shop rankup"
  177.  
  178. #----G-U-N-S-----
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement