Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.01 KB | None | 0 0
  1. options:
  2. prefix: &8[&a&lUniverse&2&lHub&8]
  3.  
  4. on load:
  5. set {kits::*} to "spiller", "yt1", "quito1", "king1" and "titan1"
  6.  
  7. function toSmall(text: text) :: text:
  8. set {_big::*} to "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y" and "Z"
  9. set {_small::*} to "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y" and "z"
  10. loop {_big::*}:
  11. replace all "%loop-value%" with "%{_small::%loop-index%}%" in {_text}
  12. if {_text} is "youtube1":
  13. set {_text} to "yt1"
  14. return {_text}
  15.  
  16. function startBig(text: text) :: text:
  17. set {_text::*} to {_text} split at ""
  18.  
  19. set {_big::*} to "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y" and "Z"
  20. set {_small::*} to "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y" and "z"
  21. loop {_small::*}:
  22. replace all "%loop-value%" with "%{_big::%loop-index%}%" in {_text::1}
  23. set {_text} to ""
  24. loop {_text::*}:
  25. set {_text} to "%{_text}%%loop-value%"
  26. return {_text}
  27.  
  28. function kitExists(kit: text) :: boolean:
  29. loop {kits::*}:
  30. if loop-value is {_kit}:
  31. return true
  32. return false
  33.  
  34. command /savekit [<text>]:
  35. permission: *
  36. trigger:
  37. if arg 1 is set:
  38. set {_kit} to toSmall(arg 1)
  39. if kitExists({_kit}) is true:
  40. clear {kits.%{_kit}%::*}
  41. loop items in player's inventory:
  42. add loop-value to {kits.%{_kit}%::*}
  43.  
  44. send "{@prefix} &7Du har gemt kittet&8: &a%startBig(arg 1)%"
  45. else:
  46. send "{@prefix} &7Kittet&8: &a%startBig(arg 1)%&7 eksistere ikke.."
  47. else:
  48. send "{@prefix} &7Venligst definér et kit.."
  49.  
  50. on join:
  51. loop {kits::*}:
  52. if {kits.%uuid of player%.%loop-value%::*} isn't set:
  53. #set {kits.%uuid of player%.%loop-value%::*} to "%{kits.%loop-value%::*}%" parsed as items
  54. loop {kits.%loop-value%::*}:
  55. add loop-value to {kits.%uuid of player%.%loop-value%::*}
  56. set {_perm} to loop-value
  57. replace all "1" with "" in {_perm}
  58. if player has permission "%{_perm}%":
  59. set {kits.%uuid of player%.defaultKit} to loop-value
  60.  
  61. if size of {kits.%uuid of player%.settings::*} is 0:
  62. set {kits.%uuid of player%.settings::autoSpawn} to true
  63. set {kits.%uuid of player%.settings::autoArmor} to true
  64.  
  65. function getStatus(uuid: object, setting: text) :: text:
  66. set {_status} to "&c&lFRA"
  67. if {kits.%{_uuid}%.settings::%{_setting}%} is true:
  68. set {_status} to "&2&lTIL"
  69. return {_status}
  70.  
  71. function kitConfig(uuid: object):
  72. set {_p} to player from {_uuid}
  73. if {kits.%{_uuid}%.defaultKit} is set:
  74. wait 3 ticks
  75. open chest with 3 row named "&8Konfigurer dit kit" to {_p}
  76. while uncolored inventory name of {_p}'s current inventory is "Konfigurer dit kit":
  77. wait 3 ticks
  78. if uncolored inventory name of {_p}'s current inventory is "Konfigurer dit kit":
  79. set slot 4 of {_p}'s current inventory to sign item named "&2&lKONFIGURER DIT KIT" with lore "&7&l&oVelkommen||&7&oHerinde kan du||&7&okonfigurére dit||&7&okit.||||&7&oHold musen over||&7&ode forskellige items||&7&ofor at se deres||&7&ofunktioner!" with no nbt
  80.  
  81. set slot 10 of {_p}'s current inventory to name tag named "&2&lKIT RÆKKEFØLGE" with lore "&7&oHvilken rækkefølge||&7&oskal dit kit spawne||&7&omed?||||&7Klik på 2 items||&7for at bytte||&7rundt på dem||||&a&lKlik&7 for at ændre" with no nbt
  82. set slot 12 of {_p}'s current inventory to diamond chestplate named "&2&lAUTO ARMOR" with lore "&7Status&8: %getStatus({_uuid}, ""autoArmor"")%||||&7&oSkal du automatisk||&7&ospawne med dit armor?||||&a&lKlik&7 for at ændre" with no nbt
  83.  
  84. set slot 14 of {_p}'s current inventory to clock named "&2&lAUTO SPAWN" with lore "&7Status&8: %getStatus({_uuid}, ""autoSpawn"")%||||&7&oSkal du automatisk||&7&ospawne med dit kit?||||&a&lKlik&7 for at ændre" with no nbt
  85. set slot 16 of {_p}'s current inventory to anvil named "&2&lOPGRADER KIT" with lore "&7&oTrænger dit kit til en||&7&oopgradering? Gør det her!||||&a&lKlik&7 for at gå til menuen||&8(&c&lKUN SPILLER KITTET&8)" with no nbt
  86.  
  87. set {_rows} to 3
  88. set {_1st} to green glass
  89. set {_2nd} to gray glass
  90. set {_block} to {_1st}
  91. loop numbers between 0 and 8:
  92. set {_slot} to loop-value
  93. if slot {_slot} of {_p}'s current inventory is air:
  94. set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
  95. if {_block} is {_1st}:
  96. set {_block} to {_2nd}
  97. else:
  98. set {_block} to {_1st}
  99.  
  100. set {_block} to {_1st}
  101. loop numbers between ({_rows} * 9 - 9) and ({_rows} * 9 - 1):
  102. set {_slot} to loop-value
  103. if slot {_slot} of {_p}'s current inventory is air:
  104. set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
  105. if {_block} is {_1st}:
  106. set {_block} to {_2nd}
  107. else:
  108. set {_block} to {_1st}
  109. else:
  110. send "{@prefix} &7Der opstod en fejl!" to {_p}
  111.  
  112. function upgradeKit(uuid: object):
  113. set {_p} to player from {_uuid}
  114. if {kits.%{_uuid}%.defaultKit} is set:
  115. if {kits.%{_uuid}%.defaultKit} is "spiller":
  116. wait 3 ticks
  117. open chest with 6 rows named "&8Opgrader kit" to {_p}
  118. wait 3 ticks
  119. if uncolored inventory name of {_p}'s current inventory is "Opgrader kit":
  120. set slot 4 of {_p}'s current inventory to sign item named "&2&lOPGRADER DIT KIT" with lore "&7&oHer kan du opgradere||&7&oog enchante dit kit!||||&7Venstreklik&8: &aEnchant||&7Højreklik&8: &aOpgrader &8(&fIron &8- &bDiamond&8)" with no nbt
  121. set slot 49 of {_p}'s current inventory to red dye named "&c&lTILBAGE" with no nbt
  122.  
  123. set {_kit::*} to {kits.%{_uuid}%.%{kits.%{_uuid}%.defaultKit}%::*}
  124.  
  125. loop {_kit::*}:
  126. set {_item} to loop-value
  127. if {_item} is helmet:
  128. if {_helmet} isn't set:
  129. set {_helmet} to true
  130. set slot 13 of {_p}'s current inventory to {_item}
  131. clear {_lore::*}
  132. if {_item} is iron helmet:
  133. add "&bDiamond&8: &a$&7350" to {_lore::*}
  134.  
  135. if size of {_lore::*} is higher than 0:
  136. set {_lore} to ""
  137. loop {_lore::*}:
  138. if (loop-index-2 parsed as a number) is higher than or equal to 2:
  139. set {_lore} to "%{_lore}%||"
  140. set {_lore} to "%{_lore}%%loop-value-2%"
  141.  
  142. set slot 13 of {_p}'s current inventory's lore to {_lore}
  143.  
  144. if {_item} is chestplate:
  145. if {_chestplate} isn't set:
  146. set {_chestplate} to true
  147. set slot 22 of {_p}'s current inventory to {_item}
  148. clear {_lore::*}
  149. if {_item} is iron chestplate:
  150. add "&bDiamond&8: &a$&7750" to {_lore::*}
  151.  
  152. if size of {_lore::*} is higher than 0:
  153. set {_lore} to ""
  154. loop {_lore::*}:
  155. if (loop-index-2 parsed as a number) is higher than or equal to 2:
  156. set {_lore} to "%{_lore}%||"
  157. set {_lore} to "%{_lore}%%loop-value-2%"
  158.  
  159. set slot 22 of {_p}'s current inventory's lore to {_lore}
  160.  
  161. if {_item} is leggings:
  162. if {_leggings} isn't set:
  163. set {_leggings} to true
  164. set slot 31 of {_p}'s current inventory to {_item}
  165.  
  166. clear {_lore::*}
  167. if {_item} is iron leggings:
  168. add "&bDiamond&8: &a$&7450" to {_lore::*}
  169.  
  170. if size of {_lore::*} is higher than 0:
  171. set {_lore} to ""
  172. loop {_lore::*}:
  173. if (loop-index-2 parsed as a number) is higher than or equal to 2:
  174. set {_lore} to "%{_lore}%||"
  175. set {_lore} to "%{_lore}%%loop-value-2%"
  176.  
  177. set slot 31 of {_p}'s current inventory's lore to {_lore}
  178.  
  179. if {_item} is boots:
  180. if {_boots} isn't set:
  181. set {_boots} to true
  182. set slot 40 of {_p}'s current inventory to {_item}
  183.  
  184. clear {_lore::*}
  185. if {_item} is iron boots:
  186. add "&bDiamond&8: &a$&7350" to {_lore::*}
  187.  
  188. if size of {_lore::*} is higher than 0:
  189. set {_lore} to ""
  190. loop {_lore::*}:
  191. if (loop-index-2 parsed as a number) is higher than or equal to 2:
  192. set {_lore} to "%{_lore}%||"
  193. set {_lore} to "%{_lore}%%loop-value-2%"
  194.  
  195. set slot 40 of {_p}'s current inventory's lore to {_lore}
  196.  
  197. if {_item} is sword:
  198. if {_sword} isn't set:
  199. set {_sword} to true
  200. set slot 21 of {_p}'s current inventory to {_item}
  201.  
  202. clear {_lore::*}
  203. if {_item} is iron sword:
  204. add "&bDiamond&8: &a$&7500" to {_lore::*}
  205.  
  206. if size of {_lore::*} is higher than 0:
  207. set {_lore} to ""
  208. loop {_lore::*}:
  209. if (loop-index-2 parsed as a number) is higher than or equal to 2:
  210. set {_lore} to "%{_lore}%||"
  211. set {_lore} to "%{_lore}%%loop-value-2%"
  212.  
  213. set slot 21 of {_p}'s current inventory's lore to {_lore}
  214.  
  215. if {_item} is bow:
  216. if {_bow} isn't set:
  217. set {_bow} to true
  218. set slot 23 of {_p}'s current inventory to {_item}
  219.  
  220. set {_rows} to 6
  221. set {_1st} to green glass
  222. set {_2nd} to gray glass
  223. set {_block} to {_1st}
  224. loop numbers between 0 and 8:
  225. set {_slot} to loop-value
  226. if slot {_slot} of {_p}'s current inventory is air:
  227. set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
  228. if {_block} is {_1st}:
  229. set {_block} to {_2nd}
  230. else:
  231. set {_block} to {_1st}
  232.  
  233. set {_block} to {_1st}
  234. loop numbers between ({_rows} * 9 - 9) and ({_rows} * 9 - 1):
  235. set {_slot} to loop-value
  236. if slot {_slot} of {_p}'s current inventory is air:
  237. set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
  238. if {_block} is {_1st}:
  239. set {_block} to {_2nd}
  240. else:
  241. set {_block} to {_1st}
  242.  
  243. else:
  244. send "{@prefix} &7Dit kit kan ikke opgraderes!" to {_p}
  245. else:
  246. send "{@prefix} &7Der opstod en fejl!" to {_p}
  247.  
  248. function enchant(uuid: object, piece: text):
  249. set {_piece} to {_piece} parsed as item
  250. set {_p} to player from {_uuid}
  251. if {kits.%{_uuid}%.defaultKit} is set:
  252. if {kits.%{_uuid}%.defaultKit} is "spiller":
  253. wait 3 ticks
  254. open chest with 5 rows named "&8Enchant dit kit" to {_p}
  255. wait 3 ticks
  256. if uncolored inventory name of {_p}'s current inventory is "Enchant dit kit":
  257. set slot 4 of {_p}'s current inventory to {_piece}
  258. set slot 40 of {_p}'s current inventory to red dye named "&c&lTILBAGE" with no nbt
  259.  
  260. if {_piece} isn't enchanted with unbreaking 1:
  261. set slot 20 of {_p}'s current inventory to glowing book named "&2&lUNBREAKING I" with lore "&2Pris&8: &a$&7300||||&a&lKlik&7 for at enchante" with no nbt
  262. else:
  263. set slot 20 of {_p}'s current inventory to book named "&2&lUNBREAKING I &8(&7&lFÆRDIG&8)" with lore "&7Dette piece er||&7er i maximum||&7af dette enchant!" with no nbt
  264.  
  265. if {_piece} is helmet, chestplate, leggings or boots:
  266. if {_piece} isn't enchanted with protection 3:
  267. set {_enchants::*} to protection 1, protection 2 and protection 3
  268. set {_prices::*} to 1500, 2000 and 3500
  269. set {_level} to ""
  270. loop {_enchants::*}:
  271. set {_level} to "%{_level}%I"
  272. set {_enchant} to loop-value
  273. if {_piece} is enchanted with {_enchant}:
  274. set {_continue} to true
  275. else if {_level} is "I":
  276. if {_piece} is enchanted with {_enchants::2}:
  277. set {_continue} to true
  278.  
  279. if {_continue} isn't set:
  280. set slot 24 of {_p}'s current inventory to glowing book named "&2&lPROTECTION %{_level}%" with lore "&2Pris&8: &a$&7%{_prices::%loop-index%}%||||&a&lKlik&7 for at enchante" with no nbt
  281. stop loop
  282. else:
  283. delete {_continue}
  284. else:
  285. set slot 24 of {_p}'s current inventory to book named "&2&lPROTECTION III &8(&7&lFÆRDIG&8)" with lore "&7Dette piece har||&7allerede dette||&7enchant!" with no nbt
  286.  
  287. if {_piece} is sword:
  288. set {_price} to 1500
  289. if {_piece} isn't enchanted with fire aspect 1:
  290. set slot 22 of {_p}'s current inventory to glowing book named "&2&lFIRE ASPECT I" with lore "&2Pris&8: &a$&7%{_price}%||||&a&lKlik&7 for at enchante" with no nbt
  291. else:
  292. set slot 22 of {_p}'s current inventory to book named "&2&lFIRE ASPECT I &8(&7&lFÆRDIG&8)" with lore "&7Dette piece har||&7allerede dette||&7enchant!" with no nbt
  293.  
  294. if {_piece} isn't enchanted with sharpness 3:
  295. set {_enchants::*} to sharpness 1, sharpness 2 and sharpness 3
  296. set {_prices::*} to 250, 500 and 1000
  297. set {_level} to ""
  298. loop {_enchants::*}:
  299. set {_level} to "%{_level}%I"
  300. set {_enchant} to loop-value
  301. if {_piece} is enchanted with {_enchant}:
  302. set {_continue} to true
  303. else if {_level} is "I":
  304. if {_piece} is enchanted with {_enchants::2}:
  305. set {_continue} to true
  306.  
  307. if {_continue} isn't set:
  308. set slot 24 of {_p}'s current inventory to glowing book named "&2&lSHARPNESS %{_level}%" with lore "&2Pris&8: &a$&7%{_prices::%loop-index%}%||||&a&lKlik&7 for at enchante" with no nbt
  309. stop loop
  310. else:
  311. delete {_continue}
  312. else:
  313. set slot 24 of {_p}'s current inventory to book named "&2&lSHARPNESS III &8(&7&lFÆRDIG&8)" with lore "&7Dette piece har||&7allerede dette||&7enchant!" with no nbt
  314.  
  315. if {_piece} is bow:
  316. set {_price} to 1500
  317. if {_piece} isn't enchanted with flame 1:
  318. set slot 22 of {_p}'s current inventory to glowing book named "&2&lFLAME I" with lore "&2Pris&8: &a$&7%{_price}%||||&a&lKlik&7 for at enchante" with no nbt
  319. else:
  320. set slot 22 of {_p}'s current inventory to book named "&2&lFLAME I &8(&7&lFÆRDIG&8)" with lore "&7Dette piece har||&7allerede dette||&7enchant!" with no nbt
  321.  
  322. if {_piece} isn't enchanted with power 3:
  323. set {_enchants::*} to power 1, power 2 and power 3
  324. set {_prices::*} to 250, 500 and 1000
  325. set {_level} to ""
  326. loop {_enchants::*}:
  327. set {_level} to "%{_level}%I"
  328. set {_enchant} to loop-value
  329. if {_piece} is enchanted with {_enchant}:
  330. set {_continue} to true
  331. else if {_level} is "I":
  332. if {_piece} is enchanted with {_enchants::2}:
  333. set {_continue} to true
  334.  
  335. if {_continue} isn't set:
  336. set slot 24 of {_p}'s current inventory to glowing book named "&2&lPOWER %{_level}%" with lore "&2Pris&8: &a$&7%{_prices::%loop-index%}%||||&a&lKlik&7 for at enchante" with no nbt
  337. stop loop
  338. else:
  339. delete {_continue}
  340. else:
  341. set slot 24 of {_p}'s current inventory to book named "&2&lPOWER III &8(&7&lFÆRDIG&8)" with lore "&7Dette piece har||&7allerede dette||&7enchant!" with no nbt
  342.  
  343. set {_rows} to 5
  344. set {_1st} to green glass
  345. set {_2nd} to gray glass
  346. set {_block} to {_1st}
  347. loop numbers between 0 and 8:
  348. set {_slot} to loop-value
  349. if slot {_slot} of {_p}'s current inventory is air:
  350. set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
  351. if {_block} is {_1st}:
  352. set {_block} to {_2nd}
  353. else:
  354. set {_block} to {_1st}
  355.  
  356. set {_block} to {_1st}
  357. loop numbers between ({_rows} * 9 - 9) and ({_rows} * 9 - 1):
  358. set {_slot} to loop-value
  359. if slot {_slot} of {_p}'s current inventory is air:
  360. set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
  361. if {_block} is {_1st}:
  362. set {_block} to {_2nd}
  363. else:
  364. set {_block} to {_1st}
  365.  
  366. else:
  367. send "{@prefix} &7Dit kit kan ikke opgraderes!" to {_p}
  368. else:
  369. send "{@prefix} &7Der opstod en fejl!" to {_p}
  370.  
  371. function kitOrder(uuid: object):
  372. set {_p} to player from {_uuid}
  373. if {kits.%{_uuid}%.defaultKit} is set:
  374. set {_kit::*} to {kits.%{_uuid}%.%{kits.%{_uuid}%.defaultKit}%::*}
  375.  
  376. wait 3 ticks
  377. open chest with 1 row named "&8Kit rækkefølge" to {_p}
  378. wait 3 ticks
  379. if uncolored inventory name of {_p}'s current inventory is "Kit rækkefølge":
  380. set {_slot} to 0
  381. loop {_kit::*}:
  382. set {_item} to loop-value
  383. if {_item} is helmet, chestplate, leggings or boots:
  384. if {_armor} isn't set:
  385. set {_armor} to true
  386. set slot {_slot} of {_p}'s current inventory to diamond chestplate named "&a&lARMOR"
  387. add 1 to {_slot}
  388. add {_item} to {kits.%{_uuid}%.kitOrder.armor::*}
  389. else:
  390. set slot {_slot} of {_p}'s current inventory to {_item}
  391. add 1 to {_slot}
  392. else:
  393. send "{@prefix} &7Der opstod en fejl!" to {_p}
  394.  
  395. function donatorKit(uuid: object, kit: text):
  396. set {_p} to player from {_uuid}
  397.  
  398. if {_p} has permission "%{_kit}%":
  399. wait 3 ticks
  400. open chest with 3 rows named "&8Kit %startBig({_kit})%" to {_p}
  401. wait 3 ticks
  402. if uncolored inventory name of {_p}'s current inventory is "Kit %startBig({_kit})%":
  403. set slot 22 of {_p}'s current inventory to red dye named "&c&lTILBAGE" with no nbt
  404.  
  405. if {_kit} is "quito":
  406. set slot 12 of {_p}'s current inventory to 95:14 named "&c&lQUITO" with no nbt
  407.  
  408. set slot 14 of {_p}'s current inventory to 95:14 named "&c&lQUITO I" with no nbt
  409.  
  410. if {_kit} is "titan":
  411. set slot 12 of {_p}'s current inventory to 95:1 named "&6&lTITAN" with no nbt
  412.  
  413. set slot 14 of {_p}'s current inventory to 95:1 named "&6&lTITAN I" with no nbt
  414.  
  415. if {_kit} is "king":
  416. set slot 12 of {_p}'s current inventory to 95:10 named "&5&lKING" with no nbt
  417.  
  418. set slot 14 of {_p}'s current inventory to 95:10 named "&5&lKING I" with no nbt
  419.  
  420. if {_kit} is "youtube":
  421. set slot 12 of {_p}'s current inventory to 95:10 named "&4&lYOU&f&lTUBE" with no nbt
  422.  
  423. set slot 14 of {_p}'s current inventory to 95:10 named "&4&lYOU&f&lTUBE &4&lI" with no nbt
  424.  
  425. set {_rows} to 3
  426. set {_1st} to green glass
  427. set {_2nd} to gray glass
  428. set {_block} to {_1st}
  429. loop numbers between 0 and 8:
  430. set {_slot} to loop-value
  431. if slot {_slot} of {_p}'s current inventory is air:
  432. set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
  433. if {_block} is {_1st}:
  434. set {_block} to {_2nd}
  435. else:
  436. set {_block} to {_1st}
  437.  
  438. set {_block} to {_1st}
  439. loop numbers between ({_rows} * 9 - 9) and ({_rows} * 9 - 1):
  440. set {_slot} to loop-value
  441. if slot {_slot} of {_p}'s current inventory is air:
  442. set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
  443. if {_block} is {_1st}:
  444. set {_block} to {_2nd}
  445. else:
  446. set {_block} to {_1st}
  447.  
  448. on inventory click:
  449. if uncolored inventory name of player's current inventory is "Konfigurer dit kit":
  450. cancel event
  451. if click item is green glass, gray glass, air or sign:
  452. stop
  453.  
  454. set {_name} to uncolored clicked item's name
  455. if {_name} is "AUTO ARMOR":
  456. if {kits.%uuid of player%.settings::autoArmor} is true:
  457. set {kits.%uuid of player%.settings::autoArmor} to false
  458. else:
  459. set {kits.%uuid of player%.settings::autoArmor} to true
  460. stop
  461.  
  462. if {_name} is "AUTO SPAWN":
  463. if {kits.%uuid of player%.settings::autoSpawn} is true:
  464. set {kits.%uuid of player%.settings::autoSpawn} to false
  465. else:
  466. set {kits.%uuid of player%.settings::autoSpawn} to true
  467. stop
  468.  
  469. if {_name} is "KIT RÆKKEFØLGE":
  470. kitOrder(uuid of player)
  471.  
  472. if {_name} is "OPGRADER KIT":
  473. upgradeKit(uuid of player)
  474.  
  475. close player's inventory
  476.  
  477. if uncolored inventory name of player's current inventory is "Kit rækkefølge":
  478. cancel event
  479.  
  480. if {kits.%uuid of player%.kitOrder} is set:
  481. set {_item1} to slot {kits.%uuid of player%.kitOrder} of player's current inventory
  482. set {_item2} to clicked item
  483.  
  484. set slot {kits.%uuid of player%.kitOrder} of player's current inventory to {_item2}
  485. set slot (clicked slot) of player's current inventory to {_item1}
  486.  
  487. delete {kits.%uuid of player%.kitOrder}
  488. stop
  489.  
  490. set {kits.%uuid of player%.kitOrder} to clicked slot
  491.  
  492. if uncolored inventory name of player's current inventory is "Opgrader kit":
  493. cancel event
  494. if click item is green glass, gray glass, air or sign:
  495. stop
  496.  
  497. set {_name} to uncolored clicked item's name
  498. if {_name} is "TILBAGE":
  499. close player's inventory
  500. kitConfig(uuid of player)
  501. stop
  502.  
  503. set {_kit::*} to {kits.%uuid of player%.%{kits.%uuid of player%.defaultKit}%::*}
  504. if click type is left mouse button:
  505. if clicked item is iron sword, iron helmet, iron chestplate, iron leggings or iron boots:
  506. loop {_kit::*}:
  507. if "%loop-value%" is "%clicked item%":
  508. if loop-value is sword:
  509. set {_price} to 500
  510. set {_item} to diamond sword
  511. else if loop-value is helmet:
  512. set {_price} to 350
  513. set {_item} to diamond helmet
  514. else if loop-value is chestplate:
  515. set {_price} to 750
  516. set {_item} to diamond chestplate
  517. else if loop-value is leggings:
  518. set {_price} to 450
  519. set {_item} to diamond leggings
  520. else if loop-value is boots:
  521. set {_price} to 350
  522. set {_item} to diamond boots
  523.  
  524. if player's balance is greater than or equal to {_price}:
  525. set {_name} to name of loop-value
  526. set {_lore} to loop-value's lore
  527. set {_enchants::*} to enchants of loop-value
  528. set {_durability} to loop-value's durability
  529.  
  530. if {_name} is set:
  531. set name of {_item} to {_name}
  532. if {_lore} is set:
  533. set {_item}'s lore to {_lore}
  534. loop {_enchants::*}:
  535. enchant {_item} with loop-value-2
  536. set durability of {_item} to {_durability}
  537.  
  538. set {kits.%uuid of player%.%{kits.%uuid of player%.defaultKit}%::%loop-index%} to {_item}
  539.  
  540. remove {_price} from player's balance
  541. send "{@prefix} &7Du har opgradet dit armor.."
  542. stop loop
  543. else:
  544. send "{@prefix} &7Du har ikke penge nok.."
  545. else:
  546. stop
  547.  
  548. if click type is right mouse button:
  549. loop {_kit::*}:
  550. if "%loop-value%" is "%clicked item%":
  551. enchant(uuid of player, "%loop-value%")
  552. stop loop
  553.  
  554. close player's inventory
  555.  
  556. if uncolored inventory name of player's current inventory is "Enchant dit kit":
  557. cancel event
  558. set {_piece} to slot 4 of player's current inventory
  559. if click item is green glass, gray glass, air, sign or {_piece}:
  560. stop
  561.  
  562. set {_name} to uncolored clicked item's name
  563. if {_name} is "TILBAGE":
  564. close player's inventory
  565. upgradeKit(uuid of player)
  566. stop
  567.  
  568. else if {_name} contains "(FÆRDIG)":
  569. stop
  570.  
  571. if {_name} contains "UNBREAKING":
  572. set {_enchant} to unbreaking 1
  573. set {_price} to 300
  574.  
  575. else if {_name} contains "PROTECTION":
  576. set {_enchants::*} to protection 1, protection 2 and protection 3
  577. set {_prices::*} to 1500, 2000 and 3500
  578. set {_level} to ""
  579. loop {_enchants::*}:
  580. set {_level} to "%{_level}%I"
  581. set {_enchant} to loop-value
  582. if {_piece} is enchanted with {_enchant}:
  583. set {_continue} to true
  584. else if {_level} is "I":
  585. if {_piece} is enchanted with {_enchants::2}:
  586. set {_continue} to true
  587.  
  588. if {_continue} isn't set:
  589. set {_enchant} to {_enchants::%loop-index%}
  590. set {_price} to {_prices::%loop-index%}
  591. stop loop
  592. else:
  593. delete {_continue}
  594.  
  595. else if {_name} contains "SHARPNESS":
  596. set {_enchants::*} to sharpness 1, sharpness 2 and sharpness 3
  597. set {_prices::*} to 250, 500 and 1000
  598. set {_level} to ""
  599. loop {_enchants::*}:
  600. set {_level} to "%{_level}%I"
  601. set {_enchant} to loop-value
  602. if {_piece} is enchanted with {_enchant}:
  603. set {_continue} to true
  604. else if {_level} is "I":
  605. if {_piece} is enchanted with {_enchants::2}:
  606. set {_continue} to true
  607.  
  608. if {_continue} isn't set:
  609. set {_enchant} to {_enchants::%loop-index%}
  610. set {_price} to {_prices::%loop-index%}
  611. stop loop
  612. else:
  613. delete {_continue}
  614.  
  615. else if {_name} contains "FIRE ASPECT":
  616. set {_enchant} to flame 1
  617. set {_price} to 1500
  618.  
  619. else if {_name} contains "POWER":
  620. set {_enchants::*} to power 1, power 2 and power 3
  621. set {_prices::*} to 250, 500 and 1000
  622. set {_level} to ""
  623. loop {_enchants::*}:
  624. set {_level} to "%{_level}%I"
  625. set {_enchant} to loop-value
  626. if {_piece} is enchanted with {_enchant}:
  627. set {_continue} to true
  628. else if {_level} is "I":
  629. if {_piece} is enchanted with {_enchants::2}:
  630. set {_continue} to true
  631.  
  632. if {_continue} isn't set:
  633. set {_enchant} to {_enchants::%loop-index%}
  634. set {_price} to {_prices::%loop-index%}
  635. stop loop
  636. else:
  637. delete {_continue}
  638.  
  639. else if {_name} contains "FLAME":
  640. set {_enchant} to flame 1
  641. set {_price} to 1500
  642.  
  643. if player's balance is greater than or equal to {_price}:
  644. set {_kit::*} to {kits.%uuid of player%.%{kits.%uuid of player%.defaultKit}%::*}
  645. loop {_kit::*}:
  646. if "%loop-value%" is "%{_piece}%":
  647. enchant {kits.%uuid of player%.%{kits.%uuid of player%.defaultKit}%::%loop-index%} with {_enchant}
  648.  
  649. remove {_price} from player's balance
  650. send "{@prefix} &7Du har enchantet dit armor.."
  651. stop loop
  652. else:
  653. send "{@prefix} &7Du har ikke penge nok.."
  654.  
  655.  
  656. close player's inventory
  657.  
  658. if uncolored inventory name of player's current inventory is "Kits":
  659. cancel event
  660. if click item is green glass, gray glass, air or sign:
  661. stop
  662.  
  663. set {_name} to uncolored clicked item's name
  664. set {_lore} to uncolored clicked item's lore
  665. if {_name} is "spiller":
  666. execute player command "/kit spiller"
  667.  
  668. if {_name} is "QUITO":
  669. if {_lore} contains "JA":
  670. donatorKit(uuid of player, "quito")
  671. else:
  672. stop
  673.  
  674. if {_name} is "TITAN":
  675. if {_lore} contains "JA":
  676. donatorKit(uuid of player, "titan")
  677. else:
  678. stop
  679.  
  680. if {_name} is "KING":
  681. if {_lore} contains "JA":
  682. donatorKit(uuid of player, "king")
  683. else:
  684. stop
  685.  
  686. if {_name} is "YOUTUBE":
  687. if {_lore} contains "JA":
  688. donatorKit(uuid of player, "youtube")
  689. else:
  690. stop
  691.  
  692. close player's inventory
  693.  
  694. if uncolored inventory name of player's current inventory is "Kit Quito" or "Kit Titan" or "Kit King" or "Kit Youtube":
  695. cancel event
  696. if click item is green glass, gray glass, air or sign:
  697. stop
  698.  
  699. set {_name} to uncolored clicked item's name
  700. if {_name} is "TILBAGE":
  701. close player's inventory
  702. execute player command "/kit"
  703. stop
  704.  
  705. if {_name} is "QUITO":
  706. execute player command "/essentials:kits quito"
  707.  
  708. else if {_name} is "QUITO I":
  709. execute player command "/kit quito1"
  710.  
  711. if {_name} is "TITAN":
  712. execute player command "/essentials:kits titan"
  713.  
  714. else if {_name} is "TITAN I":
  715. execute player command "/kit titan1"
  716.  
  717. if {_name} is "KING":
  718. execute player command "/essentials:kits king"
  719.  
  720. else if {_name} is "KING I":
  721. execute player command "/kit king1"
  722.  
  723. if {_name} is "YOUTUBE":
  724. execute player command "/essentials:kits yt"
  725.  
  726. else if {_name} is "YOUTUBE I":
  727. execute player command "/kit yt1"
  728.  
  729. close player's inventory
  730.  
  731. on inventory close:
  732. if uncolored inventory name of player's current inventory is "Kit rækkefølge":
  733. set {_slot} to 0
  734. loop 9 times:
  735. set {_item} to slot {_slot} of player's current inventory
  736. if {_item} isn't air:
  737. if {_item} is diamond chestplate named "&a&lARMOR":
  738. loop {kits.%uuid of player%.kitOrder.armor::*}:
  739. add loop-value-2 to {_kit::*}
  740. set {_armor} to 2
  741. else:
  742. add {_item} to {_kit::*}
  743. add 1 to {_slot}
  744.  
  745. delete {kits.%uuid of player%.kitOrder}
  746. delete {kits.%uuid of player%.kitOrder.armor::*}
  747.  
  748. set {kits.%uuid of player%.%{kits.%uuid of player%.defaultKit}%::*} to {_kit::*}
  749. send "{@prefix} &7Du har gemt din kit rækkefølge!"
  750.  
  751. function giveKit(uuid: object, kit: text):
  752. set {_p} to player from {_uuid}
  753. set {_kit} to toSmall({_kit})
  754.  
  755. set {_kit::*} to {kits.%{_uuid}%.%{_kit}%::*}
  756. if {kits.%{_uuid}%.settings::autoArmor} is true:
  757. if {_p}'s helmet, chestplate, leggings and boots isn't air:
  758. send "{@prefix} &7Venligst ryd dit inventory.." to {_p}
  759. stop
  760.  
  761. loop {_kit::*}:
  762. set {_item} to loop-value
  763. if {_item} is helmet, chestplate, leggings or boots:
  764. if size of {_armor::*} is 0:
  765. set {_kit::%loop-index%} to air
  766. add {_item} to {_armor::*}
  767. set {_kit::%loop-index%} to air
  768.  
  769. set {_slot} to 0
  770. set {_freeSlots} to 0
  771. loop (size of {_kit::*}) times:
  772. if slot {_slot} of {_p}'s inventory is air:
  773. add 1 to {_freeSlots}
  774. else if {_kit::%loop-value%} is air:
  775. add 1 to {_freeSlots}
  776. add 1 to {_slot}
  777. if {_freeSlots} isn't higher than or equal to size of {_kit::*}:
  778. send "{@prefix} &7Venligst ryd dit inventory.." to {_p}
  779. stop
  780.  
  781. loop {_armor::*}:
  782. equip {_p} with loop-value
  783.  
  784. set {_slot} to 0
  785. loop {_kit::*}:
  786. set {_item} to loop-value
  787. if {_item} is air:
  788. if {_slot} isn't higher than or equal to 9:
  789. add 1 to {_slot}
  790. set {_continue} to true
  791. if {_continue} isn't set:
  792. set slot {_slot} of {_p}'s inventory to {_item}
  793. add 1 to {_slot}
  794. else:
  795. delete {_continue}
  796.  
  797. send "{@prefix} &7Du har modtaget kittet&8: &a%startBig({_kit})%" to {_p}
  798.  
  799. command /konfigurerkit:
  800. aliases: /kitkonfigurer, /kitconfig, /configtkit, /lavkit, /kitlav
  801. trigger:
  802. wait 3 ticks
  803. kitConfig(uuid of player)
  804.  
  805. command /kit [<text>]:
  806. aliases: /kits
  807. trigger:
  808. wait 3 ticks
  809. if arg 1 isn't set:
  810. open chest with 6 rows named "&8Kits" to player
  811. wait 3 ticks
  812. if uncolored inventory name of player's current inventory is "Kits":
  813. set slot 4 of player's current inventory to sign item named "&2&lTAG DINE KITS" with lore "&7&oHer ser du de||&7&okits du har adgang til" with no nbt
  814.  
  815. set slot 22 of player's current inventory to 95:8 named "&7&lSPILLER" with no nbt
  816.  
  817. if player has permission "quito":
  818. set {_perm} to "&a&lJA"
  819. else:
  820. set {_perm} to "&c&lNEJ"
  821.  
  822. set slot 28 of player's current inventory to 95:14 named "&c&lQUITO" with lore "&7Adgang&8: &a%{_perm}%" with no nbt
  823.  
  824. if player has permission "titan":
  825. set {_perm} to "&a&lJA"
  826. else:
  827. set {_perm} to "&c&lNEJ"
  828.  
  829. set slot 30 of player's current inventory to 95:1 named "&6&lTITAN" with lore "&7Adgang&8: &a%{_perm}%" with no nbt
  830.  
  831. if player has permission "king":
  832. set {_perm} to "&a&lJA"
  833. else:
  834. set {_perm} to "&c&lNEJ"
  835.  
  836. set slot 32 of player's current inventory to 95:10 named "&5&lKING" with lore "&7Adgang&8: &a%{_perm}%" with no nbt
  837.  
  838. if player has permission "yt":
  839. set {_perm} to "&a&lJA"
  840. else:
  841. set {_perm} to "&c&lNEJ"
  842.  
  843. set slot 34 of player's current inventory to 95 named "&4&lYOU&f&lTUBE" with lore "&7Adgang&8: &a%{_perm}%" with no nbt
  844.  
  845. set {_rows} to 6
  846. set {_1st} to green glass
  847. set {_2nd} to gray glass
  848. set {_block} to {_1st}
  849. loop numbers between 0 and 8:
  850. set {_slot} to loop-value
  851. if slot {_slot} of player's current inventory is air:
  852. set slot {_slot} of player's current inventory to {_block} named " " with no nbt
  853. if {_block} is {_1st}:
  854. set {_block} to {_2nd}
  855. else:
  856. set {_block} to {_1st}
  857.  
  858. set {_block} to {_1st}
  859. loop numbers between ({_rows} * 9 - 9) and ({_rows} * 9 - 1):
  860. set {_slot} to loop-value
  861. if slot {_slot} of player's current inventory is air:
  862. set slot {_slot} of player's current inventory to {_block} named " " with no nbt
  863. if {_block} is {_1st}:
  864. set {_block} to {_2nd}
  865. else:
  866. set {_block} to {_1st}
  867.  
  868. else:
  869. if kitExists(arg 1) is true:
  870. set {_perm} to toSmall(arg 1)
  871. replace all "1" with "" in {_perm}
  872. if player has permission "%{_perm}%":
  873. giveKit(uuid of player, arg 1)
  874. else:
  875. send "{@prefix} &7Du har ikke tilladelse til at tage dette kit.."
  876. else:
  877. execute player command "/essentials:kits %arg 1%"
  878.  
  879. on respawn:
  880. if {kits.%uuid of player%.settings::autoSpawn} is true:
  881. execute player command "/kit %{kits.%uuid of player%.defaultKit}%"
  882.  
  883. on click on entity:
  884. if name of entity is "&6&lLAV KIT":
  885. execute player command "/konfigurerkit"
  886.  
  887. if name of entity is "&b&lOPGRADER KIT":
  888. upgradeKit(uuid of player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement