Zeldaboy111

Skript #268 ]|[ Cosmetics (2)

Dec 2nd, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.33 KB | None | 0 0
  1. #© This Skript reselling/reuploading and claiming as it is yours is not allowed! ©
  2. #© Using this Skript in a video is no problem, only mention the things below this ©
  3. #
  4. #Skript made by Zeldaboy111
  5. #YouTube creator: https://www.youtube.com/channel/UClmeX0PpxrQd9q-4kRaBefg?view_as=subscriber
  6. #More content of the creator: https://forums.skunity.com/search/26443679/
  7.  
  8.  
  9. options:
  10. logo: &6Server &7▬ &2
  11. lobby: &cLobby &7► &2
  12. lcompass: &9C&3ompass
  13. cGuiName: &9M&3inigames
  14.  
  15. path: Files/Lobby
  16. config: Files/Lobby/config.yml
  17. cosConfig: Files/Lobby/Cosmetics/config.yml
  18. suitPath: Files/Lobby/Cosmetics/Suits
  19. helmetPath: Files/Lobby/Cosmetics/Helmets
  20.  
  21. window1: yml value "Lobby.Crates.Animations.Window1" of file "Files/Lobby/config.yml"
  22. randomAnimation: yml value "Lobby.Crates.Animations.Random.Enabled" of file "Files/Lobby/config.yml"
  23. animation: yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "Files/Lobby/config.yml"
  24.  
  25.  
  26.  
  27. #alt + 15 = ☼
  28. #alt + 26 = →
  29. #alt + 16 = ►
  30. #alt + 22 = ▬
  31.  
  32. #------------------- Functions -------------------
  33. function contains(list: objects, check: object) :: boolean:
  34. loop {_list::*}:
  35. if loop-value is {_check}:
  36. return true
  37. return false
  38.  
  39. function lcompGui(p: Player, gname: String, rows: Integer, slot1: Integer, slot2: Integer, item1: Item, item2: Item, i1name: String, i2name: String, accept: String, deny: String, command: Boolean):
  40. open chest with {_rows} rows named {_gname} to {_p}
  41.  
  42. set name of {_item1} to {_i1name}
  43. set name of {_item2} to {_i2name}
  44.  
  45. format gui slot {_slot1} of {_p} with {_item1} to run:
  46. close {_p}'s inventory
  47. if {_command} is true:
  48. execute player command {_accept}
  49. else:
  50. send {_accept} to {_p}
  51.  
  52. format gui slot {_slot2} of {_p} with {_item2} to run:
  53. close {_p}'s inventory
  54. send {_deny} to {_p}
  55.  
  56.  
  57.  
  58. function openCompass(p: Player):
  59. if {lobby.compassRows} is not set:
  60. set {lobby.compassRows} to 1
  61.  
  62. open chest with {lobby.compassRows} rows named "{@cGuiName}" to {_p}
  63.  
  64. loop {lobby.minigames.list::*}:
  65. if {lobby.minigames.%loop-value%.slot} starts with "-":
  66. stop
  67.  
  68. else:
  69. if ({lobby.minigames.%loop-value%.slot} parsed as a number) is set:
  70. if {lobby.minigames.%loop-value%.item} is "&cNone":
  71. set {_item} to paper
  72.  
  73. else if ({lobby.minigames.%loop-value%.item} parsed as an item) is not set:
  74. set {_item} to paper
  75.  
  76. else:
  77. set {_item} to {lobby.minigames.%loop-value%.item}
  78.  
  79. set {_slot} to ({lobby.minigames.%loop-value%.slot} parsed as a number)
  80.  
  81. if {lobby.minigames.%loop-value%.name} is set:
  82. if {lobby.minigames.%loop-value%.name} is not "&cNone":
  83. set {_name} to {lobby.minigames.%loop-value%.name}
  84. replace "&" in {_name} with "§"
  85. if {lobby.minigames.%loop-value%.lore} is set:
  86. if {lobby.minigames.%loop-value%.lore} is not "&cNone":
  87. set {_lore} to {lobby.minigames.%loop-value%.lore}
  88. replace "&" in {_lore} with "§"
  89. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" with lore "%{_lore}%" to do nothing
  90. else:
  91. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to do nothing
  92. else:
  93. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to do nothing
  94. else:
  95. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to do nothing
  96. else:
  97. format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to do nothing
  98.  
  99. function randomReward(crate: String) :: Item:
  100. set {_rewards1::*} to yml list "Item.List" of file "{@path}/%{_crate}%.yml"
  101. set {_rewardsNames::*} to yml list "Item.ConfigName" of file "{@path}/%{_crate}%.yml"
  102.  
  103. set {_count} to 1
  104. loop {_rewards1::*}:
  105. if yml value "Item.Chance.%{_rewardsNames::%{_count}%}%" of file "{@path}/%{_crate}%.yml" is set:
  106. set {_chance} to yml value "Item.Chance.%{_rewardsNames::%{_count}%}%" of file "{@path}/%{_crate}%.yml" parsed as a string
  107.  
  108. if ({_chance} parsed as a number) is set:
  109. loop ({_chance} parsed as a number) times:
  110. add "%loop-value-1% [{$^^$}] %{_rewardsNames::%{_count}%}%" to {_rewards::*}
  111.  
  112. else:
  113. send "%nl%{@lobby} &c%{_chance}% &4is not a number!%nl%" to console
  114.  
  115. add 1 to {_count}
  116.  
  117. set {_length} to size of {_rewards::*}
  118. set {_prizeCount} to a random integer between 0 and {_length}
  119. set {_splitPrize::*} to {_rewards::%{_prizeCount}%} split at " [{$^^$}] "
  120.  
  121. set {_prize} to {_splitPrize::1}
  122. set {_prizeCName} to {_splitPrize::2}
  123.  
  124. if ({_prize} parsed as an item) is not set:
  125. send "{@lobby} &c%{_prize}% &4is not an item! Stopping opening the crate!" to console
  126.  
  127. else:
  128. set {_prize} to {_prize} parsed as an item
  129.  
  130. if yml value "Item.Name.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml" is set:
  131. set {_prizeName} to yml value "Item.Name.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml"
  132. set {_prizeName} to "%colored {_prizeName}%"
  133. set name of {_prize} to "&f%{_prizeName}%"
  134.  
  135. if yml value "Item.Amount.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml" is set:
  136. set {_prizeAmount} to yml value "Item.Amount.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml"
  137. set {_prizeAmount} to ({_prizeAmount} parsed as a number)
  138. if {_prizeAmount} is set:
  139. set {_prize} to ("%{_prizeAmount}% %{_prize}%" parsed as an item)
  140.  
  141. else:
  142. send "{@lobby} &c%{_prizeAmount}% &4is not a number!" to console
  143. set {_prize} to ("1 %{_prize}%" parsed as an item)
  144.  
  145. if yml value "Item.Lore.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml" is set:
  146. set {_loreList::*} to yml list "Item.Lore.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml"
  147. loop {_loreList::*}:
  148. if {_lore} is not set:
  149. set {_lore} to "%loop-value%"
  150. else:
  151. set {_lore} to "%{_lore}%||%loop-value%"
  152.  
  153. set lore of {_prize} to {_lore}
  154.  
  155.  
  156. if yml value "Item.Enchants.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml" is set:
  157. set {_enchantList::*} to yml list "Item.Enchants.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml"
  158. loop {_enchantList::*}:
  159. set {_ench} to "%loop-value%"
  160. set {_split::*} to {_ench} split at ""
  161.  
  162. if contains({_split::*}, ":") is true:
  163. set {_eSplit::*} to {_ench} split at ":"
  164. set {_ench1} to {_eSplit::1}
  165. set {_ench2} to {_eSplit::2}
  166.  
  167. if ({_ench1} parsed as an enchantment type) is set:
  168. if ({_ench2} parsed as a number) is set:
  169. enchant {_prize} with "%{_ench1}% %{_ench2}%" parsed as an enchantment type
  170. set name of {_prize} to "&b%{_prizeName}%"
  171. else:
  172. send "%nl%{@lobby} &c%{_s2}% &4is not a number!%nl%" to console
  173. else:
  174. send "%nl%{@lobby} &c%{_s1}% &4is not an enchantment type!%nl%" to console
  175.  
  176. else:
  177. if (loop-value parsed as an enchantment type) is set:
  178. enchant {_prize} with "%loop-value% 1" parsed as an enchantment type
  179.  
  180. else:
  181. send "{@lobby} &c%loop-value% &4is not an enchantment type!" to console
  182.  
  183. return {_prize}
  184.  
  185. function animation1(p: Player, count: Integer, count2: Integer) :: boolean:
  186.  
  187. loop 9 times:
  188. if {crates.reopening.%{_p}%} is true:
  189. delete {crates.reopening.%{_p}%}
  190. clear {crate.%{_p}%.inv::*}
  191. clear {crate.%{_p}%.name}
  192.  
  193.  
  194. if {crates.closed.%{_p}%} is true:
  195. if {_count} = {_count2}-18:
  196. set {crate.%{_p}%.inv::%{_count}%} to "light green glass"
  197. set {crate.%{_p}%.inv::%{_count2}%} to "light green glass"
  198. else:
  199. set {crate.%{_p}%.inv::%{_count}%} to "gray glass"
  200. set {crate.%{_p}%.inv::%{_count2}%} to "gray glass"
  201.  
  202. else:
  203. if {_count} = {_count2}-18:
  204. format gui slot {_count} of {_p} with light green stained glass pane to do nothing
  205. format gui slot {_count2} of {_p} with light green stained glass pane to do nothing
  206.  
  207. else:
  208. format gui slot {_count} of {_p} with gray stained glass pane to do nothing
  209. format gui slot {_count2} of {_p} with gray stained glass pane to do nothing
  210.  
  211. add 1 to {_count}
  212. remove 1 from {_count2}
  213. wait 5 ticks
  214.  
  215. set {animation.%{_p}%} to false
  216.  
  217. function runAnimation(p: Player, animation: Integer, count: Integer, count2: Integer, forced: Boolean):
  218. if {_animation} is 1:
  219. if {_forced} is false:
  220. if {@window1} is true:
  221. animation1({_p}, {_count}, {_count2})
  222. set {animation.%{_p}%} to true
  223. else:
  224. animation1({_p}, {_count}, {_count2})
  225. set {animation.%{_p}%} to true
  226.  
  227.  
  228. function openCrate(p: Player, crate: String):
  229. if {keys.%{_p}%.%{_crate}%} > 0:
  230. open chest with 3 rows named "&2%{_crate}%" to {_p}
  231.  
  232.  
  233. set {crates.opening.%{_p}%} to true
  234. #Value to wait for animation
  235. set {animation.%{_p}%} to false
  236. set {_count} to 0
  237. set {_count2} to 26
  238.  
  239.  
  240. #Animations
  241. set {_random} to randomReward({_crate})
  242.  
  243. if {@randomAnimation} is true:
  244. set {_animationNumber} to a random integer between 0 and 1
  245. #set {animation.%{_p}%} to animation1({_p}, {_count}, {_count2})
  246. else:
  247. #set yml value "Lobby.Crates.Animations.Random" of file "Files/Lobby/config.yml" to true
  248. set {_animation} to yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "{@config}"
  249.  
  250. if {_animation} is "Window1":
  251. set {_animationNumber} to 1
  252.  
  253. else:
  254. send "{@lobby} &4The animation &c%{_animation}% &4doesn't exist! Running Window1 as animation!" to console
  255. set {_animationNumber} to 1
  256.  
  257.  
  258. runAnimation({_p}, {_animationNumber}, {_count}, {_count2}, false)
  259.  
  260. if {animation.%{_p}%} is false:
  261. runAnimation({_p}, 1, {_count}, {_count2}, true)
  262.  
  263. while {animation.%{_p}%} is true:
  264. wait 1 tick
  265.  
  266.  
  267.  
  268. delete {animation.%{_p}%}
  269.  
  270. format gui slot 13 of {_p} with {_random} to do nothing
  271. play sound "entity.experience_orb.pickup" with volume 10 and pitch 5 at {_p} for all players
  272.  
  273. delete {crates.closed.%{_p}%}
  274. remove {_p} from {crates.openinglist::*}
  275. delete {crate.%{_p}%.inv::*}
  276. delete {crate.%{_p}%.name}
  277. delete {crates.opening.%{_p}%}
  278. remove 1 from {keys.%{_p}%.%{_crate}%}
  279. set {_name} to name of {_random}
  280.  
  281. launch ball coloured aqua and blue at {_p}'s location timed 0.9
  282. give {_p} {_random}
  283. send "{@lobby} You've won &a%{_name}%&2!" to {_p}
  284.  
  285. else:
  286. send "{@lobby} &4You don't have anough keys to do this!" to {_p}
  287. play sound "entity.item.break" with volume 10 and pitch 1 at {_p} for {_p}
  288.  
  289.  
  290.  
  291. function editCosFormat(p: Player, piece: String, pieceText: String) :: item:
  292.  
  293. set {_item} to ("barrier" parsed as an item)
  294.  
  295. if {cosmetics.edit.%{_p}%.%{_piece}%} is set:
  296. if {cosmetics.edit.%{_p}%.%{_piece}%} parsed as an item is set:
  297. set {_item} to ({cosmetics.edit.%{_p}%.%{_piece}%} parsed as an item)
  298.  
  299. if {cosmetics.edit.%{_p}%.%{_piece}%.name} is set:
  300. set name of {_item} to {cosmetics.edit.%{_p}%.%{_piece}%.name}
  301. else:
  302. set name of {_item} to "&2%{_pieceText}%"
  303.  
  304. if {cosmetics.edit.%{_p}%.%{_piece}%.lore} is set:
  305. set lore of {_item} to {cosmetics.edit.%{_p}%.%{_piece}%.lore}
  306.  
  307. else:
  308. set name of {_item} to "&4%{_pieceText}%"
  309.  
  310. return {_item}
  311.  
  312.  
  313. function editCos(p: Player, type: String):
  314. set {cosmetics.edit.%{_p}%.type} to {_type}
  315.  
  316. open chest with 6 rows named "&8Edit" to {_p}
  317.  
  318. if {cosmetics.edit.%{_p}%.type} is "":
  319. format gui slot 18 of {_p} with a paper named "&7Type: &c<none>" to run:
  320. close {_p}'s inventory
  321. set {cosmetics.edit.%{_p}%} to "setType"
  322. send "{@lobby} Type the new type of your set in the chat" to {_p}
  323.  
  324. else:
  325. format gui slot 18 of {_p} with a paper named "&7Type: %{cosmetics.edit.%{_p}%.type}%" to run:
  326. close {_p}'s inventory
  327. set {cosmetics.edit.%{_p}%} to "setType"
  328. send "{@lobby} Type the new type of your set in the chat" to {_p}
  329.  
  330. set {_helmet} to editCosFormat({_p}, "helmet", "Helmet")
  331. set {_chestplate} to editCosFormat({_p}, "chestplate", "Chestplate")
  332. set {_leggings} to editCosFormat({_p}, "leggings", "Leggings")
  333. set {_boots} to editCosFormat({_p}, "boots", "Boots")
  334.  
  335.  
  336. #format gui slot 10 of {_p} with {_helmet} to close then run function editHelmet({_p}, {cosmetics.edit.%{_p}%.type})
  337. format gui slot 10 of {_p} with {_helmet} to close then run function editPiece({_p}, "helmet", "Helmet", {cosmetics.edit.%{_p}%.type})
  338. format gui slot 19 of {_p} with {_chestplate} to close then run function editPiece({_p}, "chestplate", "Chestplate", {cosmetics.edit.%{_p}%.type})
  339. format gui slot 28 of {_p} with {_leggings} to close then run function editPiece({_p}, "leggings", "Leggings", {cosmetics.edit.%{_p}%.type})
  340. format gui slot 37 of {_p} with {_boots} to close then run function editPiece({_p}, "boots", "Boots", {cosmetics.edit.%{_p}%.type})
  341.  
  342. #format gui slot 10 of {_p} with barrier named "&4Helmet" to close then run function editHelmet({_p}, {cosmetics.edit.%{_p}%.type})
  343. #format gui slot 19 of {_p} with barrier named "&4Chestplate" to do nothing
  344. #format gui slot 28 of {_p} with barrier named "&4Leggings" to do nothing
  345. #format gui slot 37 of {_p} with barrier named "&4Boots" to do nothing
  346.  
  347. #format gui slot 18 of {_p} with paper named "&4Type: &c<none>" to do nothing
  348.  
  349.  
  350. function editPiece(p: Player, piece: String, pieceText: String, type: String):
  351. #Via Config file
  352. wait 3 ticks
  353.  
  354. set {cosmetics.edit.%{_p}%.current} to "%{_piece}%"
  355.  
  356. open chest with 3 rows named "&8Edit %{_pieceText}%" to {_p}
  357. set {_item} to editCosFormat({_p}, "%{_piece}%", "%{_pieceText}%")
  358.  
  359. format gui slot 10 of {_p} with {_item} to do nothing
  360.  
  361. format gui slot 18 of {_p} with arrow named "&c<< Go Back" to close then run function editCos({_p}, {_type})
  362. #if {cosmetics.edit.%player%.type} is "":
  363. # format gui slot 14 of {_P} with paper named "&7"
  364.  
  365. #if {_helmet} is "":
  366. #{cosmetics.edit.%player%.type}
  367. #if {_type} is "":
  368. #set {_type} to {cosmetics.edit.%player%.type}
  369.  
  370. #if {_type} is "":
  371. # format gui slot 10 of {_p} with barrier named "&4Helmet" to run:
  372. # send "{@lobby} Type the type of your helmet in chat" to {_p}
  373. # set {cosmetics.edit.%{_p}%} to "helmetItem"
  374. # close {_p}'s inventory
  375. #
  376. #
  377. # else if yml file "{@helmetPath}" doesn't exist:
  378. # if yml file "{@suitPath}" doesn't exist:
  379. # format gui slot 10 of {_p} with barrier named "&4Helmet" to run:
  380. # send "{@lobby} Type the type of your helmet in chat" to {_p}
  381. # set {cosmetics.edit.%{_p}%} to "helmetItem"
  382. # close {_p}'s inventory
  383.  
  384. #else:
  385. # #Item variable, Name variable, Lore variable, Enchantment list variable
  386. # format gui slot 10 of {_p} with ({cosmetics.edit.%player%.type} parsed as an item type) named "&aHelmet" to run:
  387. # send "{@lobby} Type the type of your helmet in chat" to {_p}
  388. # set {cosmetics.edit.%{_p}%} to "helmetItem"
  389. # close {_p}'s inventory
  390.  
  391.  
  392.  
  393.  
  394.  
  395. #------------------- Periotic Events -------------------
  396.  
  397.  
  398.  
  399.  
  400.  
  401. #------------------- Events -------------------
  402. on enable:
  403. if file "{@config}" doesn't exist:
  404. create file "{@config}"
  405.  
  406. set yml value "Lobby.Crates.Animations.Window1" of file "Files/Lobby/config.yml" to true
  407. set yml value "Lobby.Crates.Animations.Random.Enabled" of file "Files/Lobby/config.yml" to true
  408. set yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "Files/Lobby/config.yml" to "Window1"
  409.  
  410. #if yml file "{@helmetPath}" doesn't exist:
  411. # create folder "{@helmetPath}"
  412.  
  413. #if yml file "{@suitPath}" doesn't exist:
  414. # create folder "{@suitPath}"
  415.  
  416. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  417.  
  418. loop {_list::*}:
  419. set {_world} to world of {lobby.location}
  420. loop {lobbycr.%loop-value%.location::*}:
  421. set {holo-crate-%{_world}%-%loop-value-2%} to a new hologram at block above loop-value-2
  422. add text "&a&l%loop-value-1%" to hologram {holo-crate-%{_world}%-%loop-value-2%}
  423.  
  424. on disable:
  425. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  426. set {_world} to world of {lobby.location}
  427.  
  428. loop {_list::*}:
  429. delete yml list "Locations" of file "{@path}/%loop-value%.yml"
  430. loop {lobbycr.%loop-value%.location::*}:
  431. add "%loop-value-2%" to yml list "Locations" of file "{@path}/%loop-value-1%.yml"
  432. unregister hologram {holo-crate-%{_world}%-%loop-value-2%}
  433.  
  434. loop {crates.openinglist::*}:
  435. clear {crates.opening.%loop-value%}
  436. clear {crates.%loop-value%.inv::*}
  437. clear {crates.%loop-value%.name}
  438. clear {crate.closed.%loop-value%}
  439.  
  440. clear {crates.openinglist::*}
  441.  
  442. on join:
  443. if {lobby.location} is set:
  444. teleport player to {lobby.location}
  445. set join message to ""
  446. wait 10 ticks
  447.  
  448. clear player's inventory
  449. send "{@lobby} &fThe player %player% has joined!" to all players in world of player
  450. set slot 4 of player to a compass named "{@lcompass}"
  451.  
  452. on quit:
  453. if {crates.opening.%player%} is set:
  454. clear {crates.opening.%player%}
  455. clear {crates.%player%.inv::*}
  456. clear {crates.%player%.name}
  457. clear {crates.closed.%player%}
  458. remove player from {crates.openinglist::*}
  459.  
  460. on damage:
  461. if world of victim is world of {lobby.location}:
  462. if damage cause is "void" parsed as a damage cause:
  463. set victim's health to 0
  464.  
  465. else:
  466. cancel event
  467.  
  468. on death:
  469. if world of player is world of {lobby.location}:
  470. set death message to ""
  471.  
  472. on respawn:
  473. if world of player is world of {lobby.location}:
  474. set slot 4 of player to a compass named "{@lcompass}"
  475. teleport player to {lobby.location}
  476.  
  477. on inventory click:
  478. if player is in world of {lobby.location}:
  479. if clicked item is a compass named "{@lcompass}":
  480. cancel event
  481. close player's inventory
  482. openCompass(player)
  483.  
  484.  
  485.  
  486. on click:
  487. if player is in world of {lobby.location}:
  488. if player's held item is a compass named "{@lcompass}":
  489. cancel event
  490. openCompass(player)
  491.  
  492.  
  493. on command:
  494. command is "plugins" or "pl":
  495. cancel event
  496.  
  497. if player is not op:
  498. stop
  499.  
  500. else:
  501. set {_list::*} to list of plugins
  502. set {_count} to 0
  503. loop {_list::*}:
  504. add 1 to {_count}
  505. send "{@logo} Plugin list:%nl%&f(&a%{_count}%&f) &2%list of plugins%"
  506.  
  507. else:
  508. set {cmd} to "%command to lower case%"
  509.  
  510. on place of chest:
  511. set {_world} to world of event-block
  512. if {_world} is world of {lobby.location}:
  513. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  514. if contains({_list::*}, "%uncolored name of player's tool%"):
  515.  
  516. add location of block at event-block to {lobbycr.%uncolored name of player's tool%.location::*}
  517. add world of event-block to {lobbycr.%uncolored name of player's tool%.world::*}
  518.  
  519. set {holo-crate-%world of event-block%-%location of event-block%} to new hologram at location 1 meters above event-block
  520. add text "&a&l%uncolored name of player's tool%" to hologram {holo-crate-%world of event-block%-%location of event-block%}
  521. add "%location of block at event-block%" to yml list "Locations" of file "{@path}/%uncolored name of player's tool%.yml"
  522.  
  523. send "{@lobby} &2Succesfully created a &a%uncolored name of player's tool% &2Crate!"
  524.  
  525.  
  526. on break of chest:
  527. set {_world} to world of event-block
  528. if {_world} is world of {lobby.location}:
  529. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  530. loop {_list::*}:
  531. loop {lobbycr.%loop-value-1%.location::*}:
  532. if loop-value-2 is location of event-block:
  533. remove location of block at event-block from {lobbycr.%loop-value-1%.location::*}
  534. remove world of event-block from {lobbycr.%loop-value-1%.world::*}
  535.  
  536. unregister hologram {holo-crate-%world of event-block%-%location of event-block%}
  537. delete {holo-crate-%world of event-block%-%location of event-block%}
  538. remove "%location of event-block%" from yml list "Locations" of file "{@path}/%loop-value-1%.yml"
  539.  
  540. send "{@lobby} &2Succesfully removed a &a%loop-value-1% &2Crate!"
  541.  
  542.  
  543.  
  544. on rightclick on a chest:
  545. set {_world} to world of clicked block
  546. if {_world} is "%world of {lobby.location}%":
  547.  
  548. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  549. loop {_list::*}:
  550.  
  551. loop {lobbycr.%loop-value-1%.location::*}:
  552. if "%loop-value-2%" is "%location of clicked block%":
  553. cancel event
  554. if "%uncolored {crate.%player%.name}%" = loop-value-1:
  555. if {crates.opening.%player%} is true:
  556. open chest with 3 rows named "&2%{crate.%player%.name}%" to player
  557.  
  558. set {crates.reopening.%player%} to true
  559. set {_count} to 0
  560. loop 27 times:
  561. if {crate.%player%.inv::%{_count}%} is set:
  562. set {_value} to "%{crate.%player%.inv::%{_count}%}%"
  563. set {_color::*} to {_value} split at " "
  564.  
  565. if contains({_color::*}, "glass") is true:
  566. if contains({_color::*}, "light") is true:
  567. format gui slot {_count} of player with ("light %{_color::2}% stained glass pane" parsed as an item) to do nothing
  568.  
  569. else if contains({_color::*}, "dark") is true:
  570. format gui slot {_count} of player with ("dark %{_color::2}% stained glass pane" parsed as an item) to do nothing
  571.  
  572. else:
  573. format gui slot {_count} of player with ("%{_color::1}% stained glass pane" parsed as an item) to do nothing
  574.  
  575. else:
  576. format gui slot {_count} of player with ({crate.%player%.inv::%{_count}%} parsed as an item) to do nothing
  577.  
  578.  
  579. add 1 to {_count}
  580.  
  581. delete {crates.closed.%player%}
  582. delete {crates.openinglist::*}
  583. delete {crate.%player%.inv::*}
  584. delete {crate.%player%.name}
  585.  
  586.  
  587. else:
  588. open chest with 3 rows named "&2%loop-value-1%" to player
  589. format gui slot 13 of player with a tripwire hook named "&7Open crate" with lore "&7Keys left: %{keys.%player%.%loop-value-1%}%" to close then run function openCrate(player, "%loop-value-1%")
  590. stop loop
  591. else:
  592. open chest with 3 rows named "&2%loop-value-1%" to player
  593. format gui slot 13 of player with a tripwire hook named "&7Open crate" with lore "&7Keys left: %{keys.%player%.%loop-value-1%}%" to close then run function openCrate(player, "%loop-value-1%")
  594. stop loop
  595.  
  596.  
  597. on inventory close:
  598. if {crates.opening.%player%} is true:
  599. set {crates.closed.%player%} to true
  600. add player to {crates.openinglist::*}
  601. clear {crate.%player%.inv::*}
  602. set {crate.%player%.name} to name of player's current inventory
  603. set {_count} to 0
  604.  
  605.  
  606. loop 27 times:
  607. set {crate.%player%.inv::%{_count}%} to slot {_count} of player's current inventory
  608. add 1 to {_count}
  609.  
  610. else if {crates.opening.%player%} is set:
  611. delete {crates.opening.%player%}
  612.  
  613. if name of current inventory of player is "&8Edit" or "&8Edit Helmet":
  614. if {cosmetics.edit.%player%} is not set:
  615. delete {cosmetics.edit.%player%.type}
  616. delete {cosmetics.edit.%player%.current}
  617.  
  618. on chat:
  619. if {cosmetics.edit.%player%} is set:
  620. cancel event
  621. if {cosmetics.edit.%player%} is "helmetItem":
  622.  
  623. if "%message%" is "cancel":
  624. send "{@lobby} Cancelled setting the item."
  625. editHelmet(player, "helmet", "Helmet", "%{cosmetics.edit.%player%.type}%")
  626. delete {cosmetics.edit.%player%}
  627.  
  628. else if "%message%" parsed as an item type is not set:
  629. send "{@lobby} &c%message% &4is not a helmet!"
  630.  
  631. else:
  632. set {_var} to "%message%"
  633. replace all " " in {_var} with "_"
  634.  
  635. if {_var} contains "_":
  636. set {_message::*} to {_var} split at "_"
  637.  
  638. if contains({_message::*}, "helmet"):
  639. send "{@lobby} Succesfully set item to &a%message%"
  640. editHelmet(player, "helmet", "Helmet", "%{cosmetics.edit.%player%.type}%")
  641. delete {cosmetics.edit.%player%}
  642.  
  643.  
  644. else if "%message%" = "head":
  645. send "{@lobby} Succesfully set item to &a%message%"
  646. editHelmet(player, "helmet", "Helmet", "%{cosmetics.edit.%player%.type}%")
  647. delete {cosmetics.edit.%player%}
  648.  
  649. else if contains({_message::*}, "head"):
  650. send "{@lobby} Succesfully set item to &a%message%"
  651. editHelmet(player, "helmet", "Helmet", "%{cosmetics.edit.%player%.type}%")
  652. delete {cosmetics.edit.%player%}
  653.  
  654. else:
  655. send "{@lobby} &c%message% &4is not a helmet!"
  656.  
  657. else if {cosmetics.edit.%player%} is "setType":
  658. set {cosmetics.edit.%player%.type} to "%message%"
  659. delete {cosmetics.edit.%player%}
  660.  
  661. send "{@lobby} Succesfully set type to &a%message%"
  662. editCos(player, {cosmetics.edit.%player%.type})
  663.  
  664.  
  665.  
  666. else if world of player is world of {lobby.location}:
  667. cancel event
  668. send "&7[&e%player%&7] &8>> &f%message%" to all players in world of player
  669. send "&7[&eLobby&7][&e%player%&7] &f>> %message%" to console
  670.  
  671.  
  672. #------------------- Commands -------------------
  673. command /lobby [<text>] [<text>]:
  674. aliases: /hub
  675. trigger:
  676. if player has permission "lobby.*":
  677. if arg-1 is set:
  678. if arg-1 is "help":
  679. send "&2----------[ &a%{cmd}% &2]----------"
  680. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  681. send "&e&o/%{cmd}% set &d→ &fSet the lobby"
  682. send "&2----------[ &a%{cmd}% &2]----------"
  683.  
  684. else if arg-1 is "set":
  685. send "{@logo} &2Succesfully set the &a%{cmd}% &2to your location!"
  686. set {lobby.location} to location of player
  687.  
  688. else:
  689. if {lobby.location} is set:
  690. if world of player is not "%world of {lobby.location}%":
  691. teleport player to {lobby.location}
  692. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  693. clear player's inventory
  694. set slot 4 of player to a compass named "{@lcompass}"
  695.  
  696. else:
  697. teleport player to {lobby.location}
  698.  
  699. else:
  700. send "{@lobby} &cThe %{cmd}% is not set yet!"
  701.  
  702.  
  703. else if {lobby.location} is set:
  704. if world of player is not "%world of {lobby.location}%":
  705. teleport player to {lobby.location}
  706. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  707. clear player's inventory
  708. set slot 4 of player to a compass named "{@lcompass}"
  709.  
  710. else:
  711. teleport player to {lobby.location}
  712.  
  713. else:
  714. send "{@lobby} &cThe %{cmd}% is not set yet!"
  715.  
  716.  
  717. command /lobbycompass [<text>] [<text>] [<text>]:
  718. aliases: /lcomp, /lcompass
  719. trigger:
  720. if player has permission "lobbycompass.*":
  721. if arg 1 is not set:
  722. send "{@lobby} &4Do &c&o/%{cmd}% help &4for more info."
  723.  
  724. else if arg 1 is set:
  725. if arg 1 is "help":
  726. send "&2----------[ &a%{cmd}% &2]----------"
  727. send "&e&o/%{cmd}% help &d→ &fKrijg help pagina"
  728. send "&e&o/%{cmd}% create <minigame> &d→ &fCreate a minigame"
  729. send "&e&o/%{cmd}% remove/delete <minigame> &d→ &fDelete a minigame"
  730. send "&e&o/%{cmd}% setspawn <minigame> &d→ &fSet the spawn of a minigame"
  731. send "&e&o/%{cmd}% slot <minigame> <number> &d→ &fSet the GUI slot of a minigame"
  732.  
  733. send "&e&o/%{cmd}% setname <minigame> <name> &d→ &fSet a name"
  734. send "&e&o/%{cmd}% deletename <minigame> &d→ &fDelete the name of a minigame"
  735. send "&e&o/%{cmd}% setlore <minigame> <lore> &d→ &fSet a lore"
  736. send "&e&o/%{cmd}% deletelore <minigame> <minigame> &d→ &fDelete the lore of a minigame"
  737. send "&e&o/%{cmd}% setitem <minigame> <item> &d→ &fSet the item of a minigame"
  738. send "&e&o/%{cmd}% list &d→ &fGet a list of all the minigames"
  739. send "&e&o/%{cmd}% setrows <number> &d→ &fSet the amount of rows in the GUI"
  740. send "&e&o/%{cmd}% gui <minigame> &d→ &fOpen the config-GUI"
  741. send "&2----------[ &a%{cmd}% &2]----------"
  742.  
  743. else if arg 1 is "create":
  744. if arg 2 is set:
  745. if {lobby.minigames.%arg 2%} is not set:
  746. set {lobby.minigames.%arg 2%} to true
  747. set {lobby.minigames.%arg 2%.name} to "&cNone"
  748. set {lobby.minigames.%arg 2%.lore} to "&cNone"
  749. set {lobby.minigames.%arg 2%.item} to "&cNone"
  750. set {lobby.minigames.%arg 2%.slot} to "&cNone"
  751. set {lobby.minigames.%arg 2%.spawn} to "&cNone"
  752. add arg 2 to {lobby.minigames.list::*}
  753.  
  754. send "{@lobby} &2Succesfully made the minigame &a%arg 2%&2!"
  755.  
  756. else:
  757. send "{@lobby} &4The minigame &c%arg 2% &4already exists!"
  758. else:
  759. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1% <minigame>&4."
  760.  
  761. else if arg 1 is "delete" or "remove":
  762. if arg 2 is set:
  763. if {lobby.minigames.%arg 2%} is set:
  764. delete {lobby.minigames.%arg 2%}
  765. delete {lobby.minigames.%arg 2%.name}
  766. delete {lobby.minigames.%arg 2%.lore}
  767. delete {lobby.minigames.%arg 2%.item}
  768. delete {lobby.minigames.%arg 2%.slot}
  769. delete {lobby.minigames.%arg 2%.spawn}
  770. remove arg 2 from {lobby.minigames.list::*}
  771.  
  772. send "{@lobby} &2Succesfully removed the minigame &a%arg 2%&2!"
  773.  
  774. else:
  775. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  776. else:
  777. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  778.  
  779.  
  780. else if arg 1 is "setspawn":
  781. if arg 2 is set:
  782. if {lobby.minigames.%arg 2%} is set:
  783. set {lobby.minigames.%arg 2%.spawn} to location of player
  784. send "{@lobby} &2Succesfully set the spawn of the minigame%nl%&a%arg 2% &2arg &a%location of player%&2!"
  785.  
  786. else:
  787. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  788. else:
  789. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  790.  
  791. else if arg 1 is "slot":
  792. if arg 2 is set:
  793. if {lobby.minigames.%arg 2%} is set:
  794. if arg 3 is set:
  795. if (arg 3 parsed as a number) is set:
  796. if {lobby.compassRows} is not set:
  797. set {lobby.compassRows} to 1
  798.  
  799. if {lobby.compassRows} < 1:
  800. set {lobby.compassRows} to 1
  801.  
  802.  
  803. if {lobby.compassRows}*9-1 < arg-3 parsed as a number:
  804. send "{@lobby} &4The amount &c%arg 3% &4is to large bacause the max amount of slots is &c%{lobby.compassRows}*9+1%&4!"
  805.  
  806. else:
  807. loop {lobby.minigames.list::*}:
  808. if {lobby.minigames.%loop-value%.slot} is arg 3:
  809. set {_set} to loop-value
  810. stop loop
  811.  
  812. if {_set} is set:
  813. send "{@lobby} &4The slot &c%arg 3% &4is already in use by the minigame &c%{_set}%&4!"
  814. else:
  815. set {lobby.minigames.%arg 2%.slot} to arg 3
  816. send "{@lobby} &2Succesfully set the slot of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  817. else:
  818. send "{@lobby} &c%arg 3% &4is not a number!"
  819. else:
  820. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <number>&4."
  821. else:
  822. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  823. else:
  824. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <number>&4."
  825.  
  826.  
  827. else if arg 1 is "setname":
  828. if arg 2 is set:
  829. if {lobby.minigames.%arg 2%} is set:
  830. if arg 3 is set:
  831. set {lobby.minigames.%arg 2%.name} to arg 3
  832. send "{@lobby} &2Succesfully set the name of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  833.  
  834. else:
  835. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <name>&4."
  836. else:
  837. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  838. else:
  839. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  840.  
  841. else if arg 1 is "delname" or "deletename":
  842. if arg 2 is set:
  843. delete {lobby.minigames.%arg 2%.name}
  844. send "{@lobby} &2Succesfully deleted the name from the minigame &a%arg 2%&2!"
  845.  
  846. else:
  847. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  848.  
  849. else if arg 1 is "setlore":
  850. if arg 2 is set:
  851. if {lobby.minigames.%arg 2%} is set:
  852. if arg 3 is set:
  853. set {lobby.minigames.%arg 2%.lore} to arg 3
  854. send "{@lobby} &2Succesfully set the lore of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  855.  
  856. else:
  857. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <lore>&4."
  858. else:
  859. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  860. else:
  861. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <lore>&4."
  862.  
  863. else if arg 1 is "dellore" or "deletelore":
  864. if arg 2 is set:
  865. if {lobby.minigames.%arg 2%} is set:
  866. delete {lobby.minigames.%arg 2%.lore}
  867. send "{@lobby} &2Succesfully deleted the lore from the minigame &a%arg 2%&2!"
  868.  
  869. else:
  870. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  871. else:
  872. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  873.  
  874. else if arg 1 is "setitem":
  875. if arg 2 is set:
  876. if {lobby.minigames.%arg 2%} is set:
  877. if arg 3 is set:
  878. if (arg 3 parsed as an item) is set:
  879. set {lobby.minigames.%arg 2%.item} to arg 3 parsed as an item
  880. send "{@lobby} &2Succesfully set the item from the minigame &a%arg 2% &2to &a%arg 3%&2!"
  881.  
  882. else:
  883. send "{@lobby} &c%arg 3% &4is not an item!"
  884. else:
  885. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <item>&4."
  886. else:
  887. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  888. else:
  889. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <item>&4."
  890.  
  891.  
  892. else if arg 1 is "list":
  893. if {lobby.minigames.list::*} is not empty:
  894. loop {lobby.minigames.list::*}:
  895. if {_list} is set:
  896. set {_list} to "%{_list}%&2, &a%loop-value%"
  897. else:
  898. set {_list} to "%loop-value%"
  899.  
  900. else:
  901. set {_list} to "Geen"
  902.  
  903. send "{@lobby} &2This is the list of all the minigames:%nl%&a%{_list}%"
  904.  
  905.  
  906. else if arg 1 is "setrows":
  907. if arg 2 is set:
  908. if (arg 2 parsed as a number) is set:
  909. if (arg-2 parsed as a number) < 7:
  910. set {lobby.compassRows} to (arg-2 parsed as a number)
  911. send "{@lobby} &2Succesfully set the amount of rows to &a%arg 2%&2!"
  912.  
  913. else:
  914. send "{@lobby} &4The max amount of rows is &c6&4!"
  915. else:
  916. send "{@lobby} &c%arg 2% &4is not a number!"
  917. else:
  918. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <number>&4."
  919.  
  920.  
  921. else if arg 1 is "gui":
  922. if arg 2 is set:
  923. if {lobby.minigames.%arg 2%} is set:
  924. open chest with 2 rows named "&7Config GUI" to player
  925.  
  926. set {_name} to {lobby.minigames.%arg 2%.name}
  927. replace "&" in {_name} with "§"
  928.  
  929. set {_lore} to {lobby.minigames.%arg 2%.lore}
  930. replace "&" in {_lore} with "§"
  931.  
  932. format gui slot 2 of player with a book named "&2Minigame: &a%arg-2%" to do nothing
  933. format gui slot 3 of player with a name tag named "&2Name: &f%{_name}%" to close then run function lcompGui(player, "&7Name &8%arg-2%", 3, 12, 14, green_wool, red_wool, "&aChange", "&cDeny", "{@lobby} &2Click <suggest command:/lcomp setname %arg-2% [naam]>&ahere&r &2to edit the name.", "{@lobby} &4You have chosen to give the minigame%nl%&c%arg-2% &4not an other name.", false)
  934. format gui slot 4 of player with a paper named "&2Lore: &f%{_lore}%" to close then run function lcompGui(player, "&7Lore &8%arg-2%", 3, 12, 14, green_wool, red_wool, "&aChange", "&cDeny", "{@lobby} &2Click <suggest command:/lcomp setlore %arg-2% [lore]>&ahere&r &2to edit the lore.", "{@lobby} &4You have chosen to give the minigame%nl%&c%arg-2% &4not an other lore.", false)
  935. format gui slot 5 of player with an item frame named "&2Item: &a%{lobby.minigames.%arg-2%.item}%" to close then run function lcompGui(player, "&7Item &8%arg-2%", 3, 12, 14, green_wool, red_wool, "&aChange", "&cDeny", "{@lobby} &2Click <suggest command:/lcompass setitem %arg-2% [item]>&ahere<reset> &2to edit the item.", "{@lobby} &4You have chosen to give the minigame%nl%&c%arg-2% &4not an other item.", false)
  936. format gui slot 6 of player with a clock named "&2Slot: &a%{lobby.minigames.%arg-2%.slot}%" to close then run function lcompGui(player, "&7Slot &8%arg-2%", 3, 12, 14, green_wool, red_wool, "&aChange", "&cDeny", "{@lobby} &2Click <suggest command:/lcompass slot %arg-2% [slot]>&ahere<reset> &2to edit the slot.", "{@lobby} &4You have chosen to give the minigame%nl%&c%arg-2% &4not an other slot.", false)
  937.  
  938. format gui slot 12 of player with a paper named "&2Spawn: &a%{lobby.minigames.%arg-2%.spawn}%" to close then run function lcompGui(player, "&7Spawn &8%arg-2%", 3, 12, 14, green_wool, red_wool, "&aSet", "&cDeny", "{@lobby} &2Click <command:/lcompass setspawn %arg-2%>&ahere<reset> &2to set the spawn.", "{@lobby} &4You have chosen to give the minigame%nl%&c%arg-2% &4not an other spawn.", false)
  939. format gui slot 13 of player with a barrier named "&cClose menu" to close
  940. format gui slot 14 of player with a redstone named "&4Delete" to close then run function lcompGui(player, "&7Delete &8%arg-2%", 3, 12, 14, green_wool, red_wool, "&aDelete", "&cDeny", "/lcompass delete %arg-2%", "{@lobby} &4You have chosen to delete the minigame%nl%&c%arg-2% &4not.", true)
  941.  
  942. else:
  943. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  944. else:
  945. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  946. else:
  947. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  948.  
  949. command /lobbycrate [<text>] [<text>]:
  950. aliases: /lobbycr, /lcrate
  951. trigger:
  952. if player is in world of {lobby.location}:
  953. if player has permission "votecrate.*":
  954. if arg-1 is set:
  955. if arg-1 is "help":
  956. send "&2----------[ &a%{cmd}% &2]----------"
  957. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  958. send "&e&o/%{cmd}% list &d→ &fGet a list with all crates"
  959. send "&e&o/%{cmd}% create <crate> &d→ &fCreate a create"
  960. send "&e&o/%{cmd}% delete/remove <crate> &d→ &fDelete a crate"
  961. send "&e&o/%{cmd}% path <crate> &d→ &fGet the edit path of a crate"
  962. send "&e&o/%{cmd}% get <crate> &d→ &fGet a crate"
  963.  
  964. send "&2----------[ &a%{cmd}% &2]----------"
  965.  
  966. else if arg-1 is "list":
  967. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  968. if {_list::*} is not empty:
  969. loop {_list::*}:
  970. if {_list} is set:
  971. set {_list} to "%{_list}%&2, &a%loop-value%"
  972. else:
  973. set {_list} to "%loop-value%"
  974.  
  975. send "{@lobby} &2There are the following crates:%nl%&a%{_list}%"
  976.  
  977. else:
  978. send "{@lobby} &2There are no crates made yet."
  979.  
  980.  
  981. else if arg-1 is "create":
  982. if arg-2 is set:
  983. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  984. set {_arg2} to "%arg-2 to lower case%"
  985. if contains({_list::*}, {_arg2}):
  986. send "{@lobby} &4The crate &c%{_arg2}% &4already exists!"
  987.  
  988.  
  989. else:
  990.  
  991. send "{@lobby} &2Making the crate &a%{_arg2}%&2..."
  992. add {_arg2} to yml list "Lobby.Crates.List" of file "{@config}"
  993. create file "{@path}/%{_arg2}%.yml"
  994. add "diamond_sword" to yml list "Item.List" of file "{@path}/%{_arg2}%.yml"
  995. add "diamond_sword-1" to yml list "Item.ConfigName" of file "{@path}/%{_arg2}%.yml"
  996.  
  997. set yml value "Item.Chance.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "100"
  998. set yml value "Item.Name.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "&aDiamond Sword"
  999. set yml value "Item.Amount.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to 1
  1000.  
  1001. add "This is a lore" to yml list "Item.Lore.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  1002.  
  1003. add "sharpness:1" to yml list "Item.Enchants.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  1004.  
  1005. send "{@lobby} &2Succesfully made the crate &a%{_arg2}%&2!"
  1006.  
  1007.  
  1008. else:
  1009. send "{@lobby} &4You need to give up a &cname &4for the crate!"
  1010.  
  1011. else if arg-1 is "delete" or "remove":
  1012. if arg-2 is set:
  1013. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1014. set {_arg2} to "%arg-2 to lower case%"
  1015. if contains({_list::*}, {_arg2}):
  1016. send "{@lobby} &2Deleting the crate &a%{_arg2}%&2..."
  1017.  
  1018. remove "%{_arg2}%" from yml list "Lobby.Crates.List" of file "{@config}"
  1019. delete file "{@path}/%{_arg2}%.yml"
  1020.  
  1021. send "{@lobby} &2Succesfully deleted the crate &a%{_arg2}%&2!"
  1022.  
  1023. else:
  1024. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  1025.  
  1026. else:
  1027. send "{@lobby} &4You need to give up a &cname &4of the crate you want to delete!"
  1028.  
  1029. else if arg-1 is "path":
  1030. if arg-2 is set:
  1031. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1032. set {_arg2} to "%arg-2 to lower case%"
  1033.  
  1034. if contains({_list::*}, {_arg2}):
  1035. send "{@lobby} &2Location of %{_arg2}%: &a{@path}/%{_arg2}%&2."
  1036.  
  1037.  
  1038. else:
  1039. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exists!"
  1040. else:
  1041. send "{@lobby} &4You need to give up a &cname &4of the crate you want to get the path of!"
  1042.  
  1043. else if arg-1 is "get":
  1044. if arg 2 is set:
  1045. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1046. set {_arg2} to "%arg-2 to lower case%"
  1047. if contains({_list::*}, {_arg2}):
  1048. send "{@lobby} &2Here you have the &a%{_arg2}% &2crate!%nl%&2Place it to create a chest."
  1049. give player 1 chest named "&e%{_arg2}%" with lore "&7Place to create a crate!"
  1050. else:
  1051. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  1052. else:
  1053. send "{@lobby} &4You must give up a crate type!"
  1054.  
  1055. else:
  1056. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  1057. else:
  1058. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  1059.  
  1060.  
  1061. command /key [<text>] [<text>] [<text>] [<text>]:
  1062. trigger:
  1063. if player has permission "key.*":
  1064. if arg-1 is set:
  1065. if arg-1 is "help":
  1066. send "&2----------[ &a%{cmd}% &2]----------"
  1067. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  1068. send "&e&o/%{cmd}% get <crate/all> [number] &d→ &fGet a crate"
  1069. send "&e&o/%{cmd}% give <player> <crate/all> [number] &d→ &fGive a key to open a crate to a player"
  1070. send "&e&o/%{cmd}% remove <all/crate> [number] [player] &d→ &fRemove a key from a player"
  1071. send "&e&o/%{cmd}% clear <all/crate> [player] &d→ &fClear the keys from a player"
  1072. send "&e&o/%{cmd}% keys <all/crate> [player] &d→ &fGet the amount of keys from a player"
  1073. send "&2----------[ &a%{cmd}% &2]----------"
  1074.  
  1075. else if arg-1 is "get":
  1076. if arg-2 is "all":
  1077. if arg-3 is set:
  1078. if (arg-3 parsed as a number) is set:
  1079. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1080. set {_num} to arg-3 parsed as a number
  1081. loop {_num} times:
  1082. loop {_list::*}:
  1083. add 1 to {keys.%player%.%loop-value-2%}
  1084.  
  1085. send "{@lobby} &2You have recieved all the &a%arg-3% &2times!"
  1086.  
  1087. else:
  1088. send "{@lobby} &c%arg-3% &4is not a number!"
  1089. else:
  1090. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1091. loop {_list::*}:
  1092. add 1 to {keys.%player%.%loop-value%}
  1093.  
  1094. send "{@lobby} &2You have recieved all keys!"
  1095.  
  1096. else if arg-2 is set:
  1097. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1098. if contains({_list::*}, "%arg-2 to lower case%"):
  1099. if arg-3 is set:
  1100. if (arg-3 parsed as a number) is set:
  1101. add (arg-3 parsed as a number) to {keys.%player%.%arg-2 to lower case%}
  1102. send "{@lobby} &2You have recieved &a%arg-2 to lower case% &2key &a%arg-3% &2times!"
  1103. else:
  1104. send "{@lobby} &c%arg-3% &4is not a number!"
  1105. else:
  1106. add 1 to {keys.%player%.%arg-2 to lower case%}
  1107.  
  1108. send "{@lobby} &2You have recieved a &a%arg-2 to lower case% &2key!"
  1109. else:
  1110. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  1111. else:
  1112. send "{@lobby} &4You must give up a &ccrate&4!"
  1113.  
  1114. else if arg-1 is "give":
  1115. if arg-2 is set:
  1116. if (arg-2 parsed as a player) is set:
  1117. if arg-3 is set:
  1118. if arg-3 is "all":
  1119. if arg-4 is set:
  1120. if (arg-4 parsed as a number) is set:
  1121. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1122. set {_num} to arg-4 parsed as a number
  1123. loop {_num} times:
  1124. loop {_list::*}:
  1125. add 1 to {keys.%arg-2 parsed as a player%.%loop-value-2%}
  1126.  
  1127. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys &a%arg-4% &2times!"
  1128. send "{@lobby} &2You have recieved all the keys &a%arg-4% &2times!" to arg-2 parsed as a player
  1129.  
  1130. else:
  1131. send "{@lobby} &c%arg-3% &4is not a number!"
  1132. else:
  1133. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1134. loop {_list::*}:
  1135. add 1 to {keys.%arg-2 parsed as a player%.%loop-value%}
  1136.  
  1137. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys!"
  1138. send "{@lobby} &2You have recieved all the keys!" to arg-2 parsed as a player
  1139. else:
  1140. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1141. if contains({_list::*}, "%arg-3 to lower case%"):
  1142. if arg-4 is set:
  1143. if (arg-4 parsed as a number) is set:
  1144.  
  1145. add (arg-4 parsed as a number) to {keys.%arg-2%.%arg-3 to lower case%}
  1146.  
  1147. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2the &a%arg-3 to lower case% &2key &a%arg-4% &2times!"
  1148. send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key &a%arg-4% &2times!" to arg-2 parsed as a player
  1149.  
  1150. else:
  1151. send "{@lobby} &c%arg-3% &4is not a number!"
  1152. else:
  1153. add 1 to {keys.%arg-2 parsed as a player%.%arg-3 to lower case%}
  1154.  
  1155. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2the &a%arg-3 to lower case% &2key!"
  1156. send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key!" to arg-2 parsed as a player
  1157. else:
  1158. send "{@lobby} &4The crate &c%arg-3 to lower case% &4doesn't exist!"
  1159. else:
  1160. send "{@lobby} &4You must give up a &ccrate&4!"
  1161. else:
  1162. send "{@lobby} &4The player &c%arg-2% &4is not online!"
  1163. else:
  1164. send "{@lobby} &4You must give up a &cplayer&4!"
  1165.  
  1166.  
  1167.  
  1168. else if arg-1 is "remove":
  1169. if arg-2 is set:
  1170. if arg-2 is "all":
  1171. if arg-3 is set:
  1172. if (arg-3 parsed as a number) is set:
  1173. if arg-4 is set:
  1174. if (arg-4 parsed as a player) is set:
  1175. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1176. set {_num} to arg-3 parsed as a number
  1177. loop {_list::*}:
  1178. if {keys.%arg-4 parsed as a player%.%loop-value%}-{_num} >= 0:
  1179. remove {_num} from {keys.%name of arg-4 parsed as a player%.%loop-value%}
  1180. else:
  1181. set {keys.%arg-4 parsed as a player%.%loop-value%} to 0
  1182.  
  1183. send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys of &a%name of arg-4 parsed as a player%&2!"
  1184. send "{@lobby} &2Removed &a%arg-3% &2from your keys!" to arg-4 parsed as a player
  1185.  
  1186. else:
  1187. send "{@lobby} &4The player &c%arg-4% &4is not online!"
  1188. else:
  1189. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1190. loop {_list::*}:
  1191. if {keys.%player%.%loop-value%}-(arg-3 parsed as a number) >= 0:
  1192. remove (arg-3 parsed as a number) from {keys.%player%.%loop-value%}
  1193. else:
  1194. set {keys.%player%.%loop-value%} to 0
  1195.  
  1196. send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys!"
  1197.  
  1198. else:
  1199. send "{@lobby} &c%arg-3% &4is not a number!"
  1200. else:
  1201. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1202. loop {_list::*}:
  1203. if {keys.%player%.%loop-value%}-1 >= 0:
  1204. remove 1 from {keys.%player%.%loop-value%}
  1205.  
  1206. send "{@lobby} &2Succesfully removed &a1 &2from all the keys"
  1207. else:
  1208. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1209. if contains({_list::*}, "%arg-2 to lower case%"):
  1210. if arg-3 is set:
  1211. if (arg-3 parsed as a number) is set:
  1212. if arg-4 is set:
  1213. if (arg-4 parsed as a player) is set:
  1214. if {keys.%arg-4 parsed as a player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
  1215. remove (arg-3 parsed as a number) from {keys.%name of arg-4 parsed as a player%.%arg-2 to lower case%}
  1216. else:
  1217. set {keys.%arg-4 parsed as a player%.%arg-2 to lower case%} to 0
  1218.  
  1219. send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys from &a%name of arg-4 parsed as a player%&2!"
  1220. send "{@lobby} &a%arg-3% %arg-2 to lower case% &2keys have been removed!" to arg-4 parsed as a player
  1221.  
  1222. else:
  1223. send "{@lobby} &4The player &c%arg-4% &4is not online!"
  1224. else:
  1225.  
  1226. if {keys.%player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
  1227. remove (arg-3 parsed as a number) from {keys.%player%.%arg-2 to lower case%}
  1228. send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys!"
  1229.  
  1230. else:
  1231. send "{@lobby} &c%arg-3% &4is not a number!"
  1232.  
  1233. else:
  1234. if {keys.%player%.%arg-2 to lower case%}-1 >= 0:
  1235. remove 1 from {keys.%player%.%arg-2 to lower case%}
  1236. send "{@lobby} &2Succesfully removed &a1 %arg-2 to lower case% &2keys!"
  1237. else:
  1238. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  1239. else:
  1240. send "{@lobby} &4You must give up a &ccrate&4!"
  1241.  
  1242. else if arg-1 is "clear":
  1243. if arg-2 is set:
  1244. if arg-2 is "all":
  1245. if arg-3 is set:
  1246. if (arg-3 parsed as a player) is set:
  1247. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1248. loop {_list::*}:
  1249. set {keys.%arg-3 parsed as a player%.%loop-value%} to 0
  1250.  
  1251. send "{@lobby} &2Succesfully cleared &aall keys &2of &a%name of arg-3 parsed as a player%&2!"
  1252. send "{@lobby} &aAll &2your &akeys &2have been cleared!" to arg-3 parsed as a player
  1253. else:
  1254. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1255. else:
  1256. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1257. loop {_list::*}:
  1258. set {keys.%player%.%loop-value%} to 0
  1259.  
  1260. send "{@lobby} &2You have cleared &aall &2your &akeys&2!"
  1261. else:
  1262. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1263. if contains({_list::*}, "%arg-2 to lower case%"):
  1264. if arg-3 is set:
  1265. if (arg-3 parsed as a player) is set:
  1266. set {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} to 0
  1267. send "{@lobby} &2You have cleared the &a%arg-2 to lower case% keys &2from &a%name of arg-3 parsed as a player%&2!"
  1268. send "{@lobby} &2Your &a%arg-2 to lower case% keys &2have been cleared!" to arg-3 parsed as a player
  1269.  
  1270. else:
  1271. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1272.  
  1273. else:
  1274. set {keys.%player%.%arg-2 to lower case%} to 0
  1275. send "{@lobby} &2Succesfully cleared the &a%arg-2 to lower case% keys&2!"
  1276.  
  1277. else:
  1278. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
  1279. else:
  1280. send "{@lobby} &4You must give up a &ccrate&4!"
  1281.  
  1282. else if arg-1 is "keys":
  1283. if arg-2 is set:
  1284. if arg-2 is "all":
  1285. if arg-3 is set:
  1286. if (arg-3 parsed as a player) is set:
  1287. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1288. loop {_list::*}:
  1289. if {keys.%arg-3 parsed as a player%.%loop-value%} is not set:
  1290. set {keys.%arg-3 parsed as a player%.%loop-value%} to 0
  1291.  
  1292. if {_keys} is not set:
  1293. set {_keys} to "&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
  1294. else:
  1295. set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
  1296.  
  1297. send "{@lobby} &2This is the list of keys from &a%name of arg-3 parsed as a player%&2:%nl%%{_keys}%"
  1298.  
  1299. else:
  1300. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1301. else:
  1302. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1303. loop {_list::*}:
  1304. if {keys.%player%.%loop-value%} is not set:
  1305. set {keys.%player%.%loop-value%} to 0
  1306. if {_keys} is not set:
  1307. set {_keys} to "&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
  1308. else:
  1309. set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
  1310.  
  1311. send "{@lobby} &2This is your list of keys&2:%nl%%{_keys}%"
  1312. else:
  1313. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1314. if contains({_list::*}, "%arg-2 to lower case%"):
  1315. if arg-3 is set:
  1316. if (arg-3 parsed as a player) is set:
  1317. if {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} is not set:
  1318. set {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} to 0
  1319.  
  1320. send "{@lobby} &a%name of arg-3 parsed as a player% &2has &a%{keys.%arg-3%.%arg-2 to lower case%}% %arg-2 to lower case% &2keys."
  1321.  
  1322. else:
  1323. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1324. else:
  1325. if {keys.%player%.%arg-2 to lower case%} is not set:
  1326. set {keys.%player%.%arg-2 to lower case%} to 0
  1327.  
  1328. send "{@lobby} &2You have &a%{keys.%player%.%arg-2 to lower case%}% %arg-2 to lower case% &2keys."
  1329. else:
  1330. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
  1331. else:
  1332. send "{@lobby} &4You need to give up a &ccrate&4!"
  1333. else:
  1334. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  1335. else:
  1336. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  1337.  
  1338.  
  1339. command /cosmetics [<text>] [<text>] [<text>]:
  1340. aliases: /cos
  1341. trigger:
  1342. if player has permission "cosmetics.*":
  1343. if arg-1 is not set:
  1344. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  1345.  
  1346. else if arg-1 is "help":
  1347. send "&2----------[ &a%{cmd}% &2]----------"
  1348. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  1349. send "&e&o/%{cmd}% gui [player] &d→ &fGet the cosmetics (of a player)"
  1350. send "&e&o/%{cmd}% setup <type> &d→ &fCreate a cosmetic"
  1351. send "&e&o/%{cmd}% edit [type] &d→ &fEdit a cosmetic"
  1352. #send "&e&o/%{cmd}% delete [type] [name] &d→ &fDelete a cosmetic"
  1353. send "&e&o/%{cmd}% path &d→ &fCreate your own cosmetics"
  1354. send "&2----------[ &a%{cmd}% &2]----------"
  1355.  
  1356. #else if arg-1 is "gui":
  1357. # if arg-2 is set:
  1358. # if arg-2 parsed as a player is set:
  1359. #
  1360.  
  1361. # else:
  1362. # send "{@lobby} &4The player &c%arg-2% &4has never logged in."
  1363.  
  1364. # else:
  1365.  
  1366. else if arg-1 is "setup":
  1367. if arg-2 is set:
  1368. editCos(player, "%arg-2%")
  1369. #open chest with 1 rows named "&8Cosmetics %arg-2%" to player
  1370. #format gui slot 2 of player with nether star named "&fCreate" to close
  1371. #format gui slot 4 of player with redstone torch on named "&fEdit" to close
  1372. #format gui slot 6 of player with blaze powder named "&fDelete" to close
  1373.  
  1374. else:
  1375. editCos(player, "")
  1376. #open chest with 1 rows named "&8Edit Cosmetics" to player
  1377. #format gui slot 2 of player with nether star named "&fCreate" to close
  1378. #format gui slot 4 of player with redstone torch on named "&fEdit" to close
  1379. #format gui slot 6 of player with blaze powder named "&fDelete" to close
  1380.  
  1381. else if arg-1 is "path":
  1382. send "{@lobby} The path to edit your cosmetics is %nl%&a{@cosConfig} &2and to create cosmetics %nl%&a{@path}/Cosmetics/"
  1383.  
  1384. else:
  1385. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
Add Comment
Please, Sign In to add comment