Zeldaboy111

Skript #270 ]|[ Cosmetics (4)

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