Ilom_uk

Select Armor Skript

Oct 14th, 2017
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.74 KB | None | 0 0
  1. #Select Armor skript by Ilom.
  2.  
  3. options:
  4. P: &7[&8Select Armor&7]&c
  5. shortp: &7[&8UHC&7]&c
  6. # iron.amount: 8
  7. # diamond.amount: 2
  8.  
  9. command /selectarmor [<text>] [<text>] [<integer>]:
  10. aliases: /selectarmour
  11. trigger:
  12. if command sender has permission "uhc.host":
  13. if arg-1 is set:
  14. if arg 1 is "enable":
  15. set {selectarmor} to true
  16. broadcast "{@P} &cSelect Armor &aenabled &cby &9%command sender%"
  17. if arg 1 is "disable":
  18. delete {selectarmor}
  19. broadcast "{@P} &cSelect Armor &4disabled &cby &9%command sender%"
  20. if arg-1 is "reset":
  21. loop all players:
  22. set {selectarmor.diamond.%player%} to 0
  23. set {selectarmor.iron.%player%} to 0
  24. delete {selectarmor}
  25. set {diamond.amount} to 2
  26. set {iron.amount} to 8
  27. broadcast "{@shortp} &7Select Armor &creset & disabled &7by &9%command sender%"
  28. if arg-1 is "me":
  29. send "{@P} &cYou have crafted &4%{selectarmor.iron.%player%}% &cpieces of &8iron armor."
  30. wait for 1 tick
  31. send "{@P} &cYou have crafted &4%{selectarmor.diamond.%player%}% &cpieces of &9diamond armor."
  32. wait for 1 tick
  33. send "{@P} &cYou can craft up to &4%{iron.amount}% &cpieces of &8iron armor&c, and &4%{diamond.amount}% &cpieces of &9diamond armor."
  34. if arg-1 is "iron":
  35. if arg-2 is not set:
  36. send "{@P} &cAmount of iron armor pieces currently craftable is &4%{iron.amount}%."
  37. if arg-2 is "set":
  38. if arg-3 is an integer:
  39. set {iron.amount} to arg-3
  40. broadcast "{@P} &cAmount of iron armor pieces craftable set to &4%{iron.amount}% &cby &9%command sender%."
  41. if arg-2 is "reset":
  42. set {iron.amount} to 8
  43. broadcast "{@P} &cAmount of iron armor pieces craftable reset to &48 &cby &9%command sender%."
  44. if arg-1 is "diamond":
  45. if arg-2 is not set:
  46. send "{@P} &cAmount of diamond armor pieces currently craftable is &4%{amount.diamond}%."
  47. if arg-2 is "set":
  48. if arg-3 is an integer:
  49. set {diamond.amount} to arg-3
  50. broadcast "{@P} &cAmount of diamond armor pieces craftable set to &4%{amount.diamond}% &cby &9%command sender%."
  51. if arg-2 is "reset":
  52. set {diamond.amount} to 8
  53. broadcast "{@P} &cAmount of diamond armor pieces craftable reset to &48 &cby &9%command sender%."
  54. if arg-1 is set:
  55. if arg-2 is "iron":
  56. if arg-3 is an integer:
  57. set {selectarmor.iron.%arg-1%} to arg-3
  58. send "{@P} Amount of iron armor crafted by &4%arg-1% &cset to &4%arg-3%."
  59. if arg-2 is "diamond":
  60. if arg-3 is an integer:
  61. set {selectarmor.diamond.%arg-1%} to arg-3
  62. send "{@P} Amount of diamond armor crafted by &4%arg-1% &cset to &4%arg-3%."
  63. if arg-1 is "clearall":
  64. loop all players:
  65. set {selectarmor.diamond.%loop-player%} to 0
  66. set {selectarmor.iron.%loop-player%} to 0
  67. broadcast "{@P} All armor crafted cleared by &9%command sender%."
  68. if arg-1 is "clear":
  69. if arg-2 is set:
  70. set {selectarmor.diamond.%arg-2%} to 0
  71. set {selectarmor.iron.%arg-2%} to 0
  72. send "{@P} Armor crafted by &9%arg-2% &ccleared." to command sender
  73. if arg-1 is "help":
  74. send "{@P} /selectarmor enable - Enable Select Armor."
  75. wait for 1 tick
  76. send "{@P} /selectarmor disable - Disable Select Armor."
  77. wait for 1 tick
  78. send "{@P} /selectarmor reset - Reset and disable Select Armor."
  79. wait for 1 tick
  80. send "{@P} /selectarmor iron - Set the amount of iron armor craftable."
  81. wait for 1 tick
  82. send "{@P} /selectarmor diamond - Set the amount of diamond armor craftable."
  83. wait for 1 tick
  84. send "{@P} /selectarmor [playername] - Set the amount of armor players have crafted."
  85. wait for 1 tick
  86. send "{@P} /selectarmor me - See how much armor you can craft."
  87. wait for 1 tick
  88. send "{@P} /selectarmor clear - Clear amounts of armor crafted by an individual player."
  89. wait for 1 tick
  90. send "{@P} /selectarmor clearall - Clear all amounts of armor crafted."
  91. wait for 1 tick
  92. send "{@P} /selectarmor help - View Select Armor's commands."
  93. else if arg-1 is not set:
  94. send "{@P} /selectarmor enable - Enable Select Armor"
  95. wait for 1 tick
  96. send "{@P} /selectarmor disable - Disable Select Armor."
  97. wait for 1 tick
  98. send "{@P} /selectarmor reset - Reset and disable Select Armor."
  99. wait for 1 tick
  100. send "{@P} /selectarmor iron - Set the amount of iron armor craftable."
  101. wait for 1 tick
  102. send "{@P} /selectarmor diamond - Set the amount of diamond armor craftable."
  103. wait for 1 tick
  104. send "{@P} /selectarmor [playername] - Set the amount of armor players have crafted."
  105. wait for 1 tick
  106. send "{@P} /selectarmor me - See how much armor you can craft."
  107. wait for 1 tick
  108. send "{@P} /selectarmor clear - Clear amounts of armor crafted by an individual player."
  109. wait for 1 tick
  110. send "{@P} /selectarmor clearall - Clear all amounts of armor crafted."
  111. wait for 1 tick
  112. send "{@P} /selectarmor help - View Select Armor's commands."
  113. else:
  114. send "{@P} &cYou have crafted &4%{selectarmor.iron.%player%}% &cpieces of &8iron armor."
  115. wait for 1 tick
  116. send "{@P} &cYou have crafted &4%{selectarmor.diamond.%player%}% &cpieces of &9diamond armor."
  117. wait for 1 tick
  118. send "{@P} &cYou can craft up to &4%{iron.amount}% &cpieces of &8iron armor&c, and &4%{diamond.amount}% &cpieces of &9diamond armor."
  119.  
  120.  
  121. on craft:
  122. if {selectarmor} is true:
  123. if item is iron chestplate or iron leggings or iron boots or iron helmet:
  124. if {selectarmor.iron.%player%} is set:
  125. if {selectarmor.iron.%player%} is less than {iron.amount}:
  126. add 1 to {selectarmor.iron.%player%}
  127. if {selectarmor.iron.%player%} is {iron.amount}:
  128. send "{@shortp} &cYou can no longer craft iron armor."
  129. else:
  130. cancel the event
  131. send "{@shortp} &cYou have already crafted %{iron.amount}% iron armor pieces."
  132. else:
  133. set {selectarmor.iron.%player%} to 1
  134.  
  135. if item is diamond chestplate or diamond leggings or diamond boots or diamond helmet:
  136. if {selectarmor.diamond.%player%} is set:
  137. if {selectarmor.diamond.%player%} is less than {diamond.amount}:
  138. add 1 to {selectarmor.diamond.%player%}
  139. if {selectarmor.diamond.%player%} is {diamond.amount}:
  140. send "{@shortp} &cYou can no longer craft diamond armor."
  141. else:
  142. cancel the event
  143. send "{@shortp} &cYou have already crafted %{diamond.amount}% diamond armor pieces."
  144. else:
  145. set {selectarmor.diamond.%player%} to 1
  146.  
  147.  
  148. #This part is mainly for PvP arenas, feel free to comment out/remove
  149. on death of player:
  150. if {selectarmor} is true:
  151. set {selectarmor.iron.%victim%} to 0
  152. set {selectarmor.diamond.%victim%} to 0
  153. message "{@shortp} You died, your amount of armor crafted has been reset." to the victim
Advertisement
Add Comment
Please, Sign In to add comment