pewax

MH - Upgrade

Sep 5th, 2017
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.85 KB | None | 0 0
  1. #
  2. # MH - Upgrade
  3. # By Pewax
  4. #
  5.  
  6. variables:
  7. {kit.rank.%player%} = 0
  8. {kills.%player%} = 0
  9. {donator.%player%} = false
  10.  
  11. # Setspawn
  12. command /MHsetspawn:
  13. trigger:
  14. if player is op:
  15. set {MHspawn} to location of player
  16.  
  17. command /MHdonator <text> <player>:
  18. #executable by: console
  19. trigger:
  20. if arg-1 is "give":
  21. set {donator.%arg-2%} to true
  22. else if arg-1 is "take":
  23. set {donator.%arg-2%} to false
  24. else:
  25. stop
  26.  
  27. # On join give starter kit
  28. on join:
  29. apply saturation 20 to the event-player for 9999 seconds
  30. teleport event-player to {MHspawn}
  31. make console execute "/mhkit 0 %event-player%"
  32.  
  33. # On kill rankup kit
  34. on damage:
  35. if victim is a player:
  36. if attacker is a player:
  37. wait 1 tick
  38. if victim is dead:
  39. add 1 to {kills.%attacker%}
  40. heal the attacker
  41.  
  42. if {donator.%attacker%} is true:
  43. add 2 to {kit.rank.%attacker%}
  44. else:
  45. add 1 to {kit.rank.%attacker%}
  46.  
  47. wait 3 ticks
  48. make console execute "/mhkit %{kit.rank.%attacker%}% %attacker%"
  49.  
  50. on respawn:
  51. teleport event-player to {MHspawn}
  52. wait 3 ticks
  53. clear inventory of the event-player
  54. set {kit.rank.%event-player%} to 0
  55. make console execute "/mhkit 0 %event-player%"
  56.  
  57. # Kills command
  58. command /kills <offline player>:
  59. trigger:
  60. if arg-1 is set:
  61. if {kills.%arg-1%} is set:
  62. send "&e%arg-1% &6has got &e%{kills.%arg-1%}% &6kills!" to player
  63. else:
  64. send "&cThat player has never been on the server!" to player
  65. else:
  66. send "&eYou &6have got &e%{kills.%arg-1%}% &6kills!" to player
  67.  
  68. # Kits
  69. command /MHkit <integer> <player>:
  70. executable by: console
  71. trigger:
  72. heal arg-2
  73. if arg-1 is 0:
  74. clear inventory of arg-2
  75. make console execute "/give %arg-2% minecraft:wooden_axe 1 0 {Unbreakable:1}"
  76. else if arg-1 is 1:
  77. remove a wooden axe from arg-2's inventory
  78. make console execute "/give %arg-2% minecraft:wooden_sword 1 0 {Unbreakable:1}"
  79. else if arg-1 is 2:
  80. make console execute "/replaceitem entity %arg-2% slot.armor.chest leather_chestplate 1 0 {Unbreakable:1}"
  81. else if arg-1 is 3:
  82. make console execute "/replaceitem entity %arg-2% slot.armor.feet leather_boots 1 0 {Unbreakable:1}"
  83. else if arg-1 is 4:
  84. make console execute "/replaceitem entity %arg-2% slot.armor.head leather_helmet 1 0 {Unbreakable:1}"
  85. else if arg-1 is 5:
  86. make console execute "/replaceitem entity %arg-2% slot.armor.legs leather_leggings 1 0 {Unbreakable:1}"
  87. else if arg-1 is 6:
  88. remove a wooden sword from arg-2's inventory
  89. make console execute "/give %arg-2% minecraft:wooden_axe 1 0 {Unbreakable:1,ench:[{id:16,lvl:1}]}"
  90. else if arg-1 is 7:
  91. remove a wooden axe from arg-2's inventory
  92. make console execute "/give %arg-2% minecraft:wooden_sword 1 0 {Unbreakable:1,ench:[{id:16,lvl:1}]}"
  93.  
  94. else if arg-1 is 8:
  95. make console execute "/replaceitem entity %arg-2% slot.armor.chest golden_chestplate 1 0 {Unbreakable:1}"
  96. else if arg-1 is 9:
  97. make console execute "/replaceitem entity %arg-2% slot.armor.feet golden_boots 1 0 {Unbreakable:1}"
  98. else if arg-1 is 10:
  99. make console execute "/replaceitem entity %arg-2% slot.armor.head golden_helmet 1 0 {Unbreakable:1}"
  100. else if arg-1 is 11:
  101. make console execute "/replaceitem entity %arg-2% slot.armor.legs golden_leggings 1 0 {Unbreakable:1}"
  102. else if arg-1 is 12:
  103. remove a wooden sword from arg-2's inventory
  104. make console execute "/give %arg-2% minecraft:golden_axe 1 0 {Unbreakable:1}"
  105. else if arg-1 is 13:
  106. remove a golden axe from arg-2's inventory
  107. make console execute "/give %arg-2% minecraft:golden_sword 1 0 {Unbreakable:1}"
  108.  
  109. else if arg-1 is 14:
  110. make console execute "/replaceitem entity %arg-2% slot.armor.chest golden_chestplate 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  111. else if arg-1 is 15:
  112. make console execute "/replaceitem entity %arg-2% slot.armor.feet golden_boots 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  113. else if arg-1 is 16:
  114. make console execute "/replaceitem entity %arg-2% slot.armor.head golden_helmet 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  115. else if arg-1 is 17:
  116. make console execute "/replaceitem entity %arg-2% slot.armor.legs golden_leggings 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  117. else if arg-1 is 18:
  118. remove a golden sword from arg-2's inventory
  119. make console execute "/give %arg-2% minecraft:golden_axe 1 0 {Unbreakable:1,ench:[{id:16,lvl:1}]}"
  120. else if arg-1 is 19:
  121. remove a golden axe from arg-2's inventory
  122. make console execute "/give %arg-2% minecraft:golden_sword 1 0 {Unbreakable:1,ench:[{id:16,lvl:1}]}"
  123.  
  124. else if arg-1 is 20:
  125. remove a golden sword from arg-2's inventory
  126. make console execute "/give %arg-2% minecraft:stone_axe 1 0 {Unbreakable:1}"
  127. else if arg-1 is 21:
  128. remove a stone axe from arg-2's inventory
  129. make console execute "/give %arg-2% minecraft:stone_sword 1 0 {Unbreakable:1}"
  130. else if arg-1 is 22:
  131. make console execute "/replaceitem entity %arg-2% slot.armor.chest chainmail_chestplate 1 0 {Unbreakable:1}"
  132. else if arg-1 is 23:
  133. make console execute "/replaceitem entity %arg-2% slot.armor.feet chainmail_boots 1 0 {Unbreakable:1}"
  134. else if arg-1 is 24:
  135. make console execute "/replaceitem entity %arg-2% slot.armor.head chainmail_helmet 1 0 {Unbreakable:1}"
  136. else if arg-1 is 25:
  137. make console execute "/replaceitem entity %arg-2% slot.armor.legs chainmail_leggings 1 0 {Unbreakable:1}"
  138.  
  139. else if arg-1 is 26:
  140. remove a stone sword from arg-2's inventory
  141. make console execute "/give %arg-2% minecraft:stone_axe 1 0 {Unbreakable:1,ench:[{id:16,lvl:1}]}"
  142. else if arg-1 is 27:
  143. remove a stone axe from arg-2's inventory
  144. make console execute "/give %arg-2% minecraft:stone_sword 1 0 {Unbreakable:1,ench:[{id:16,lvl:1}]}"
  145. else if arg-1 is 28:
  146. make console execute "/replaceitem entity %arg-2% slot.armor.chest chainmail_chestplate 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  147. else if arg-1 is 29:
  148. make console execute "/replaceitem entity %arg-2% slot.armor.feet chainmail_boots 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  149. else if arg-1 is 30:
  150. make console execute "/replaceitem entity %arg-2% slot.armor.head chainmail_helmet 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  151. else if arg-1 is 31:
  152. make console execute "/replaceitem entity %arg-2% slot.armor.legs chainmail_leggings 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  153.  
  154. else if arg-1 is 32:
  155. remove a stone sword from arg-2's inventory
  156. make console execute "/give %arg-2% minecraft:iron_axe 1 0 {Unbreakable:1}"
  157. else if arg-1 is 33:
  158. remove a iron axe from arg-2's inventory
  159. make console execute "/give %arg-2% minecraft:iron_sword 1 0 {Unbreakable:1}"
  160. else if arg-1 is 34:
  161. make console execute "/replaceitem entity %arg-2% slot.armor.chest iron_chestplate 1 0 {Unbreakable:1}"
  162. else if arg-1 is 35:
  163. make console execute "/replaceitem entity %arg-2% slot.armor.feet iron_boots 1 0 {Unbreakable:1}"
  164. else if arg-1 is 36:
  165. make console execute "/replaceitem entity %arg-2% slot.armor.head iron_helmet 1 0 {Unbreakable:1}"
  166. else if arg-1 is 37:
  167. make console execute "/replaceitem entity %arg-2% slot.armor.legs iron_leggings 1 0 {Unbreakable:1}"
  168.  
  169. else if arg-1 is 38:
  170. remove a iron sword from arg-2's inventory
  171. make console execute "/give %arg-2% minecraft:iron_axe 1 0 {Unbreakable:1,ench:[{id:16,lvl:1}]}"
  172. else if arg-1 is 39:
  173. remove a iron axe from arg-2's inventory
  174. make console execute "/give %arg-2% minecraft:iron_sword 1 0 {Unbreakable:1,ench:[{id:16,lvl:1}]}"
  175. else if arg-1 is 40:
  176. make console execute "/replaceitem entity %arg-2% slot.armor.chest iron_chestplate 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  177. else if arg-1 is 41:
  178. make console execute "/replaceitem entity %arg-2% slot.armor.feet iron_boots 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  179. else if arg-1 is 42:
  180. make console execute "/replaceitem entity %arg-2% slot.armor.head iron_helmet 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  181. else if arg-1 is 43:
  182. make console execute "/replaceitem entity %arg-2% slot.armor.legs iron_leggings 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  183.  
  184. else if arg-1 is 44:
  185. remove a iron sword from arg-2's inventory
  186. make console execute "/give %arg-2% minecraft:diamond_axe 1 0 {Unbreakable:1}"
  187. else if arg-1 is 45:
  188. remove a diamond axe from arg-2's inventory
  189. make console execute "/give %arg-2% minecraft:diamond_sword 1 0 {Unbreakable:1}"
  190. else if arg-1 is 46:
  191. make console execute "/replaceitem entity %arg-2% slot.armor.chest diamond_chestplate 1 0 {Unbreakable:1}"
  192. else if arg-1 is 47:
  193. make console execute "/replaceitem entity %arg-2% slot.armor.feet diamond_boots 1 0 {Unbreakable:1}"
  194. else if arg-1 is 48:
  195. make console execute "/replaceitem entity %arg-2% slot.armor.head diamond_helmet 1 0 {Unbreakable:1}"
  196. else if arg-1 is 49:
  197. make console execute "/replaceitem entity %arg-2% slot.armor.legs diamond_leggings 1 0 {Unbreakable:1}"
  198.  
  199. else if arg-1 is 50:
  200. remove a diamond sword from arg-2's inventory
  201. make console execute "/give %arg-2% minecraft:diamond_axe 1 0 {Unbreakable:1,ench:[{id:16,lvl:1}]}"
  202. else if arg-1 is 51:
  203. remove a diamond axe from arg-2's inventory
  204. make console execute "/give %arg-2% minecraft:diamond_sword 1 0 {Unbreakable:1,ench:[{id:16,lvl:1}]}"
  205. else if arg-1 is 52:
  206. make console execute "/replaceitem entity %arg-2% slot.armor.chest diamond_chestplate 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  207. else if arg-1 is 53:
  208. make console execute "/replaceitem entity %arg-2% slot.armor.feet diamond_boots 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  209. else if arg-1 is 54:
  210. make console execute "/replaceitem entity %arg-2% slot.armor.head diamond_helmet 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  211. else if arg-1 is 55:
  212. make console execute "/replaceitem entity %arg-2% slot.armor.legs diamond_leggings 1 0 {Unbreakable:1,ench:[{id:0,lvl:1}]}"
  213. else:
  214. send "&cYou have reached the max rank and can no longer advance!"
Advertisement
Add Comment
Please, Sign In to add comment