Zeldaboy111

Skript #267 ]|[ Cosmetics (1)

Dec 1st, 2019
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 52.37 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.  
  292.  
  293. function editCos(p: Player, type: String):
  294. set {cosmetics.edit.%{_p}%.type} to {_type}
  295. if {_type} is "":
  296. open chest with 6 rows named "&8Edit" to {_p}
  297. format gui slot 10 of {_p} with barrier named "&4Helmet" to close then run function editHelmet({_p}, "", "")
  298. format gui slot 19 of {_p} with barrier named "&4Chestplate" to do nothing
  299. format gui slot 28 of {_p} with barrier named "&4Leggings" to do nothing
  300. format gui slot 37 of {_p} with barrier named "&4Boots" to do nothing
  301.  
  302. format gui slot 18 of {_p} with paper named "&4Type: &c<none>" to do nothing
  303.  
  304. function editHelmet(p: Player, type: String, helmet: String):
  305. #Via Config file
  306. wait 3 ticks
  307. open chest with 3 rows named "&8Edit Helmet" to {_p}
  308.  
  309. if {_helmet} is "":
  310. if {_type} is "":
  311. format gui slot 10 of {_p} with barrier named "&4Helmet" to run:
  312. send "{@lobby} Type the type of your helmet in chat" to {_p}
  313. set {cosmetics.edit.%{_p}%} to "helmetItem"
  314. close {_p}'s inventory
  315.  
  316.  
  317. else if yml file "{@helmetPath}" doesn't exist:
  318. if yml file "{@suitPath}" doesn't exist:
  319. format gui slot 10 of {_p} with barrier named "&4Helmet" to run:
  320. send "{@lobby} Type the type of your helmet in chat" to {_p}
  321. set {cosmetics.edit.%{_p}%} to "helmetItem"
  322. close {_p}'s inventory
  323.  
  324. else:
  325. #Item variable, Name variable, Lore variable, Enchantment list variable
  326. format gui slot 10 of {_p} with ({_helmet} parsed as an item type) named "&aHelmet" to run:
  327. send "{@lobby} Type the type of your helmet in chat" to {_p}
  328. set {cosmetics.edit.%{_p}%} to "helmetItem"
  329. close {_p}'s inventory
  330.  
  331.  
  332.  
  333. function editChestplate():
  334.  
  335. function editLeggings():
  336.  
  337. function editBoots():
  338.  
  339. function editType():
  340.  
  341.  
  342.  
  343.  
  344.  
  345. #------------------- Periotic Events -------------------
  346.  
  347.  
  348.  
  349.  
  350.  
  351. #------------------- Events -------------------
  352. on enable:
  353. if file "{@config}" doesn't exist:
  354. create file "{@config}"
  355.  
  356. set yml value "Lobby.Crates.Animations.Window1" of file "Files/Lobby/config.yml" to true
  357. set yml value "Lobby.Crates.Animations.Random.Enabled" of file "Files/Lobby/config.yml" to true
  358. set yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "Files/Lobby/config.yml" to "Window1"
  359.  
  360. #if yml file "{@helmetPath}" doesn't exist:
  361. # create folder "{@helmetPath}"
  362.  
  363. #if yml file "{@suitPath}" doesn't exist:
  364. # create folder "{@suitPath}"
  365.  
  366. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  367.  
  368. loop {_list::*}:
  369. set {_world} to world of {lobby.location}
  370. loop {lobbycr.%loop-value%.location::*}:
  371. set {holo-crate-%{_world}%-%loop-value-2%} to a new hologram at block above loop-value-2
  372. add text "&a&l%loop-value-1%" to hologram {holo-crate-%{_world}%-%loop-value-2%}
  373.  
  374. on disable:
  375. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  376. set {_world} to world of {lobby.location}
  377.  
  378. loop {_list::*}:
  379. delete yml list "Locations" of file "{@path}/%loop-value%.yml"
  380. loop {lobbycr.%loop-value%.location::*}:
  381. add "%loop-value-2%" to yml list "Locations" of file "{@path}/%loop-value-1%.yml"
  382. unregister hologram {holo-crate-%{_world}%-%loop-value-2%}
  383.  
  384. loop {crates.openinglist::*}:
  385. clear {crates.opening.%loop-value%}
  386. clear {crates.%loop-value%.inv::*}
  387. clear {crates.%loop-value%.name}
  388. clear {crate.closed.%loop-value%}
  389.  
  390. clear {crates.openinglist::*}
  391.  
  392. on join:
  393. if {lobby.location} is set:
  394. teleport player to {lobby.location}
  395. set join message to ""
  396. wait 10 ticks
  397.  
  398. clear player's inventory
  399. send "{@lobby} &fThe player %player% has joined!" to all players in world of player
  400. set slot 4 of player to a compass named "{@lcompass}"
  401.  
  402. on quit:
  403. if {crates.opening.%player%} is set:
  404. clear {crates.opening.%player%}
  405. clear {crates.%player%.inv::*}
  406. clear {crates.%player%.name}
  407. clear {crates.closed.%player%}
  408. remove player from {crates.openinglist::*}
  409.  
  410. on damage:
  411. if world of victim is world of {lobby.location}:
  412. if damage cause is "void" parsed as a damage cause:
  413. set victim's health to 0
  414.  
  415. else:
  416. cancel event
  417.  
  418. on death:
  419. if world of player is world of {lobby.location}:
  420. set death message to ""
  421.  
  422. on respawn:
  423. if world of player is world of {lobby.location}:
  424. set slot 4 of player to a compass named "{@lcompass}"
  425. teleport player to {lobby.location}
  426.  
  427. on inventory click:
  428. if player is in world of {lobby.location}:
  429. if clicked item is a compass named "{@lcompass}":
  430. cancel event
  431. close player's inventory
  432. openCompass(player)
  433.  
  434.  
  435.  
  436. on click:
  437. if player is in world of {lobby.location}:
  438. if player's held item is a compass named "{@lcompass}":
  439. cancel event
  440. openCompass(player)
  441.  
  442.  
  443. on command:
  444. command is "plugins" or "pl":
  445. cancel event
  446.  
  447. if player is not op:
  448. stop
  449.  
  450. else:
  451. set {_list::*} to list of plugins
  452. set {_count} to 0
  453. loop {_list::*}:
  454. add 1 to {_count}
  455. send "{@logo} Plugin list:%nl%&f(&a%{_count}%&f) &2%list of plugins%"
  456.  
  457. else:
  458. set {cmd} to "%command to lower case%"
  459.  
  460. on place of chest:
  461. set {_world} to world of event-block
  462. if {_world} is world of {lobby.location}:
  463. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  464. if contains({_list::*}, "%uncolored name of player's tool%"):
  465.  
  466. add location of block at event-block to {lobbycr.%uncolored name of player's tool%.location::*}
  467. add world of event-block to {lobbycr.%uncolored name of player's tool%.world::*}
  468.  
  469. set {holo-crate-%world of event-block%-%location of event-block%} to new hologram at location 1 meters above event-block
  470. add text "&a&l%uncolored name of player's tool%" to hologram {holo-crate-%world of event-block%-%location of event-block%}
  471. add "%location of block at event-block%" to yml list "Locations" of file "{@path}/%uncolored name of player's tool%.yml"
  472.  
  473. send "{@lobby} &2Succesfully created a &a%uncolored name of player's tool% &2Crate!"
  474.  
  475.  
  476. on break of chest:
  477. set {_world} to world of event-block
  478. if {_world} is world of {lobby.location}:
  479. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  480. loop {_list::*}:
  481. loop {lobbycr.%loop-value-1%.location::*}:
  482. if loop-value-2 is location of event-block:
  483. remove location of block at event-block from {lobbycr.%loop-value-1%.location::*}
  484. remove world of event-block from {lobbycr.%loop-value-1%.world::*}
  485.  
  486. unregister hologram {holo-crate-%world of event-block%-%location of event-block%}
  487. delete {holo-crate-%world of event-block%-%location of event-block%}
  488. remove "%location of event-block%" from yml list "Locations" of file "{@path}/%loop-value-1%.yml"
  489.  
  490. send "{@lobby} &2Succesfully removed a &a%loop-value-1% &2Crate!"
  491.  
  492.  
  493.  
  494. on rightclick on a chest:
  495. set {_world} to world of clicked block
  496. if {_world} is "%world of {lobby.location}%":
  497.  
  498. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  499. loop {_list::*}:
  500.  
  501. loop {lobbycr.%loop-value-1%.location::*}:
  502. if "%loop-value-2%" is "%location of clicked block%":
  503. cancel event
  504. if "%uncolored {crate.%player%.name}%" = loop-value-1:
  505. if {crates.opening.%player%} is true:
  506. open chest with 3 rows named "&2%{crate.%player%.name}%" to player
  507.  
  508. set {crates.reopening.%player%} to true
  509. set {_count} to 0
  510. loop 27 times:
  511. if {crate.%player%.inv::%{_count}%} is set:
  512. set {_value} to "%{crate.%player%.inv::%{_count}%}%"
  513. set {_color::*} to {_value} split at " "
  514.  
  515. if contains({_color::*}, "glass") is true:
  516. if contains({_color::*}, "light") is true:
  517. format gui slot {_count} of player with ("light %{_color::2}% stained glass pane" parsed as an item) to do nothing
  518.  
  519. else if contains({_color::*}, "dark") is true:
  520. format gui slot {_count} of player with ("dark %{_color::2}% stained glass pane" parsed as an item) to do nothing
  521.  
  522. else:
  523. format gui slot {_count} of player with ("%{_color::1}% stained glass pane" parsed as an item) to do nothing
  524.  
  525. else:
  526. format gui slot {_count} of player with ({crate.%player%.inv::%{_count}%} parsed as an item) to do nothing
  527.  
  528.  
  529. add 1 to {_count}
  530.  
  531. delete {crates.closed.%player%}
  532. delete {crates.openinglist::*}
  533. delete {crate.%player%.inv::*}
  534. delete {crate.%player%.name}
  535.  
  536.  
  537. else:
  538. open chest with 3 rows named "&2%loop-value-1%" to player
  539. 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%")
  540. stop loop
  541. else:
  542. open chest with 3 rows named "&2%loop-value-1%" to player
  543. 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%")
  544. stop loop
  545.  
  546.  
  547. on inventory close:
  548. if {crates.opening.%player%} is true:
  549. set {crates.closed.%player%} to true
  550. add player to {crates.openinglist::*}
  551. clear {crate.%player%.inv::*}
  552. set {crate.%player%.name} to name of player's current inventory
  553. set {_count} to 0
  554.  
  555.  
  556. loop 27 times:
  557. set {crate.%player%.inv::%{_count}%} to slot {_count} of player's current inventory
  558. add 1 to {_count}
  559.  
  560. else if {crates.opening.%player%} is set:
  561. delete {crates.opening.%player%}
  562.  
  563. if name of current inventory of player is "&8Edit" or "&8Edit Helmet":
  564. if {cosmetics.edit.%player%} is not set:
  565. delete {cosmetics.edit.%player%.type}
  566.  
  567. on chat:
  568.  
  569. if {cosmetics.edit.%player%} is set:
  570. cancel event
  571. if {cosmetics.edit.%player%} is "helmetItem":
  572. if "%message%" is "cancel":
  573. send "{@lobby} Cancelled setting the item."
  574. editHelmet(player, "%{cosmetics.edit.%player%.type}%", "")
  575. delete {cosmetics.edit.%player%}
  576.  
  577. if "%message%" parsed as an item type is not set:
  578. send "{@lobby} &c%message% &4is not a helmet!"
  579.  
  580. else:
  581. set {_var} to "%message%"
  582. replace all " " in {_var} with "_"
  583.  
  584. if {_var} contains "_":
  585. set {_message::*} to {_var} split at "_"
  586.  
  587. if contains({_message::*}, "helmet"):
  588. send "{@lobby} Succesfully set item to &a%message%"
  589. editHelmet(player, "%{cosmetics.edit.%player%.type}%", "%message%")
  590. delete {cosmetics.edit.%player%}
  591.  
  592.  
  593. else if "%message%" = "head":
  594. send "{@lobby} Succesfully set item to &a%message%"
  595. editHelmet(player, "%{cosmetics.edit.%player%.type}%", "head")
  596. delete {cosmetics.edit.%player%}
  597.  
  598. else if contains({_message::*}, "head"):
  599. send "{@lobby} Succesfully set item to &a%message%"
  600. editHelmet(player, "%{cosmetics.edit.%player%.type}%", "head")
  601. delete {cosmetics.edit.%player%}
  602.  
  603. else:
  604. send "{@lobby} &c%message% &4is not a helmet!"
  605.  
  606. else if world of player is world of {lobby.location}:
  607. cancel event
  608. send "&7[&e%player%&7] &8>> &f%message%" to all players in world of player
  609. send "&7[&eLobby&7][&e%player%&7] &f>> %message%" to console
  610.  
  611.  
  612. #------------------- Commands -------------------
  613. command /lobby [<text>] [<text>]:
  614. aliases: /hub
  615. trigger:
  616. if player has permission "lobby.*":
  617. if arg-1 is set:
  618. if arg-1 is "help":
  619. send "&2----------[ &a%{cmd}% &2]----------"
  620. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  621. send "&e&o/%{cmd}% set &d→ &fSet the lobby"
  622. send "&2----------[ &a%{cmd}% &2]----------"
  623.  
  624. else if arg-1 is "set":
  625. send "{@logo} &2Succesfully set the &a%{cmd}% &2to your location!"
  626. set {lobby.location} to location of player
  627.  
  628. else:
  629. if {lobby.location} is set:
  630. if world of player is not "%world of {lobby.location}%":
  631. teleport player to {lobby.location}
  632. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  633. clear player's inventory
  634. set slot 4 of player to a compass named "{@lcompass}"
  635.  
  636. else:
  637. teleport player to {lobby.location}
  638.  
  639. else:
  640. send "{@lobby} &cThe %{cmd}% is not set yet!"
  641.  
  642.  
  643. else if {lobby.location} is set:
  644. if world of player is not "%world of {lobby.location}%":
  645. teleport player to {lobby.location}
  646. send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  647. clear player's inventory
  648. set slot 4 of player to a compass named "{@lcompass}"
  649.  
  650. else:
  651. teleport player to {lobby.location}
  652.  
  653. else:
  654. send "{@lobby} &cThe %{cmd}% is not set yet!"
  655.  
  656.  
  657. command /lobbycompass [<text>] [<text>] [<text>]:
  658. aliases: /lcomp, /lcompass
  659. trigger:
  660. if player has permission "lobbycompass.*":
  661. if arg 1 is not set:
  662. send "{@lobby} &4Do &c&o/%{cmd}% help &4for more info."
  663.  
  664. else if arg 1 is set:
  665. if arg 1 is "help":
  666. send "&2----------[ &a%{cmd}% &2]----------"
  667. send "&e&o/%{cmd}% help &d→ &fKrijg help pagina"
  668. send "&e&o/%{cmd}% create <minigame> &d→ &fCreate a minigame"
  669. send "&e&o/%{cmd}% remove/delete <minigame> &d→ &fDelete a minigame"
  670. send "&e&o/%{cmd}% setspawn <minigame> &d→ &fSet the spawn of a minigame"
  671. send "&e&o/%{cmd}% slot <minigame> <number> &d→ &fSet the GUI slot of a minigame"
  672.  
  673. send "&e&o/%{cmd}% setname <minigame> <name> &d→ &fSet a name"
  674. send "&e&o/%{cmd}% deletename <minigame> &d→ &fDelete the name of a minigame"
  675. send "&e&o/%{cmd}% setlore <minigame> <lore> &d→ &fSet a lore"
  676. send "&e&o/%{cmd}% deletelore <minigame> <minigame> &d→ &fDelete the lore of a minigame"
  677. send "&e&o/%{cmd}% setitem <minigame> <item> &d→ &fSet the item of a minigame"
  678. send "&e&o/%{cmd}% list &d→ &fGet a list of all the minigames"
  679. send "&e&o/%{cmd}% setrows <number> &d→ &fSet the amount of rows in the GUI"
  680. send "&e&o/%{cmd}% gui <minigame> &d→ &fOpen the config-GUI"
  681. send "&2----------[ &a%{cmd}% &2]----------"
  682.  
  683. else if arg 1 is "create":
  684. if arg 2 is set:
  685. if {lobby.minigames.%arg 2%} is not set:
  686. set {lobby.minigames.%arg 2%} to true
  687. set {lobby.minigames.%arg 2%.name} to "&cNone"
  688. set {lobby.minigames.%arg 2%.lore} to "&cNone"
  689. set {lobby.minigames.%arg 2%.item} to "&cNone"
  690. set {lobby.minigames.%arg 2%.slot} to "&cNone"
  691. set {lobby.minigames.%arg 2%.spawn} to "&cNone"
  692. add arg 2 to {lobby.minigames.list::*}
  693.  
  694. send "{@lobby} &2Succesfully made the minigame &a%arg 2%&2!"
  695.  
  696. else:
  697. send "{@lobby} &4The minigame &c%arg 2% &4already exists!"
  698. else:
  699. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1% <minigame>&4."
  700.  
  701. else if arg 1 is "delete" or "remove":
  702. if arg 2 is set:
  703. if {lobby.minigames.%arg 2%} is set:
  704. delete {lobby.minigames.%arg 2%}
  705. delete {lobby.minigames.%arg 2%.name}
  706. delete {lobby.minigames.%arg 2%.lore}
  707. delete {lobby.minigames.%arg 2%.item}
  708. delete {lobby.minigames.%arg 2%.slot}
  709. delete {lobby.minigames.%arg 2%.spawn}
  710. remove arg 2 from {lobby.minigames.list::*}
  711.  
  712. send "{@lobby} &2Succesfully removed the minigame &a%arg 2%&2!"
  713.  
  714. else:
  715. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  716. else:
  717. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  718.  
  719.  
  720. else if arg 1 is "setspawn":
  721. if arg 2 is set:
  722. if {lobby.minigames.%arg 2%} is set:
  723. set {lobby.minigames.%arg 2%.spawn} to location of player
  724. send "{@lobby} &2Succesfully set the spawn of the minigame%nl%&a%arg 2% &2arg &a%location of player%&2!"
  725.  
  726. else:
  727. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  728. else:
  729. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  730.  
  731. else if arg 1 is "slot":
  732. if arg 2 is set:
  733. if {lobby.minigames.%arg 2%} is set:
  734. if arg 3 is set:
  735. if (arg 3 parsed as a number) is set:
  736. if {lobby.compassRows} is not set:
  737. set {lobby.compassRows} to 1
  738.  
  739. if {lobby.compassRows} < 1:
  740. set {lobby.compassRows} to 1
  741.  
  742.  
  743. if {lobby.compassRows}*9-1 < arg-3 parsed as a number:
  744. send "{@lobby} &4The amount &c%arg 3% &4is to large bacause the max amount of slots is &c%{lobby.compassRows}*9+1%&4!"
  745.  
  746. else:
  747. loop {lobby.minigames.list::*}:
  748. if {lobby.minigames.%loop-value%.slot} is arg 3:
  749. set {_set} to loop-value
  750. stop loop
  751.  
  752. if {_set} is set:
  753. send "{@lobby} &4The slot &c%arg 3% &4is already in use by the minigame &c%{_set}%&4!"
  754. else:
  755. set {lobby.minigames.%arg 2%.slot} to arg 3
  756. send "{@lobby} &2Succesfully set the slot of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  757. else:
  758. send "{@lobby} &c%arg 3% &4is not a number!"
  759. else:
  760. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <number>&4."
  761. else:
  762. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  763. else:
  764. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <number>&4."
  765.  
  766.  
  767. else if arg 1 is "setname":
  768. if arg 2 is set:
  769. if {lobby.minigames.%arg 2%} is set:
  770. if arg 3 is set:
  771. set {lobby.minigames.%arg 2%.name} to arg 3
  772. send "{@lobby} &2Succesfully set the name of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  773.  
  774. else:
  775. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <name>&4."
  776. else:
  777. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  778. else:
  779. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  780.  
  781. else if arg 1 is "delname" or "deletename":
  782. if arg 2 is set:
  783. delete {lobby.minigames.%arg 2%.name}
  784. send "{@lobby} &2Succesfully deleted the name from the minigame &a%arg 2%&2!"
  785.  
  786. else:
  787. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  788.  
  789. else if arg 1 is "setlore":
  790. if arg 2 is set:
  791. if {lobby.minigames.%arg 2%} is set:
  792. if arg 3 is set:
  793. set {lobby.minigames.%arg 2%.lore} to arg 3
  794. send "{@lobby} &2Succesfully set the lore of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  795.  
  796. else:
  797. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <lore>&4."
  798. else:
  799. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  800. else:
  801. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <lore>&4."
  802.  
  803. else if arg 1 is "dellore" or "deletelore":
  804. if arg 2 is set:
  805. if {lobby.minigames.%arg 2%} is set:
  806. delete {lobby.minigames.%arg 2%.lore}
  807. send "{@lobby} &2Succesfully deleted the lore from the minigame &a%arg 2%&2!"
  808.  
  809. else:
  810. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  811. else:
  812. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  813.  
  814. else if arg 1 is "setitem":
  815. if arg 2 is set:
  816. if {lobby.minigames.%arg 2%} is set:
  817. if arg 3 is set:
  818. if (arg 3 parsed as an item) is set:
  819. set {lobby.minigames.%arg 2%.item} to arg 3 parsed as an item
  820. send "{@lobby} &2Succesfully set the item from the minigame &a%arg 2% &2to &a%arg 3%&2!"
  821.  
  822. else:
  823. send "{@lobby} &c%arg 3% &4is not an item!"
  824. else:
  825. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <item>&4."
  826. else:
  827. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  828. else:
  829. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <item>&4."
  830.  
  831.  
  832. else if arg 1 is "list":
  833. if {lobby.minigames.list::*} is not empty:
  834. loop {lobby.minigames.list::*}:
  835. if {_list} is set:
  836. set {_list} to "%{_list}%&2, &a%loop-value%"
  837. else:
  838. set {_list} to "%loop-value%"
  839.  
  840. else:
  841. set {_list} to "Geen"
  842.  
  843. send "{@lobby} &2This is the list of all the minigames:%nl%&a%{_list}%"
  844.  
  845.  
  846. else if arg 1 is "setrows":
  847. if arg 2 is set:
  848. if (arg 2 parsed as a number) is set:
  849. if (arg-2 parsed as a number) < 7:
  850. set {lobby.compassRows} to (arg-2 parsed as a number)
  851. send "{@lobby} &2Succesfully set the amount of rows to &a%arg 2%&2!"
  852.  
  853. else:
  854. send "{@lobby} &4The max amount of rows is &c6&4!"
  855. else:
  856. send "{@lobby} &c%arg 2% &4is not a number!"
  857. else:
  858. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <number>&4."
  859.  
  860.  
  861. else if arg 1 is "gui":
  862. if arg 2 is set:
  863. if {lobby.minigames.%arg 2%} is set:
  864. open chest with 2 rows named "&7Config GUI" to player
  865.  
  866. set {_name} to {lobby.minigames.%arg 2%.name}
  867. replace "&" in {_name} with "§"
  868.  
  869. set {_lore} to {lobby.minigames.%arg 2%.lore}
  870. replace "&" in {_lore} with "§"
  871.  
  872. format gui slot 2 of player with a book named "&2Minigame: &a%arg-2%" to do nothing
  873. 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)
  874. 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)
  875. 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)
  876. 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)
  877.  
  878. 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)
  879. format gui slot 13 of player with a barrier named "&cClose menu" to close
  880. 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)
  881.  
  882. else:
  883. send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  884. else:
  885. send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  886. else:
  887. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  888.  
  889. command /lobbycrate [<text>] [<text>]:
  890. aliases: /lobbycr, /lcrate
  891. trigger:
  892. if player is in world of {lobby.location}:
  893. if player has permission "votecrate.*":
  894. if arg-1 is set:
  895. if arg-1 is "help":
  896. send "&2----------[ &a%{cmd}% &2]----------"
  897. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  898. send "&e&o/%{cmd}% list &d→ &fGet a list with all crates"
  899. send "&e&o/%{cmd}% create <crate> &d→ &fCreate a create"
  900. send "&e&o/%{cmd}% delete/remove <crate> &d→ &fDelete a crate"
  901. send "&e&o/%{cmd}% path <crate> &d→ &fGet the edit path of a crate"
  902. send "&e&o/%{cmd}% get <crate> &d→ &fGet a crate"
  903.  
  904. send "&2----------[ &a%{cmd}% &2]----------"
  905.  
  906. else if arg-1 is "list":
  907. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  908. if {_list::*} is not empty:
  909. loop {_list::*}:
  910. if {_list} is set:
  911. set {_list} to "%{_list}%&2, &a%loop-value%"
  912. else:
  913. set {_list} to "%loop-value%"
  914.  
  915. send "{@lobby} &2There are the following crates:%nl%&a%{_list}%"
  916.  
  917. else:
  918. send "{@lobby} &2There are no crates made yet."
  919.  
  920.  
  921. else if arg-1 is "create":
  922. if arg-2 is set:
  923. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  924. set {_arg2} to "%arg-2 to lower case%"
  925. if contains({_list::*}, {_arg2}):
  926. send "{@lobby} &4The crate &c%{_arg2}% &4already exists!"
  927.  
  928.  
  929. else:
  930.  
  931. send "{@lobby} &2Making the crate &a%{_arg2}%&2..."
  932. add {_arg2} to yml list "Lobby.Crates.List" of file "{@config}"
  933. create file "{@path}/%{_arg2}%.yml"
  934. add "diamond_sword" to yml list "Item.List" of file "{@path}/%{_arg2}%.yml"
  935. add "diamond_sword-1" to yml list "Item.ConfigName" of file "{@path}/%{_arg2}%.yml"
  936.  
  937. set yml value "Item.Chance.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "100"
  938. set yml value "Item.Name.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "&aDiamond Sword"
  939. set yml value "Item.Amount.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to 1
  940.  
  941. add "This is a lore" to yml list "Item.Lore.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  942.  
  943. add "sharpness:1" to yml list "Item.Enchants.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  944.  
  945. send "{@lobby} &2Succesfully made the crate &a%{_arg2}%&2!"
  946.  
  947.  
  948. else:
  949. send "{@lobby} &4You need to give up a &cname &4for the crate!"
  950.  
  951. else if arg-1 is "delete" or "remove":
  952. if arg-2 is set:
  953. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  954. set {_arg2} to "%arg-2 to lower case%"
  955. if contains({_list::*}, {_arg2}):
  956. send "{@lobby} &2Deleting the crate &a%{_arg2}%&2..."
  957.  
  958. remove "%{_arg2}%" from yml list "Lobby.Crates.List" of file "{@config}"
  959. delete file "{@path}/%{_arg2}%.yml"
  960.  
  961. send "{@lobby} &2Succesfully deleted the crate &a%{_arg2}%&2!"
  962.  
  963. else:
  964. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  965.  
  966. else:
  967. send "{@lobby} &4You need to give up a &cname &4of the crate you want to delete!"
  968.  
  969. else if arg-1 is "path":
  970. if arg-2 is set:
  971. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  972. set {_arg2} to "%arg-2 to lower case%"
  973.  
  974. if contains({_list::*}, {_arg2}):
  975. send "{@lobby} &2Location of %{_arg2}%: &a{@path}/%{_arg2}%&2."
  976.  
  977.  
  978. else:
  979. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exists!"
  980. else:
  981. send "{@lobby} &4You need to give up a &cname &4of the crate you want to get the path of!"
  982.  
  983. else if arg-1 is "get":
  984. if arg 2 is set:
  985. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  986. set {_arg2} to "%arg-2 to lower case%"
  987. if contains({_list::*}, {_arg2}):
  988. send "{@lobby} &2Here you have the &a%{_arg2}% &2crate!%nl%&2Place it to create a chest."
  989. give player 1 chest named "&e%{_arg2}%" with lore "&7Place to create a crate!"
  990. else:
  991. send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  992. else:
  993. send "{@lobby} &4You must give up a crate type!"
  994.  
  995. else:
  996. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  997. else:
  998. send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  999.  
  1000.  
  1001. command /key [<text>] [<text>] [<text>] [<text>]:
  1002. trigger:
  1003. if player has permission "key.*":
  1004. if arg-1 is set:
  1005. if arg-1 is "help":
  1006. send "&2----------[ &a%{cmd}% &2]----------"
  1007. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  1008. send "&e&o/%{cmd}% get <crate/all> [number] &d→ &fGet a crate"
  1009. send "&e&o/%{cmd}% give <player> <crate/all> [number] &d→ &fGive a key to open a crate to a player"
  1010. send "&e&o/%{cmd}% remove <all/crate> [number] [player] &d→ &fRemove a key from a player"
  1011. send "&e&o/%{cmd}% clear <all/crate> [player] &d→ &fClear the keys from a player"
  1012. send "&e&o/%{cmd}% keys <all/crate> [player] &d→ &fGet the amount of keys from a player"
  1013. send "&2----------[ &a%{cmd}% &2]----------"
  1014.  
  1015. else if arg-1 is "get":
  1016. if arg-2 is "all":
  1017. if arg-3 is set:
  1018. if (arg-3 parsed as a number) is set:
  1019. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1020. set {_num} to arg-3 parsed as a number
  1021. loop {_num} times:
  1022. loop {_list::*}:
  1023. add 1 to {keys.%player%.%loop-value-2%}
  1024.  
  1025. send "{@lobby} &2You have recieved all the &a%arg-3% &2times!"
  1026.  
  1027. else:
  1028. send "{@lobby} &c%arg-3% &4is not a number!"
  1029. else:
  1030. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1031. loop {_list::*}:
  1032. add 1 to {keys.%player%.%loop-value%}
  1033.  
  1034. send "{@lobby} &2You have recieved all keys!"
  1035.  
  1036. else if arg-2 is set:
  1037. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1038. if contains({_list::*}, "%arg-2 to lower case%"):
  1039. if arg-3 is set:
  1040. if (arg-3 parsed as a number) is set:
  1041. add (arg-3 parsed as a number) to {keys.%player%.%arg-2 to lower case%}
  1042. send "{@lobby} &2You have recieved &a%arg-2 to lower case% &2key &a%arg-3% &2times!"
  1043. else:
  1044. send "{@lobby} &c%arg-3% &4is not a number!"
  1045. else:
  1046. add 1 to {keys.%player%.%arg-2 to lower case%}
  1047.  
  1048. send "{@lobby} &2You have recieved a &a%arg-2 to lower case% &2key!"
  1049. else:
  1050. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  1051. else:
  1052. send "{@lobby} &4You must give up a &ccrate&4!"
  1053.  
  1054. else if arg-1 is "give":
  1055. if arg-2 is set:
  1056. if (arg-2 parsed as a player) is set:
  1057. if arg-3 is set:
  1058. if arg-3 is "all":
  1059. if arg-4 is set:
  1060. if (arg-4 parsed as a number) is set:
  1061. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1062. set {_num} to arg-4 parsed as a number
  1063. loop {_num} times:
  1064. loop {_list::*}:
  1065. add 1 to {keys.%arg-2 parsed as a player%.%loop-value-2%}
  1066.  
  1067. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys &a%arg-4% &2times!"
  1068. send "{@lobby} &2You have recieved all the keys &a%arg-4% &2times!" to arg-2 parsed as a player
  1069.  
  1070. else:
  1071. send "{@lobby} &c%arg-3% &4is not a number!"
  1072. else:
  1073. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1074. loop {_list::*}:
  1075. add 1 to {keys.%arg-2 parsed as a player%.%loop-value%}
  1076.  
  1077. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys!"
  1078. send "{@lobby} &2You have recieved all the keys!" to arg-2 parsed as a player
  1079. else:
  1080. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1081. if contains({_list::*}, "%arg-3 to lower case%"):
  1082. if arg-4 is set:
  1083. if (arg-4 parsed as a number) is set:
  1084.  
  1085. add (arg-4 parsed as a number) to {keys.%arg-2%.%arg-3 to lower case%}
  1086.  
  1087. 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!"
  1088. send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key &a%arg-4% &2times!" to arg-2 parsed as a player
  1089.  
  1090. else:
  1091. send "{@lobby} &c%arg-3% &4is not a number!"
  1092. else:
  1093. add 1 to {keys.%arg-2 parsed as a player%.%arg-3 to lower case%}
  1094.  
  1095. send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2the &a%arg-3 to lower case% &2key!"
  1096. send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key!" to arg-2 parsed as a player
  1097. else:
  1098. send "{@lobby} &4The crate &c%arg-3 to lower case% &4doesn't exist!"
  1099. else:
  1100. send "{@lobby} &4You must give up a &ccrate&4!"
  1101. else:
  1102. send "{@lobby} &4The player &c%arg-2% &4is not online!"
  1103. else:
  1104. send "{@lobby} &4You must give up a &cplayer&4!"
  1105.  
  1106.  
  1107.  
  1108. else if arg-1 is "remove":
  1109. if arg-2 is set:
  1110. if arg-2 is "all":
  1111. if arg-3 is set:
  1112. if (arg-3 parsed as a number) is set:
  1113. if arg-4 is set:
  1114. if (arg-4 parsed as a player) is set:
  1115. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1116. set {_num} to arg-3 parsed as a number
  1117. loop {_list::*}:
  1118. if {keys.%arg-4 parsed as a player%.%loop-value%}-{_num} >= 0:
  1119. remove {_num} from {keys.%name of arg-4 parsed as a player%.%loop-value%}
  1120. else:
  1121. set {keys.%arg-4 parsed as a player%.%loop-value%} to 0
  1122.  
  1123. send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys of &a%name of arg-4 parsed as a player%&2!"
  1124. send "{@lobby} &2Removed &a%arg-3% &2from your keys!" to arg-4 parsed as a player
  1125.  
  1126. else:
  1127. send "{@lobby} &4The player &c%arg-4% &4is not online!"
  1128. else:
  1129. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1130. loop {_list::*}:
  1131. if {keys.%player%.%loop-value%}-(arg-3 parsed as a number) >= 0:
  1132. remove (arg-3 parsed as a number) from {keys.%player%.%loop-value%}
  1133. else:
  1134. set {keys.%player%.%loop-value%} to 0
  1135.  
  1136. send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys!"
  1137.  
  1138. else:
  1139. send "{@lobby} &c%arg-3% &4is not a number!"
  1140. else:
  1141. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1142. loop {_list::*}:
  1143. if {keys.%player%.%loop-value%}-1 >= 0:
  1144. remove 1 from {keys.%player%.%loop-value%}
  1145.  
  1146. send "{@lobby} &2Succesfully removed &a1 &2from all the keys"
  1147. else:
  1148. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1149. if contains({_list::*}, "%arg-2 to lower case%"):
  1150. if arg-3 is set:
  1151. if (arg-3 parsed as a number) is set:
  1152. if arg-4 is set:
  1153. if (arg-4 parsed as a player) is set:
  1154. if {keys.%arg-4 parsed as a player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
  1155. remove (arg-3 parsed as a number) from {keys.%name of arg-4 parsed as a player%.%arg-2 to lower case%}
  1156. else:
  1157. set {keys.%arg-4 parsed as a player%.%arg-2 to lower case%} to 0
  1158.  
  1159. send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys from &a%name of arg-4 parsed as a player%&2!"
  1160. send "{@lobby} &a%arg-3% %arg-2 to lower case% &2keys have been removed!" to arg-4 parsed as a player
  1161.  
  1162. else:
  1163. send "{@lobby} &4The player &c%arg-4% &4is not online!"
  1164. else:
  1165.  
  1166. if {keys.%player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
  1167. remove (arg-3 parsed as a number) from {keys.%player%.%arg-2 to lower case%}
  1168. send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys!"
  1169.  
  1170. else:
  1171. send "{@lobby} &c%arg-3% &4is not a number!"
  1172.  
  1173. else:
  1174. if {keys.%player%.%arg-2 to lower case%}-1 >= 0:
  1175. remove 1 from {keys.%player%.%arg-2 to lower case%}
  1176. send "{@lobby} &2Succesfully removed &a1 %arg-2 to lower case% &2keys!"
  1177. else:
  1178. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  1179. else:
  1180. send "{@lobby} &4You must give up a &ccrate&4!"
  1181.  
  1182. else if arg-1 is "clear":
  1183. if arg-2 is set:
  1184. if arg-2 is "all":
  1185. if arg-3 is set:
  1186. if (arg-3 parsed as a player) is set:
  1187. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1188. loop {_list::*}:
  1189. set {keys.%arg-3 parsed as a player%.%loop-value%} to 0
  1190.  
  1191. send "{@lobby} &2Succesfully cleared &aall keys &2of &a%name of arg-3 parsed as a player%&2!"
  1192. send "{@lobby} &aAll &2your &akeys &2have been cleared!" to arg-3 parsed as a player
  1193. else:
  1194. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1195. else:
  1196. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1197. loop {_list::*}:
  1198. set {keys.%player%.%loop-value%} to 0
  1199.  
  1200. send "{@lobby} &2You have cleared &aall &2your &akeys&2!"
  1201. else:
  1202. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1203. if contains({_list::*}, "%arg-2 to lower case%"):
  1204. if arg-3 is set:
  1205. if (arg-3 parsed as a player) is set:
  1206. set {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} to 0
  1207. send "{@lobby} &2You have cleared the &a%arg-2 to lower case% keys &2from &a%name of arg-3 parsed as a player%&2!"
  1208. send "{@lobby} &2Your &a%arg-2 to lower case% keys &2have been cleared!" to arg-3 parsed as a player
  1209.  
  1210. else:
  1211. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1212.  
  1213. else:
  1214. set {keys.%player%.%arg-2 to lower case%} to 0
  1215. send "{@lobby} &2Succesfully cleared the &a%arg-2 to lower case% keys&2!"
  1216.  
  1217. else:
  1218. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
  1219. else:
  1220. send "{@lobby} &4You must give up a &ccrate&4!"
  1221.  
  1222. else if arg-1 is "keys":
  1223. if arg-2 is set:
  1224. if arg-2 is "all":
  1225. if arg-3 is set:
  1226. if (arg-3 parsed as a player) is set:
  1227. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1228. loop {_list::*}:
  1229. if {keys.%arg-3 parsed as a player%.%loop-value%} is not set:
  1230. set {keys.%arg-3 parsed as a player%.%loop-value%} to 0
  1231.  
  1232. if {_keys} is not set:
  1233. set {_keys} to "&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
  1234. else:
  1235. set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
  1236.  
  1237. send "{@lobby} &2This is the list of keys from &a%name of arg-3 parsed as a player%&2:%nl%%{_keys}%"
  1238.  
  1239. else:
  1240. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1241. else:
  1242. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1243. loop {_list::*}:
  1244. if {keys.%player%.%loop-value%} is not set:
  1245. set {keys.%player%.%loop-value%} to 0
  1246. if {_keys} is not set:
  1247. set {_keys} to "&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
  1248. else:
  1249. set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
  1250.  
  1251. send "{@lobby} &2This is your list of keys&2:%nl%%{_keys}%"
  1252. else:
  1253. set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1254. if contains({_list::*}, "%arg-2 to lower case%"):
  1255. if arg-3 is set:
  1256. if (arg-3 parsed as a player) is set:
  1257. if {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} is not set:
  1258. set {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} to 0
  1259.  
  1260. 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."
  1261.  
  1262. else:
  1263. send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1264. else:
  1265. if {keys.%player%.%arg-2 to lower case%} is not set:
  1266. set {keys.%player%.%arg-2 to lower case%} to 0
  1267.  
  1268. send "{@lobby} &2You have &a%{keys.%player%.%arg-2 to lower case%}% %arg-2 to lower case% &2keys."
  1269. else:
  1270. send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
  1271. else:
  1272. send "{@lobby} &4You need to give up a &ccrate&4!"
  1273. else:
  1274. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  1275. else:
  1276. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  1277.  
  1278.  
  1279. command /cosmetics [<text>] [<text>] [<text>]:
  1280. aliases: /cos
  1281. trigger:
  1282. if player has permission "cosmetics.*":
  1283. if arg-1 is not set:
  1284. send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  1285.  
  1286. else if arg-1 is "help":
  1287. send "&2----------[ &a%{cmd}% &2]----------"
  1288. send "&e&o/%{cmd}% help &d→ &fGet the help page"
  1289. send "&e&o/%{cmd}% gui [player] &d→ &fGet the cosmetics (of a player)"
  1290. send "&e&o/%{cmd}% setup <type> &d→ &fCreate a cosmetic"
  1291. send "&e&o/%{cmd}% edit [type] &d→ &fEdit a cosmetic"
  1292. #send "&e&o/%{cmd}% delete [type] [name] &d→ &fDelete a cosmetic"
  1293. send "&e&o/%{cmd}% path &d→ &fCreate your own cosmetics"
  1294. send "&2----------[ &a%{cmd}% &2]----------"
  1295.  
  1296. #else if arg-1 is "gui":
  1297. # if arg-2 is set:
  1298. # if arg-2 parsed as a player is set:
  1299. #
  1300.  
  1301. # else:
  1302. # send "{@lobby} &4The player &c%arg-2% &4has never logged in."
  1303.  
  1304. # else:
  1305.  
  1306. else if arg-1 is "setup":
  1307. if arg-2 is set:
  1308. editCos(player, "%arg-2%")
  1309. #open chest with 1 rows named "&8Cosmetics %arg-2%" to player
  1310. #format gui slot 2 of player with nether star named "&fCreate" to close
  1311. #format gui slot 4 of player with redstone torch on named "&fEdit" to close
  1312. #format gui slot 6 of player with blaze powder named "&fDelete" to close
  1313.  
  1314. else:
  1315. editCos(player, "")
  1316. #open chest with 1 rows named "&8Edit Cosmetics" to player
  1317. #format gui slot 2 of player with nether star named "&fCreate" to close
  1318. #format gui slot 4 of player with redstone torch on named "&fEdit" to close
  1319. #format gui slot 6 of player with blaze powder named "&fDelete" to close
  1320.  
  1321. else if arg-1 is "path":
  1322. send "{@lobby} The path to edit your cosmetics is %nl%&a{@cosConfig} &2and to create cosmetics %nl%&a{@path}/Cosmetics/"
Add Comment
Please, Sign In to add comment