Guest User

Untitled

a guest
Jun 25th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.06 KB | None | 0 0
  1. import:
  2. org.bukkit.event.inventory.InventoryClickEvent
  3. expression [event( |-)]([number ]key|hot[[ ]bar][ key])[ button]:
  4. return type: integer
  5. get:
  6. return event.getHotbarButton() + 1 if event.getHotbarButton() != -1
  7. return -1
  8.  
  9. expression [event( |-)]([number ]key|hot[[ ]bar][ key])[ button]( |-)slot:
  10. return type: integer
  11. get:
  12. return event.getHotbarButton() if event.getHotbarButton() != -1
  13. return -1
  14. function compare(1: inventory, 2: inventory) :: boolean:
  15. return false if (name of {_1}) != (name of {_2})
  16. return false if (rows of {_1}) != (rows of {_2})
  17. return false if type of {_1} != type of {_2}
  18. return true
  19. on inventory close:
  20. delete {atmopen.%player%}
  21. command /atm:
  22. trigger:
  23. set {atmopen.%player%} to true
  24. set metadata tag "atm" of player to chest inventory with 4 rows named "&8Select an account type:"
  25. set slot 4 of (metadata tag "atm" of player) to skull of player named "&e&l%player%" with lore "&fPrivate acount: &l%balance of player%" and "Soon"
  26. set slot 20 of (metadata tag "atm" of player) to redstone block named "&4&l[!] &cComing Soon"
  27. set slot 22 of (metadata tag "atm" of player) to gold block named "&6&l[!] &ePrivate account"
  28. set slot 24 of (metadata tag "atm" of player) to diamond block named "&3&l[!] &bComing Soon"
  29. open (metadata tag "atm" of player) to player
  30. on inventory click:
  31. if {atmopen.%player%} is true:
  32. if compare(metadata tag "atm" of player, event-inventory) = true:
  33. cancel event
  34. if index of event-slot is 24:
  35. close player's inventory
  36. set action bar of player to "&c&l(!) &cComing soon! &7V{@Version}"
  37. else if index of event-slot is 20:
  38. close player's inventory
  39. set action bar of player to "&c&l(!) &cComing soon! &7V{@Version}"
  40. else if index of event-slot is 22:
  41. set metadata tag "pa" of player to chest inventory with 5 rows named "&8Total value: &6%balance of player%"
  42. set slot 13 of metadata tag "pa" of player to ghast tear named "€500" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
  43. set slot 20 of metadata tag "pa" of player to diamond named "€200" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
  44. set slot 21 of metadata tag "pa" of player to redstone dust named "€100" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
  45. set slot 22 of metadata tag "pa" of player to emerald named "€50" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
  46. set slot 23 of metadata tag "pa" of player to coal named "€20" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
  47. set slot 24 of metadata tag "pa" of player to iron ingot named "€5" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
  48. set slot 31 of metadata tag "pa" of player to gold ingot named "€1" with lore "&f", "&e[Right Click] &7To Withdraw", "&e[Left Click] &7To deposit" and "&f"
  49. open (metadata tag "pa" of player) to player
  50. wait 1 tick
  51. set {atmopen.%player%} to true
  52. else if compare(metadata tag "pa" of player, event-inventory) = true:
  53. cancel event
  54. if index of event-slot is 13:
  55. if click type is right mouse button:
  56. if balance of player >= 500:
  57. remove 500 from player's balance
  58. message "{@Prefix-ATM} &7You have successfully withdrawn &d€500 &7from your &dbank &7account."
  59. give player 1 of ghast tear named "€500" with lore "&f" and "&fofficial Ayra Banknote"
  60. else:
  61. close player's inventory
  62. send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
  63. else if click type is left mouse button:
  64. if player has ghast tear:
  65. remove 1 ghast tear from player
  66. add 500 to player's balance
  67. message "{@Prefix-ATM} &7You have successfully refunded &d€500 &7to your &dbank &7account."
  68. else:
  69. close player's inventory
  70. message "{@Prefix-ATM} &7You have no item of value &d€500 &7in your &dinventory&7."
  71. if index of event-slot is 20:
  72. if click type is right mouse button:
  73. if balance of player >= 200:
  74. remove 200 from player's balance
  75. send "{@Prefix-ATM} &7You have successfully withdrawn &d€200 &7from your &dbank &7account."
  76. give player 1 of diamond named "€200" with lore "&f" and "&fofficial Ayra Banknote"
  77. else:
  78. close player's inventory
  79. send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
  80. else if click type is left mouse button:
  81. if player has diamond:
  82. remove 1 diamond from player's inventory
  83. add 200 to player's balance
  84. send "{@Prefix-ATM} &7You have successfully refunded &d€200 &7to your &dbank &7account."
  85. else:
  86. close player's inventory
  87. send "{@Prefix-ATM} &7You have no item of value &d€200 &7in your &dinventory&7."
  88. if index of event-slot is 21:
  89. if click type is right mouse button:
  90. if balance of player >= 100:
  91. remove 100 from player's balance
  92. send "{@Prefix-ATM} &7You have successfully withdrawn &d€100 &7from your &dbank &7account."
  93. give player 1 of redstone dust named "€100" with lore "&f" and "&fofficial Ayra Banknote"
  94. else:
  95. close player's inventory
  96. send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
  97. else if click type is left mouse button:
  98. if player has redstone dust:
  99. remove 1 redstone dust from player's inventory
  100. add 100 to player's balance
  101. send "{@Prefix-ATM} &7You have successfully refunded &d€100 &7to your &dbank &7account."
  102. else:
  103. close player's inventory
  104. send "{@Prefix-ATM} &7You have no item of value &d€100 &7in your &dinventory&7."
  105. if index of event-slot is 22:
  106. if click type is right mouse button:
  107. if balance of player >= 50:
  108. remove 50 from player's balance
  109. send "{@Prefix-ATM} &7You have successfully withdrawn &d€50 &7from your &dbank &7account."
  110. give player 1 of emerald named "€50" with lore "&f" and "&fofficial Ayra Banknote"
  111. else:
  112. close player's inventory
  113. send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
  114. else if click type is left mouse button:
  115. if player has emerald:
  116. remove 1 emerald from player's inventory
  117. add 50 to player's balance
  118. send "{@Prefix-ATM} &7You have successfully refunded &d€50 &7to your &dbank &7account."
  119. else:
  120. close player's inventory
  121. send "{@Prefix-ATM} &7You have no item of value &d€50 &7in your &dinventory&7."
  122. if index of event-slot is 23:
  123. if click type is right mouse button:
  124. if balance of player >= 20:
  125. remove 20 from player's balance
  126. send "{@Prefix-ATM} &7You have successfully withdrawn &d€20 &7from your &dbank &7account."
  127. give player 1 of coal named "€20" with lore "&f" and "&fofficial Ayra Banknote"
  128. else:
  129. close player's inventory
  130. send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
  131. else if click type is left mouse button:
  132. if player has coal:
  133. remove 1 coal from player's inventory
  134. add 20 to player's balance
  135. send "{@Prefix-ATM} &7You have successfully refunded &d€20 &7to your &dbank &7account."
  136. else:
  137. close player's inventory
  138. send "{@Prefix-ATM} &7You have no item of value &d€20 &7in your &dinventory&7."
  139. if index of event-slot is 24:
  140. if click type is right mouse button:
  141. if balance of player >= 5:
  142. remove 5 from player's balance
  143. send "{@Prefix-ATM} &7You have successfully withdrawn &d€5 &7from your &dbank &7account."
  144. give player 1 of iron ingot named "€5" with lore "&f" and "&fofficial Ayra Banknote"
  145. else:
  146. close player's inventory
  147. send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
  148. else if click type is left mouse button:
  149. if player has iron ingot:
  150. remove 1 iron ingot from player's inventory
  151. add 5 to player's balance
  152. send "{@Prefix-ATM} &7You have successfully refunded &d€5 &7to your &dbank &7account."
  153. else:
  154. close player's inventory
  155. send "{@Prefix-ATM} &7You have no item of value &d€5 &7in your &dinventory&7."
  156. if index of event-slot is 31:
  157.  
  158. if click type is right mouse button:
  159. if balance of player >= 1:
  160. remove 1 from player's balance
  161. send "{@Prefix-ATM} &7You have successfully withdrawn &d€1 &7from your &dbank &7account."
  162. give player 1 of gold ingot named "€1" with lore "&f" and "&fofficial Ayra Banknote"
  163. else:
  164. close player's inventory
  165. send "{@Prefix-ATM} &7You don't have enough &dMoney &7to withdraw."
  166. else if click type is left mouse button:
  167. if player has gold ingot:
  168. remove 1 gold ingot from player's inventory
  169. add 1 to player's balance
  170. send "{@Prefix-ATM} &7You have successfully refunded &d€1 &7to your &dbank &7account."
  171. else:
  172. close player's inventory
  173. send "{@Prefix-ATM} &7You have no item of value &d€1 &7in your &dinventory&7."
Advertisement
Add Comment
Please, Sign In to add comment