SHARE
TWEET

Skript #272 ]|[ Cosmetics (6)

Zeldaboy111 Dec 16th, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. function editCosFormat(p: Player, piece: String, pieceText: String) :: item:
  292.     set {_item} to ("barrier" parsed as an item)
  293.  
  294.     if {cosmetics.edit.%{_p}%.%{_piece}%} is set:
  295.        
  296.         set {_headType} to "%{cosmetics.edit.%{_p}%.%{_piece}%}%"
  297.        
  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.         else if contains(({_headType} split at " "), "head"):
  302.             set {_item} to head
  303.            
  304.         if {cosmetics.edit.%{_p}%.%{_piece}%.name} is set:
  305.             set name of {_item} to "%{cosmetics.edit.%{_p}%.%{_piece}%.name}%"
  306.         else:
  307.             set name of {_item} to "&2%{_pieceText}%"
  308.  
  309.         if {cosmetics.edit.%{_p}%.%{_piece}%.lore} is set:
  310.             set lore of {_item} to {cosmetics.edit.%{_p}%.%{_piece}%.lore}
  311.    
  312.     else:
  313.         set name of {_item} to "&4%{_pieceText}%"
  314.  
  315.     return {_item}
  316.  
  317. function setSkullType(p: Player):
  318.     wait 2 tick
  319.     open chest with 3 rows named "&8Choose Type" to {_p}
  320.  
  321.     if {cosmetics.edit.%{_p}%.helmet.type} is "Player":
  322.         set {_player} to skull of ("MHF_Steve" parsed as an offline player) named "&2Player"
  323.         set {_mob} to skull of ("MHF_CaveSpider" parsed as an offline player) named "&4Mob"
  324.        
  325.     else if {cosmetics.edit.%{_p}%.helmet.type} is "Mob":
  326.         set {_player} to skull of ("MHF_Steve" parsed as an offline player) named "&4Player"
  327.         set {_mob} to skull of ("MHF_CaveSpider" parsed as an offline player) named "&2Mob"
  328.  
  329.     else:
  330.         set {_player} to skull of ("MHF_Steve" parsed as an offline player) named "&4Player"
  331.         set {_mob} to skull of ("MHF_CaveSpider" parsed as an offline player) named "&4Mob"
  332.  
  333.  
  334.     format gui slot 12 of {_p} with {_player} to run:
  335.         set {cosmetics.edit.%{_p}%} to "go_back"
  336.         close {_p}'s inventory
  337.         delete {cosmetics.edit.%{_p}%}
  338.         set {cosmetics.edit.%{_p}%.helmet.type} to "Player"
  339.         editPiece({_p}, "helmet", "Helmet", {cosmetics.edit.%{_p}%.type})
  340.  
  341.     format gui slot 14 of {_p} with {_mob} to run:
  342.         set {cosmetics.edit.%{_p}%} to "go_back"
  343.         close {_p}'s inventory
  344.         delete {cosmetics.edit.%{_p}%}
  345.         set {cosmetics.edit.%{_p}%.helmet.type} to "Mob"
  346.         editPiece({_p}, "helmet", "Helmet", {cosmetics.edit.%{_p}%.type})
  347.  
  348.  
  349.  
  350.     format gui slot 18 of {_p} with arrow named "&c<< Go Back" to run:
  351.         set {cosmetics.edit.%{_p}%} to "go_back"
  352.         close {_p}'s inventory
  353.         delete {cosmetics.edit.%{_p}%}
  354.         editPiece({_p}, "helmet", "Helmet", {cosmetics.edit.%{_p}%.type})
  355.  
  356. function setSkullOwnerMob(p: Player, page: Integer):
  357.     wait 1 tick
  358.     open chest with 3 rows named "&8Edit SkullOwner" to {_p}
  359.  
  360.  
  361.     #Page > 1 = Page Back
  362.     #Page < 3 = Next Page
  363.    
  364.     if {_page} is 1:
  365.         format gui slot 26 of {_p} with an arrow named "&cNext Page >>" to run:
  366.             set {cosmetics.edit.%{_p}%} to "go_back"
  367.             close {_p}'s inventory
  368.             delete {cosmetics.edit.%{_p}%}
  369.             setSkullOwnerMob({_p}, 2)
  370.    
  371.     else if {_page} is 2:
  372.         format gui slot 18 of {_p} with an arrow named "&c<< Page Back" to run:
  373.             set {cosmetics.edit.%{_p}%} to "go_back"
  374.             close {_p}'s inventory
  375.             delete {cosmetics.edit.%{_p}%}
  376.             setSkullOwnerMob({_p}, 1)
  377.  
  378.         format gui slot 26 of {_p} with an arrow named "&cNext Page >>" to run:
  379.             set {cosmetics.edit.%{_p}%} to "go_back"
  380.             close {_p}'s inventory
  381.             delete {cosmetics.edit.%{_p}%}
  382.             setSkullOwnerMob({_p}, 3)
  383.  
  384.     else if {_page} is 3:
  385.         format gui slot 18 of {_p} with an arrow named "&c<< Page Back" to run:
  386.             set {cosmetics.edit.%{_p}%} to "go_back"
  387.             close {_p}'s inventory
  388.             delete {cosmetics.edit.%{_p}%}
  389.             setSkullOwnerMob({_p}, 2)
  390.  
  391.     format gui slot 22 of {_p} with a barrier named "&4Go Back" to run:
  392.         set {cosmetics.edit.%{_p}%} to "go_back"
  393.         close {_p}'s inventory
  394.         delete {cosmetics.edit.%{_p}%}
  395.         editPiece({_p}, "helmet", "Helmet", {cosmetics.edit.%{_p}%.type})
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402. function editCos(p: Player, type: String):
  403.     wait 2 tick
  404.     set {cosmetics.edit.%{_p}%.type} to {_type}
  405.     open chest with 1 rows named "&8Choose Category" to {_p}
  406.    
  407.     set {_count} to 0
  408.     if {@particles} is true:
  409.         format gui slot {_count} of {_p} with redstone named "&cParticle" to do nothing
  410.         add 1 to {_count}
  411.  
  412.     if {@heads} is true:
  413.         format gui slot {_count} of {_p} with skull of {_p} named "&2Heads" to do nothing
  414.         add 1 to {_count}
  415.    
  416.     if {@suits} is true:
  417.         format gui slot {_count} of {_p} with golden helmet named "&5Suits" to close then run function editSuit({_p}, {_type})
  418.         add 1 to {_count}
  419.  
  420.     if {@gadgets} is true:
  421.         format gui slot {_count} of {_p} with fire charge named "&bGadgets" to do nothing
  422.         add 1 to {_count}
  423.    
  424.     if {_count} is 0:
  425.         format gui slot 0 of {_p} with barrier named "&4None Enabled" to close
  426.  
  427. function editSuit(p: Player, type: String):
  428.     #=========== Variables ===========
  429.     set {cosmetics.edit.%{_p}%.type} to {_type}
  430.    
  431.     if {cosmetics.edit.%{_p}%.crate} is not set:
  432.         set {cosmetics.edit.%{_p}%.crate} to ""
  433.  
  434.     if {cosmetics.edit.%{_p}%.helmet} is not set:
  435.         set {_helmet} to editCosFormat({_p}, "helmet", "Helmet")
  436.  
  437.     else:
  438.         set {_helmet} to {cosmetics.edit.%{_p}%.helmet}
  439.  
  440.     if {cosmetics.edit.%{_p}%.chestplate} is not set:
  441.         set {_chestplate} to editCosFormat({_p}, "chestplate", "Chestplate")
  442.  
  443.     else:
  444.         set {_chestplate} to {cosmetics.edit.%{_p}%.chestplate}
  445.  
  446.     if {cosmetics.edit.%{_p}%.leggings} is not set:
  447.         set {_leggings} to editCosFormat({_p}, "leggings", "Leggings")
  448.  
  449.     else:
  450.         set {_leggings} to {cosmetics.edit.%{_p}%.leggings}
  451.  
  452.     if {cosmetics.edit.%{_p}%.boots} is not set:
  453.         set {_boots} to editCosFormat({_p}, "boots", "Boots")
  454.  
  455.     else:
  456.         set {_boots} to {cosmetics.edit.%{_p}%.boots}
  457.  
  458.  
  459.     set {_save} to true
  460.     if {cosmetics.edit.%{_p}%.type} or {cosmetics.edit.%{_p}%.crate} is "":
  461.         set {_save} to false
  462.  
  463.     else if {_helmet} and {_chestplate} and {_leggings} and {_boots} is barrier:
  464.         set {_save} to false
  465.  
  466.     #=========== GUI ===========
  467.     #Item doesn't show the proper name
  468.  
  469.     open chest with 6 rows named "&8Edit" to {_p}
  470.    
  471.     if {cosmetics.edit.%{_p}%.type} is "":
  472.         format gui slot 22 of {_p} with a paper named "&7Type: &c<none>" to run:
  473.             set {cosmetics.edit.%{_p}%} to "setType"
  474.             close {_p}'s inventory
  475.             send "{@lobby} Type the new type of your set in the chat" to {_p}
  476.    
  477.     else:
  478.         format gui slot 22 of {_p} with a paper named "&7Type: &e%{cosmetics.edit.%{_p}%.type}%" to run:
  479.             close {_p}'s inventory
  480.             set {cosmetics.edit.%{_p}%} to "setType"
  481.             send "{@lobby} Type the new type of your set in the chat" to {_p}
  482.  
  483.     if {cosmetics.edit.%{_p}%.crate} is "":
  484.         format gui slot 31 of {_p} with a chest named "&7Crate: &c<none>" to run:
  485.             set {cosmetics.edit.%{_p}%} to "setCrate"
  486.             close {_p}'s inventory
  487.             send "{@lobby} Type the new crate of your set in the chat" to {_p}
  488.     else:
  489.         format gui slot 31 of {_p} with a chest named "&7Crate: &e%{cosmetics.edit.%{_p}%.crate}%" to run:
  490.             set {cosmetics.edit.%{_p}%} to "setCrate"
  491.             close {_p}'s inventory
  492.             send "{@lobby} Type the new crate of your set in the chat" to {_p}
  493.  
  494.    
  495.    
  496.     format gui slot 10 of {_p} with {_helmet} to run:
  497.         set {cosmetics.edit.%{_p}%} to "helmet"
  498.         close {_p}'s inventory
  499.         delete {cosmetics.edit.%{_p}%}
  500.         editPiece({_p}, "helmet", "Helmet", {cosmetics.edit.%{_p}%.type})
  501.  
  502.     format gui slot 19 of {_p} with {_chestplate} to run:
  503.         set {cosmetics.edit.%{_p}%} to "chestplate"
  504.         close {_p}'s inventory
  505.         delete {cosmetics.edit.%{_p}%}
  506.         editPiece({_p}, "chestplate", "Chestplate", {cosmetics.edit.%{_p}%.type})
  507.  
  508.     format gui slot 28 of {_p} with {_leggings} to run:
  509.         set {cosmetics.edit.%{_p}%} to "leggings"
  510.         close {_p}'s inventory
  511.         delete {cosmetics.edit.%{_p}%}
  512.         editPiece({_p}, "leggings", "Leggings", {cosmetics.edit.%{_p}%.type})
  513.  
  514.  
  515.     format gui slot 37 of {_p} with {_boots} to run:
  516.         set {cosmetics.edit.%{_p}%} to "boots"
  517.         close {_p}'s inventory
  518.         delete {cosmetics.edit.%{_p}%}
  519.         editPiece({_p}, "boots", "Boots", {cosmetics.edit.%{_p}%.type})
  520.  
  521.     if {_save}:
  522.         format gui slot 53 of {_p} with green wool named "&2Save" to run:
  523.             close {_p}'s inventory
  524.             #Save function
  525.  
  526.     else:
  527.         format gui slot 53 of {_p} with red wool named "&4Save not possible" to do nothing
  528.  
  529.  
  530.  
  531. function editPiece(p: Player, piece: String, pieceText: String, type: String):
  532.     wait 2 tick
  533.    
  534.     #=========== Variables ===========
  535.     set {cosmetics.edit.%{_p}%.current} to "%{_piece}%"
  536.     set {cosmetics.edit.%{_p}%.pieceText} to "%{_pieceText}%"
  537.     set {_displayItem} to editCosFormat({_p}, "%{_piece}%", "%{_pieceText}%")
  538.    
  539.     if {cosmetics.edit.%{_p}%.%{_piece}%} is not set:
  540.         set {cosmetics.edit.%{_p}%.%{_piece}%} to ""
  541.  
  542.     if {cosmetics.edit.%{_p}%.%{_piece}%} is "":
  543.         set {_item} to an item frame named "&7Item: &c<none>"
  544.        
  545.     else:
  546.         set {_item} to an item frame named "&7Item: &2%{cosmetics.edit.%{_p}%.%{_piece}%}%"
  547.  
  548.     if {cosmetics.edit.%{_p}%.%{_piece}%.name} is not set:
  549.         set {cosmetics.edit.%{_p}%.%{_piece}%.displayName} to ""
  550.  
  551.     if {cosmetics.edit.%{_p}%.%{_piece}%.name} is "":
  552.         set {cosmetics.edit.%{_p}%.%{_piece}%.displayName} to ""
  553.  
  554.     if {cosmetics.edit.%{_p}%.%{_piece}%.displayName} is "":
  555.         if {_displayItem} is barrier:
  556.             set {_itemName} to "&4%{_pieceText}%"
  557.  
  558.         else:
  559.             set {_itemName} to "&2%{_pieceText}%"
  560.  
  561.     else:
  562.         set {_itemName} to {cosmetics.edit.%{_p}%.%{_piece}%.name}
  563.        
  564.     set name of {_displayItem} to {_itemName}
  565.  
  566.     set {cosmetics.edit.%{_p}%.%{_piece}%} to {_displayItem}
  567.    
  568.     #=========== GUI ===========
  569.     open chest with 3 rows named "&8Edit %{_pieceText}%" to {_p}
  570.    
  571.     #Display from your created item
  572.     format gui slot 10 of {_p} with {_displayItem} to do nothing
  573.     #item, name, enchantment and lore (lore || -> new line (also in message!!!))
  574.    
  575.     if {_piece} is "helmet":
  576.         set {_string} to "%{cosmetics.edit.%{_p}%.helmet}%"
  577.         set {_split::*} to {_string} split at " "
  578.  
  579.         if contains({_split::*}, "head"):
  580.             if {cosmetics.edit.%{_p}%.helmet.type} is set:
  581.                 set {_changeType} to a redstone torch on named "&7Skull Type: &e%{cosmetics.edit.%{_p}%.helmet.type}%"
  582.  
  583.             else:
  584.                 set {_changeType} to a redstone torch on named "&7Skull Type: &c<none>"
  585.  
  586.             if {cosmetics.edit.%{_p}%.helmet.type} is "Player" or "Mob":
  587.                 if {cosmetics.edit.%{_p}%.helmet.player} is set:
  588.                     set {cosmetics.edit.%{_p}%.helmet.skull} to skull of ("%{cosmetics.edit.%{_p}%.helmet.player}%" parsed as an offline player) named "&7Skull Owner: &e%{cosmetics.edit.%{_p}%.helmet.player}%"
  589.                    
  590.                 else:
  591.                     set {cosmetics.edit.%{_p}%.helmet.skull} to skull of ("MHF_Steve" parsed as an offline player) named "&7Skull Owner: &c<none>"
  592.  
  593.             format gui slot 1 of {_p} with {_changeType} to run:
  594.                 set {cosmetics.edit.%{_p}%} to "go_back"
  595.                 close {_p}'s inventory
  596.                 delete {cosmetics.edit.%{_p}%}
  597.                 setSkullType({_p})
  598.  
  599.             format gui slot 19 of {_p} with {cosmetics.edit.%{_p}%.helmet.skull} to run:
  600.                 if {cosmetics.edit.%{_p}%.helmet.type} is "Player":
  601.                     send "Player" to {_p}
  602.                     set {cosmetics.edit.%{_p}%} to "setSkullOwner"
  603.                     close {_p}'s inventory
  604.                     #Via message naam van de speler typen
  605.  
  606.                 else if {cosmetics.edit.%{_p}%.helmet.type} is "Mob":
  607.                     set {cosmetics.edit.%{_p}%} to "go_back"
  608.                     close {_p}'s inventory
  609.                     delete {cosmetics.edit.%{_p}%}
  610.                     setSkullOwnerMob({_p}, 1)
  611.  
  612.  
  613.  
  614.     format gui slot 18 of {_p} with arrow named "&c<< Go Back" to run:
  615.         set {cosmetics.edit.%{_p}%} to "go_back"
  616.         close {_p}'s inventory
  617.         delete {cosmetics.edit.%{_p}%}
  618.         editSuit({_p}, {_type})
  619.    
  620.  
  621.     format gui slot 12 of {_p} with {_item} to run:
  622.         set {cosmetics.edit.%{_p}%} to "set%{_pieceText}%Item"
  623.         close {_p}'s inventory
  624.         send "{@lobby} Type the new crate of the %{_piece}% in the chat" to {_p}
  625.  
  626.  
  627.  
  628.  
  629.  
  630. #------------------- Periotic Events -------------------
  631.  
  632.  
  633.  
  634.  
  635.  
  636. #------------------- Events -------------------
  637. on enable:
  638.     if file "{@config}" doesn't exist:
  639.         create file "{@config}"
  640.  
  641.         set yml value "Lobby.Crates.Animations.Window1" of file "Files/Lobby/config.yml" to true
  642.         set yml value "Lobby.Crates.Animations.Random.Enabled" of file "Files/Lobby/config.yml" to true
  643.         set yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "Files/Lobby/config.yml" to "Window1"
  644.         set yml value "Lobby.Crates.Particles.Enabled" of file "Files/Lobby/config.yml" to true
  645.         set yml value "Lobby.Crates.Heads.Enabled" of file "Files/Lobby/config.yml" to true
  646.         set yml value "Lobby.Crates.Suits.Enabled" of file "Files/Lobby/config.yml" to true
  647.         set yml value "Lobby.Crates.Gadgets.Enabled" of file "Files/Lobby/config.yml" to true
  648.  
  649.     else:
  650.         if yml value "Lobby.Crates.Animations.Window1" of file "Files/Lobby/config.yml" is not set:
  651.             set yml value "Lobby.Crates.Animations.Window1" of file "Files/Lobby/config.yml" to true
  652.         if yml value "Lobby.Crates.Animations.Random.Enabled" of file "Files/Lobby/config.yml" is not set:
  653.             set yml value "Lobby.Crates.Animations.Random.Enabled" of file "Files/Lobby/config.yml" to true
  654.         if yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "Files/Lobby/config.yml" is not set:
  655.             set yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "Files/Lobby/config.yml" to "Window1"
  656.        
  657.         if yml value "Lobby.Crates.Particles.Enabled" of file "Files/Lobby/config.yml" is not set:
  658.             set yml value "Lobby.Crates.Particles.Enabled" of file "Files/Lobby/config.yml" to true
  659.         if yml value "Lobby.Crates.Heads.Enabled" of file "Files/Lobby/config.yml" is not set:
  660.             set yml value "Lobby.Crates.Heads.Enabled" of file "Files/Lobby/config.yml" to true
  661.         if yml value "Lobby.Crates.Suits.Enabled" of file "Files/Lobby/config.yml" is not set:
  662.             set yml value "Lobby.Crates.Suits.Enabled" of file "Files/Lobby/config.yml" to true
  663.         if yml value "Lobby.Crates.Gadgets.Enabled" of file "Files/Lobby/config.yml" is not set:
  664.             set yml value "Lobby.Crates.Gadgets.Enabled" of file "Files/Lobby/config.yml" to true
  665.  
  666.  
  667.     set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  668.    
  669.     loop {_list::*}:
  670.         set {_world} to world of {lobby.location}
  671.         loop {lobbycr.%loop-value%.location::*}:
  672.             set {holo-crate-%{_world}%-%loop-value-2%} to a new hologram at block above loop-value-2
  673.             add text "&a&l%loop-value-1%" to hologram {holo-crate-%{_world}%-%loop-value-2%}
  674.            
  675. on disable:
  676.     set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  677.     set {_world} to world of {lobby.location}
  678.  
  679.     loop {_list::*}:
  680.         delete yml list "Locations" of file "{@path}/%loop-value%.yml"
  681.         loop {lobbycr.%loop-value%.location::*}:
  682.             add "%loop-value-2%" to yml list "Locations" of file "{@path}/%loop-value-1%.yml"
  683.             unregister hologram {holo-crate-%{_world}%-%loop-value-2%}
  684.  
  685.     loop {crates.openinglist::*}:
  686.         clear {crates.opening.%loop-value%}
  687.         clear {crates.%loop-value%.inv::*}
  688.         clear {crates.%loop-value%.name}
  689.         clear {crate.closed.%loop-value%}
  690.  
  691.     clear {crates.openinglist::*}
  692.  
  693. on join:
  694.     if {lobby.location} is set:
  695.         teleport player to {lobby.location}
  696.     set join message to ""
  697.     wait 10 ticks
  698.    
  699.     clear player's inventory
  700.     send "{@lobby} &fThe player %player% has joined!" to all players in world of player
  701.     set slot 4 of player to a compass named "{@lcompass}"
  702.  
  703. on quit:
  704.     if {crates.opening.%player%} is set:
  705.         clear {crates.opening.%player%}
  706.         clear {crates.%player%.inv::*}
  707.         clear {crates.%player%.name}
  708.         clear {crates.closed.%player%}
  709.         remove player from {crates.openinglist::*}
  710.  
  711.     delete {cosmetics.edit.%player%.helmet}
  712.     delete {cosmetics.edit.%player%.chestplate}
  713.     delete {cosmetics.edit.%player%.leggings}
  714.     delete {cosmetics.edit.%player%.boots}
  715.  
  716.     delete {cosmetics.edit.%player%.type}
  717.     delete {cosmetics.edit.%player%.current}
  718.     delete {cosmetics.edit.%player%.crate}
  719.     delete {cosmetics.edit.%player%.pieceText}
  720.     delete {cosmetics.edit.%player%.helmet.name}
  721.     delete {cosmetics.edit.%player%.helmet.lore::*}
  722.     delete {cosmetics.edit.%player%.helmet.ench::*}
  723.     delete {cosmetics.edit.%player%.chestplate.name}
  724.     delete {cosmetics.edit.%player%.chestplate.lore::*}
  725.     delete {cosmetics.edit.%player%.chestplate.ench::*}
  726.     delete {cosmetics.edit.%player%.leggings.name}
  727.     delete {cosmetics.edit.%player%.leggings.lore::*}
  728.     delete {cosmetics.edit.%player%.leggings.ench::*}
  729.     delete {cosmetics.edit.%player%.boots.name}
  730.     delete {cosmetics.edit.%player%.boots.lore::*}
  731.     delete {cosmetics.edit.%player%.boots.ench::*}
  732.     delete {cosmetics.edit.%player%.helmet.helmet.type}
  733.     delete {cosmetics.edit.%player%.helmet.player}
  734.     delete {cosmetics.edit.%player%.helmet.type}
  735.     delete {cosmetics.edit.%player%.helmet.skull}
  736.  
  737.  
  738. on command:
  739.     command is "plugins" or "pl":
  740.         cancel event
  741.  
  742.         if player is not op:
  743.             stop
  744.  
  745.         else:
  746.             set {_list::*} to list of plugins
  747.             set {_count} to 0
  748.             loop {_list::*}:
  749.                 add 1 to {_count}
  750.             send "{@logo} Plugin list:%nl%&f(&a%{_count}%&f) &2%list of plugins%"
  751.  
  752.     else:
  753.         set {cmd} to "%command to lower case%"
  754.  
  755. on damage:
  756.     if world of victim is world of {lobby.location}:
  757.         if damage cause is "void" parsed as a damage cause:
  758.             set victim's health to 0
  759.  
  760.         else:
  761.             cancel event
  762.  
  763. on death:
  764.     if world of player is world of {lobby.location}:
  765.         set death message to ""
  766.  
  767. on respawn:
  768.     if world of player is world of {lobby.location}:
  769.         set slot 4 of player to a compass named "{@lcompass}"
  770.         teleport player to {lobby.location}
  771.  
  772. on inventory click:
  773.     if player is in world of {lobby.location}:
  774.         if clicked item is a compass named "{@lcompass}":
  775.             cancel event
  776.             close player's inventory
  777.             openCompass(player)
  778.  
  779. on click:
  780.     if player is in world of {lobby.location}:
  781.         if player's held item is a compass named "{@lcompass}":
  782.             cancel event
  783.             openCompass(player)
  784.  
  785. on place of chest:
  786.     set {_world} to world of event-block
  787.     if {_world} is world of {lobby.location}:
  788.         set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  789.         if contains({_list::*}, "%uncolored name of player's tool%"):
  790.            
  791.             add location of block at event-block to {lobbycr.%uncolored name of player's tool%.location::*}
  792.             add world of event-block to {lobbycr.%uncolored name of player's tool%.world::*}
  793.            
  794.             set {holo-crate-%world of event-block%-%location of event-block%} to new hologram at location 1 meters above event-block
  795.             add text "&a&l%uncolored name of player's tool%" to hologram {holo-crate-%world of event-block%-%location of event-block%}
  796.             add "%location of block at event-block%" to yml list "Locations" of file "{@path}/%uncolored name of player's tool%.yml"
  797.  
  798.             send "{@lobby} &2Succesfully created a &a%uncolored name of player's tool% &2Crate!"
  799.            
  800. on break of chest:
  801.     set {_world} to world of event-block
  802.     if {_world} is world of {lobby.location}:
  803.         set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  804.         loop {_list::*}:
  805.             loop {lobbycr.%loop-value-1%.location::*}:
  806.                 if loop-value-2 is location of event-block:
  807.                     remove location of block at event-block from {lobbycr.%loop-value-1%.location::*}
  808.                     remove world of event-block from {lobbycr.%loop-value-1%.world::*}
  809.                
  810.                     unregister hologram {holo-crate-%world of event-block%-%location of event-block%}
  811.                     delete {holo-crate-%world of event-block%-%location of event-block%}
  812.                     remove "%location of event-block%" from yml list "Locations" of file "{@path}/%loop-value-1%.yml"
  813.                    
  814.                     send "{@lobby} &2Succesfully removed a &a%loop-value-1% &2Crate!"
  815.  
  816. on rightclick on a chest:
  817.     set {_world} to world of clicked block
  818.     if {_world} is "%world of {lobby.location}%":
  819.  
  820.         set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  821.         loop {_list::*}:
  822.  
  823.             loop {lobbycr.%loop-value-1%.location::*}:
  824.                 if "%loop-value-2%" is "%location of clicked block%":
  825.                     cancel event
  826.                     if "%uncolored {crate.%player%.name}%" = loop-value-1:
  827.                         if {crates.opening.%player%} is true:
  828.                             open chest with 3 rows named "&2%{crate.%player%.name}%" to player
  829.  
  830.                             set {crates.reopening.%player%} to true
  831.                             set {_count} to 0
  832.                             loop 27 times:
  833.                                 if {crate.%player%.inv::%{_count}%} is set:
  834.                                     set {_value} to "%{crate.%player%.inv::%{_count}%}%"
  835.                                     set {_color::*} to {_value} split at " "
  836.                            
  837.                                     if contains({_color::*}, "glass") is true:
  838.                                         if contains({_color::*}, "light") is true:
  839.                                             format gui slot {_count} of player with ("light %{_color::2}% stained glass pane" parsed as an item) to do nothing
  840.                                    
  841.                                         else if contains({_color::*}, "dark") is true:
  842.                                             format gui slot {_count} of player with ("dark %{_color::2}% stained glass pane" parsed as an item) to do nothing
  843.                                    
  844.                                         else:
  845.                                             format gui slot {_count} of player with ("%{_color::1}% stained glass pane" parsed as an item) to do nothing
  846.                                    
  847.                                     else:
  848.                                         format gui slot {_count} of player with ({crate.%player%.inv::%{_count}%} parsed as an item) to do nothing
  849.                                    
  850.  
  851.                                 add 1 to {_count}
  852.  
  853.                             delete {crates.closed.%player%}
  854.                             delete {crates.openinglist::*}
  855.                             delete {crate.%player%.inv::*}
  856.                             delete {crate.%player%.name}
  857.            
  858.  
  859.                         else:
  860.                             open chest with 3 rows named "&2%loop-value-1%" to player
  861.                             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%")
  862.                             stop loop
  863.                     else:
  864.                         open chest with 3 rows named "&2%loop-value-1%" to player
  865.                         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%")
  866.                         stop loop
  867.  
  868. on inventory close:
  869.     if {crates.opening.%player%} is true:
  870.         set {crates.closed.%player%} to true
  871.         add player to {crates.openinglist::*}
  872.         clear {crate.%player%.inv::*}
  873.         set {crate.%player%.name} to name of player's current inventory
  874.         set {_count} to 0
  875.        
  876.        
  877.         loop 27 times:
  878.             set {crate.%player%.inv::%{_count}%} to slot {_count} of player's current inventory
  879.             add 1 to {_count}
  880.  
  881.     else if {crates.opening.%player%} is set:
  882.         delete {crates.opening.%player%}
  883.  
  884.     if name of current inventory of player is "&8Edit" or "&8Edit Helmet" or "&8Edit Chestplate" or "&8Edit Leggings" or "&8Edit Boots" or "&8Choose Category" or "&8Choose Type" or "&8Edit SkullOwner":
  885.         if {cosmetics.edit.%player%} is not set:
  886.             delete {cosmetics.edit.%player%.helmet}
  887.             delete {cosmetics.edit.%player%.chestplate}
  888.             delete {cosmetics.edit.%player%.leggings}
  889.             delete {cosmetics.edit.%player%.boots}
  890.  
  891.             delete {cosmetics.edit.%player%.type}
  892.             delete {cosmetics.edit.%player%.current}
  893.             delete {cosmetics.edit.%player%.crate}
  894.             delete {cosmetics.edit.%player%.pieceText}
  895.             delete {cosmetics.edit.%player%.helmet.name}
  896.             delete {cosmetics.edit.%player%.helmet.lore::*}
  897.             delete {cosmetics.edit.%player%.helmet.ench::*}
  898.             delete {cosmetics.edit.%player%.chestplate.name}
  899.             delete {cosmetics.edit.%player%.chestplate.lore::*}
  900.             delete {cosmetics.edit.%player%.chestplate.ench::*}
  901.             delete {cosmetics.edit.%player%.leggings.name}
  902.             delete {cosmetics.edit.%player%.leggings.lore::*}
  903.             delete {cosmetics.edit.%player%.leggings.ench::*}
  904.             delete {cosmetics.edit.%player%.boots.name}
  905.             delete {cosmetics.edit.%player%.boots.lore::*}
  906.             delete {cosmetics.edit.%player%.boots.ench::*}
  907.             delete {cosmetics.edit.%player%.helmet.helmet.type}
  908.             delete {cosmetics.edit.%player%.helmet.player}
  909.             delete {cosmetics.edit.%player%.helmet.type}
  910.             delete {cosmetics.edit.%player%.helmet.skull}
  911.  
  912.  
  913.  
  914. on chat:
  915.     if {cosmetics.edit.%player%} is set:
  916.         cancel event
  917.        
  918.         if {cosmetics.edit.%player%} is "set%{cosmetics.edit.%player%.pieceText}%Item":
  919.             if "%message%" is "cancel":
  920.                 send "{@lobby} Cancelled setting the %{cosmetics.edit.%player%.pieceText} to lower case%."
  921.                 editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
  922.                 delete {cosmetics.edit.%player%}
  923.  
  924.             else if "%message%" parsed as an item type is not set:
  925.                 send "{@lobby} &c%message% &4is not a a %{cosmetics.edit.%player%.pieceText} to lower case%!"
  926.  
  927.             else:
  928.                 if {cosmetics.edit.%player%.type} is not set:
  929.                     set {cosmetics.edit.%player%.type} to ""
  930.  
  931.                 set {_var} to "%message%"
  932.                 replace all " " in {_var} with "_"
  933.                
  934.                 if {_var} contains "_":
  935.                     set {_message::*} to {_var} split at "_"
  936.  
  937.                 if ({cosmetics.edit.%player%.pieceText} to lower case) is "helmet":
  938.                     set {_piece} to ("%{cosmetics.edit.%player%.pieceText}%" to lower case)
  939.                    
  940.                     if contains({_message::*}, "helmet"):
  941.                         set {cosmetics.edit.%player%.%{_piece}%} to "%message to lower case%"
  942.                    
  943.                     else if "%message%" = "head":
  944.                         set {cosmetics.edit.%player%.%{_piece}%} to "head"
  945.                        
  946.                     else if contains({_message::*}, "head"):
  947.                         set {cosmetics.edit.%player%.%{_piece}%} to "head"
  948.                    
  949.                     else:
  950.                         send "{@lobby} &c%message% &4is not a helmet!"
  951.                         stop
  952.  
  953.                     send "{@lobby} Succesfully set helmet to &a%message%"
  954.                        
  955.                     editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
  956.                     delete {cosmetics.edit.%player%}
  957.  
  958.                 else if ({cosmetics.edit.%player%.pieceText} to lower case) is "chestplate":
  959.                     set {_piece} to ("%{cosmetics.edit.%player%.pieceText}%" to lower case)
  960.                    
  961.                     if contains({_message::*}, "chestplate") or contains({_message::*}, "tunic"):
  962.                         set {cosmetics.edit.%player%.%{_piece}%} to "%message to lower case%"
  963.                    
  964.                     else:
  965.                         send "{@lobby} &c%message% &4is not a chestplate!"
  966.                         stop
  967.  
  968.                     send "{@lobby} Succesfully set chestplate to &a%message%"
  969.                    
  970.                     editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
  971.                     delete {cosmetics.edit.%player%}
  972.  
  973.  
  974.                 else if ({cosmetics.edit.%player%.pieceText} to lower case) is "leggings":
  975.                     set {_piece} to ("%{cosmetics.edit.%player%.pieceText}%" to lower case)
  976.                    
  977.                     if contains({_message::*}, "leggings"):
  978.                         set {cosmetics.edit.%player%.%{_piece}%} to "%message to lower case%"
  979.                    
  980.                     else:
  981.                         send "{@lobby} &c%message% &4are no leggings!"
  982.                         stop
  983.  
  984.                     send "{@lobby} Succesfully set leggings to &a%message%"
  985.                        
  986.                     editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
  987.                     delete {cosmetics.edit.%player%}
  988.  
  989.                 else if ({cosmetics.edit.%player%.pieceText} to lower case) is "boots":
  990.                     set {_piece} to ("%{cosmetics.edit.%player%.pieceText}%" to lower case)
  991.                    
  992.                     if contains({_message::*}, "boots"):
  993.                         set {cosmetics.edit.%player%.%{_piece}%} to "%message to lower case%"
  994.                    
  995.                     else:
  996.                         send "{@lobby} &c%message% &4are no boots!"
  997.                         stop
  998.  
  999.                     send "{@lobby} Succesfully set boots to &a%message%"
  1000.                        
  1001.                     editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
  1002.                     delete {cosmetics.edit.%player%}
  1003.  
  1004.  
  1005.                 else:
  1006.                     send "{@lobby} &c%message% &4is not a %{cosmetics.edit.%player%.pieceText} to lower case%!"
  1007.        
  1008.         else if {cosmetics.edit.%player%} is "setType":
  1009.             if "%message%" is "cancel":
  1010.                 send "{@lobby} Cancelled setting the type."
  1011.                 editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
  1012.                 delete {cosmetics.edit.%player%}
  1013.  
  1014.             set {cosmetics.edit.%player%.type} to "%message%"
  1015.             delete {cosmetics.edit.%player%}
  1016.  
  1017.             send "{@lobby} Succesfully set type to &a%message%"
  1018.             editSuit(player, {cosmetics.edit.%player%.type})
  1019.                
  1020.  
  1021.         else if {cosmetics.edit.%player%} is "setCrate":
  1022.             if "%message%" is "cancel":
  1023.                 send "{@lobby} Cancelled setting the crate."
  1024.                 editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
  1025.                 delete {cosmetics.edit.%player%}
  1026.  
  1027.             else:
  1028.                 set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1029.                 if contains({_list::*}, "%message to lower case%"):
  1030.                     set {cosmetics.edit.%player%.crate} to "%message to lower case%"
  1031.                     editSuit(player, {cosmetics.edit.%player%.type})
  1032.                     delete {cosmetics.edit.%player%}
  1033.                 else:
  1034.                     send "{@lobby} &c%message% &4is not a valid crate!"
  1035.  
  1036.     else if world of player is world of {lobby.location}:
  1037.         cancel event
  1038.         send "&7[&e%player%&7] &8>> &f%message%" to all players in world of player
  1039.         send "&7[&eLobby&7][&e%player%&7] &f>> %message%" to console
  1040.  
  1041.  
  1042. #------------------- Commands -------------------
  1043. command /lobby [<text>] [<text>]:
  1044.     aliases: /hub
  1045.     trigger:
  1046.         if player has permission "lobby.*":
  1047.             if arg-1 is set:
  1048.                 if arg-1 is "help":
  1049.                     send "&2----------[ &a%{cmd}% &2]----------"
  1050.                     send "&e&o/%{cmd}% help &d→ &fGet the help page"
  1051.                     send "&e&o/%{cmd}% set &d→ &fSet the lobby"
  1052.                     send "&2----------[ &a%{cmd}% &2]----------"
  1053.  
  1054.                 else if arg-1 is "set":
  1055.                     send "{@logo} &2Succesfully set the &a%{cmd}% &2to your location!"
  1056.                     set {lobby.location} to location of player
  1057.  
  1058.             else:
  1059.                 if {lobby.location} is set:
  1060.                     if world of player is not "%world of {lobby.location}%":
  1061.                         teleport player to {lobby.location}
  1062.                         send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  1063.                         clear player's inventory
  1064.                         set slot 4 of player to a compass named "{@lcompass}"
  1065.  
  1066.                     else:
  1067.                         teleport player to {lobby.location}
  1068.  
  1069.                 else:
  1070.                     send "{@lobby} &cThe %{cmd}% is not set yet!"
  1071.  
  1072.  
  1073.         else if {lobby.location} is set:
  1074.             if world of player is not "%world of {lobby.location}%":
  1075.                 teleport player to {lobby.location}
  1076.                 send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
  1077.                 clear player's inventory
  1078.                 set slot 4 of player to a compass named "{@lcompass}"
  1079.  
  1080.             else:
  1081.                 teleport player to {lobby.location}
  1082.  
  1083.         else:
  1084.             send "{@lobby} &cThe %{cmd}% is not set yet!"
  1085.  
  1086.  
  1087. command /lobbycompass [<text>] [<text>] [<text>]:
  1088.     aliases: /lcomp, /lcompass
  1089.     trigger:
  1090.         if player has permission "lobbycompass.*":
  1091.             if arg 1 is not set:
  1092.                 send "{@lobby} &4Do &c&o/%{cmd}% help &4for more info."
  1093.  
  1094.             else if arg 1 is set:
  1095.                 if arg 1 is "help":
  1096.                     send "&2----------[ &a%{cmd}% &2]----------"
  1097.                     send "&e&o/%{cmd}% help &d→ &fKrijg help pagina"
  1098.                     send "&e&o/%{cmd}% create <minigame> &d→ &fCreate a minigame"
  1099.                     send "&e&o/%{cmd}% remove/delete <minigame> &d→ &fDelete a minigame"
  1100.                     send "&e&o/%{cmd}% setspawn <minigame> &d→ &fSet the spawn of a minigame"
  1101.                     send "&e&o/%{cmd}% slot <minigame> <number> &d→ &fSet the GUI slot of a minigame"
  1102.                    
  1103.                     send "&e&o/%{cmd}% setname <minigame> <name> &d→ &fSet a name"
  1104.                     send "&e&o/%{cmd}% deletename <minigame> &d→ &fDelete the name of a minigame"
  1105.                     send "&e&o/%{cmd}% setlore <minigame> <lore> &d→ &fSet a lore"
  1106.                     send "&e&o/%{cmd}% deletelore <minigame> <minigame> &d→ &fDelete the lore of a minigame"
  1107.                     send "&e&o/%{cmd}% setitem <minigame> <item> &d→ &fSet the item of a minigame"
  1108.                     send "&e&o/%{cmd}% list &d→ &fGet a list of all the minigames"
  1109.                     send "&e&o/%{cmd}% setrows <number> &d→ &fSet the amount of rows in the GUI"
  1110.                     send "&e&o/%{cmd}% gui <minigame> &d→ &fOpen the config-GUI"
  1111.                     send "&2----------[ &a%{cmd}% &2]----------"
  1112.  
  1113.                 else if arg 1 is "create":
  1114.                     if arg 2 is set:
  1115.                         if {lobby.minigames.%arg 2%} is not set:
  1116.                             set {lobby.minigames.%arg 2%} to true
  1117.                             set {lobby.minigames.%arg 2%.name} to "&cNone"
  1118.                             set {lobby.minigames.%arg 2%.lore} to "&cNone"
  1119.                             set {lobby.minigames.%arg 2%.item} to "&cNone"
  1120.                             set {lobby.minigames.%arg 2%.slot} to "&cNone"
  1121.                             set {lobby.minigames.%arg 2%.spawn} to "&cNone"
  1122.                             add arg 2 to {lobby.minigames.list::*}
  1123.  
  1124.                             send "{@lobby} &2Succesfully made the minigame &a%arg 2%&2!"
  1125.  
  1126.                         else:
  1127.                             send "{@lobby} &4The minigame &c%arg 2% &4already exists!"
  1128.                     else:
  1129.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1% <minigame>&4."
  1130.  
  1131.                 else if arg 1 is "delete" or "remove":
  1132.                     if arg 2 is set:
  1133.                         if {lobby.minigames.%arg 2%} is set:
  1134.                             delete {lobby.minigames.%arg 2%}
  1135.                             delete {lobby.minigames.%arg 2%.name}
  1136.                             delete {lobby.minigames.%arg 2%.lore}
  1137.                             delete {lobby.minigames.%arg 2%.item}
  1138.                             delete {lobby.minigames.%arg 2%.slot}
  1139.                             delete {lobby.minigames.%arg 2%.spawn}
  1140.                             remove arg 2 from {lobby.minigames.list::*}
  1141.  
  1142.                             send "{@lobby} &2Succesfully removed the minigame &a%arg 2%&2!"
  1143.  
  1144.                         else:
  1145.                             send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  1146.                     else:
  1147.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  1148.  
  1149.  
  1150.                 else if arg 1 is "setspawn":
  1151.                     if arg 2 is set:
  1152.                         if {lobby.minigames.%arg 2%} is set:
  1153.                             set {lobby.minigames.%arg 2%.spawn} to location of player
  1154.                             send "{@lobby} &2Succesfully set the spawn of the minigame%nl%&a%arg 2% &2arg &a%location of player%&2!"
  1155.  
  1156.                         else:
  1157.                             send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  1158.                     else:
  1159.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  1160.  
  1161.                 else if arg 1 is "slot":
  1162.                     if arg 2 is set:
  1163.                         if {lobby.minigames.%arg 2%} is set:
  1164.                             if arg 3 is set:
  1165.                                 if (arg 3 parsed as a number) is set:
  1166.                                     if {lobby.compassRows} is not set:
  1167.                                         set {lobby.compassRows} to 1
  1168.  
  1169.                                     if {lobby.compassRows} < 1:
  1170.                                         set {lobby.compassRows} to 1
  1171.  
  1172.  
  1173.                                     if {lobby.compassRows}*9-1 < arg-3 parsed as a number:
  1174.                                         send "{@lobby} &4The amount &c%arg 3% &4is to large bacause the max amount of slots is &c%{lobby.compassRows}*9+1%&4!"
  1175.  
  1176.                                     else:
  1177.                                         loop {lobby.minigames.list::*}:
  1178.                                             if {lobby.minigames.%loop-value%.slot} is arg 3:
  1179.                                                 set {_set} to loop-value
  1180.                                                 stop loop
  1181.  
  1182.                                         if {_set} is set:
  1183.                                             send "{@lobby} &4The slot &c%arg 3% &4is already in use by the minigame &c%{_set}%&4!"
  1184.                                         else:
  1185.                                             set {lobby.minigames.%arg 2%.slot} to arg 3
  1186.                                             send "{@lobby} &2Succesfully set the slot of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  1187.                                 else:
  1188.                                     send "{@lobby} &c%arg 3% &4is not a number!"
  1189.                             else:
  1190.                                 send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <number>&4."
  1191.                         else:
  1192.                             send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  1193.                     else:
  1194.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <number>&4."
  1195.  
  1196.  
  1197.                 else if arg 1 is "setname":
  1198.                     if arg 2 is set:
  1199.                         if {lobby.minigames.%arg 2%} is set:
  1200.                             if arg 3 is set:
  1201.                                 set {lobby.minigames.%arg 2%.name} to arg 3
  1202.                                 send "{@lobby} &2Succesfully set the name of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  1203.  
  1204.                             else:
  1205.                                 send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <name>&4."
  1206.                         else:
  1207.                             send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  1208.                     else:
  1209.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  1210.  
  1211.                 else if arg 1 is "delname" or "deletename":
  1212.                     if arg 2 is set:
  1213.                         delete {lobby.minigames.%arg 2%.name}
  1214.                         send "{@lobby} &2Succesfully deleted the name from the minigame &a%arg 2%&2!"
  1215.  
  1216.                     else:
  1217.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  1218.  
  1219.                 else if arg 1 is "setlore":
  1220.                     if arg 2 is set:
  1221.                         if {lobby.minigames.%arg 2%} is set:
  1222.                             if arg 3 is set:
  1223.                                 set {lobby.minigames.%arg 2%.lore} to arg 3
  1224.                                 send "{@lobby} &2Succesfully set the lore of the minigame &a%arg 2% &2to &a%arg 3%&2!"
  1225.  
  1226.                             else:
  1227.                                 send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <lore>&4."
  1228.                         else:
  1229.                             send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  1230.                     else:
  1231.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <lore>&4."
  1232.  
  1233.                 else if arg 1 is "dellore" or "deletelore":
  1234.                     if arg 2 is set:
  1235.                         if {lobby.minigames.%arg 2%} is set:
  1236.                             delete {lobby.minigames.%arg 2%.lore}
  1237.                             send "{@lobby} &2Succesfully deleted the lore from the minigame &a%arg 2%&2!"
  1238.  
  1239.                         else:
  1240.                             send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  1241.                     else:
  1242.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
  1243.  
  1244.                 else if arg 1 is "setitem":
  1245.                     if arg 2 is set:
  1246.                         if {lobby.minigames.%arg 2%} is set:
  1247.                             if arg 3 is set:
  1248.                                 if (arg 3 parsed as an item) is set:
  1249.                                     set {lobby.minigames.%arg 2%.item} to arg 3 parsed as an item
  1250.                                     send "{@lobby} &2Succesfully set the item from the minigame &a%arg 2% &2to &a%arg 3%&2!"
  1251.  
  1252.                                 else:
  1253.                                     send "{@lobby} &c%arg 3% &4is not an item!"
  1254.                             else:
  1255.                                 send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <item>&4."
  1256.                         else:
  1257.                             send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  1258.                     else:
  1259.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <item>&4."
  1260.  
  1261.  
  1262.                 else if arg 1 is "list":
  1263.                     if {lobby.minigames.list::*} is not empty:
  1264.                         loop {lobby.minigames.list::*}:
  1265.                             if {_list} is set:
  1266.                                 set {_list} to "%{_list}%&2, &a%loop-value%"
  1267.                             else:
  1268.                                 set {_list} to "%loop-value%"
  1269.  
  1270.                     else:
  1271.                         set {_list} to "Geen"
  1272.  
  1273.                     send "{@lobby} &2This is the list of all the minigames:%nl%&a%{_list}%"
  1274.  
  1275.  
  1276.                 else if arg 1 is "setrows":
  1277.                     if arg 2 is set:
  1278.                         if (arg 2 parsed as a number) is set:
  1279.                             if (arg-2 parsed as a number) < 7:
  1280.                                 set {lobby.compassRows} to (arg-2 parsed as a number)
  1281.                                 send "{@lobby} &2Succesfully set the amount of rows to &a%arg 2%&2!"
  1282.  
  1283.                             else:
  1284.                                 send "{@lobby} &4The max amount of rows is &c6&4!"
  1285.                         else:
  1286.                             send "{@lobby} &c%arg 2% &4is not a number!"
  1287.                     else:
  1288.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <number>&4."
  1289.  
  1290.  
  1291.                 else if arg 1 is "gui":
  1292.                     if arg 2 is set:
  1293.                         if {lobby.minigames.%arg 2%} is set:
  1294.                             open chest with 2 rows named "&7Config GUI" to player
  1295.  
  1296.                             set {_name} to {lobby.minigames.%arg 2%.name}
  1297.                             replace "&" in {_name} with "§"
  1298.                            
  1299.                             set {_lore} to {lobby.minigames.%arg 2%.lore}
  1300.                             replace "&" in {_lore} with "§"
  1301.  
  1302.                             format gui slot 2 of player with a book named "&2Minigame: &a%arg-2%" to do nothing
  1303.                             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)
  1304.                             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)
  1305.                             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)
  1306.                             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)
  1307.                            
  1308.                             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)
  1309.                             format gui slot 13 of player with a barrier named "&cClose menu" to close
  1310.                             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)
  1311.  
  1312.                         else:
  1313.                             send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
  1314.                     else:
  1315.                         send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
  1316.                 else:
  1317.                     send "{@lobby} &4Do &c/%{cmd}% help &4for more info."      
  1318.  
  1319. command /lobbycrate [<text>] [<text>]:
  1320.     aliases: /lobbycr, /lcrate
  1321.     trigger:
  1322.         if player is in world of {lobby.location}:
  1323.             if player has permission "votecrate.*":
  1324.                 if arg-1 is set:
  1325.                     if arg-1 is "help":
  1326.                         send "&2----------[ &a%{cmd}% &2]----------"
  1327.                         send "&e&o/%{cmd}% help &d→ &fGet the help page"
  1328.                         send "&e&o/%{cmd}% list &d→ &fGet a list with all crates"
  1329.                         send "&e&o/%{cmd}% create <crate> &d→ &fCreate a create"
  1330.                         send "&e&o/%{cmd}% delete/remove <crate> &d→ &fDelete a crate"
  1331.                         send "&e&o/%{cmd}% path <crate> &d→ &fGet the edit path of a crate"
  1332.                         send "&e&o/%{cmd}% get <crate> &d→ &fGet a crate"
  1333.                        
  1334.                         send "&2----------[ &a%{cmd}% &2]----------"
  1335.  
  1336.                     else if arg-1 is "list":
  1337.                         set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1338.                         if {_list::*} is not empty:
  1339.                             loop {_list::*}:
  1340.                                 if {_list} is set:
  1341.                                     set {_list} to "%{_list}%&2, &a%loop-value%"
  1342.                                 else:
  1343.                                     set {_list} to "%loop-value%"
  1344.  
  1345.                             send "{@lobby} &2There are the following crates:%nl%&a%{_list}%"
  1346.  
  1347.                         else:
  1348.                             send "{@lobby} &2There are no crates made yet."
  1349.  
  1350.  
  1351.                     else if arg-1 is "create":
  1352.                         if arg-2 is set:
  1353.                             set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1354.                             set {_arg2} to "%arg-2 to lower case%"
  1355.                             if contains({_list::*}, {_arg2}):
  1356.                                 send "{@lobby} &4The crate &c%{_arg2}% &4already exists!"
  1357.                            
  1358.  
  1359.                             else:
  1360.                                
  1361.                                 send "{@lobby} &2Making the crate &a%{_arg2}%&2..."
  1362.                                 add {_arg2} to yml list "Lobby.Crates.List" of file "{@config}"
  1363.                                 create file "{@path}/%{_arg2}%.yml"
  1364.                                 add "diamond_sword" to yml list "Item.List" of file "{@path}/%{_arg2}%.yml"
  1365.                                 add "diamond_sword-1" to yml list "Item.ConfigName" of file "{@path}/%{_arg2}%.yml"
  1366.                                
  1367.                                 set yml value "Item.Chance.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "100"
  1368.                                 set yml value "Item.Name.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "&aDiamond Sword"
  1369.                                 set yml value "Item.Amount.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to 1
  1370.                                
  1371.                                 add "This is a lore" to yml list "Item.Lore.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  1372.  
  1373.                                 add "sharpness:1" to yml list "Item.Enchants.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
  1374.                                
  1375.                                 send "{@lobby} &2Succesfully made the crate &a%{_arg2}%&2!"
  1376.                                
  1377.                                
  1378.                         else:
  1379.                             send "{@lobby} &4You need to give up a &cname &4for the crate!"
  1380.  
  1381.                     else if arg-1 is "delete" or "remove":
  1382.                         if arg-2 is set:
  1383.                             set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1384.                             set {_arg2} to "%arg-2 to lower case%"
  1385.                             if contains({_list::*}, {_arg2}):
  1386.                                 send "{@lobby} &2Deleting the crate &a%{_arg2}%&2..."
  1387.                                
  1388.                                 remove "%{_arg2}%" from yml list "Lobby.Crates.List" of file "{@config}"
  1389.                                 delete file "{@path}/%{_arg2}%.yml"
  1390.  
  1391.                                 send "{@lobby} &2Succesfully deleted the crate &a%{_arg2}%&2!"
  1392.                                    
  1393.                             else:
  1394.                                 send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  1395.                                
  1396.                         else:
  1397.                             send "{@lobby} &4You need to give up a &cname &4of the crate you want to delete!"
  1398.  
  1399.                     else if arg-1 is "path":
  1400.                         if arg-2 is set:
  1401.                             set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1402.                             set {_arg2} to "%arg-2 to lower case%"
  1403.                            
  1404.                             if contains({_list::*}, {_arg2}):
  1405.                                 send "{@lobby} &2Location of %{_arg2}%: &a{@path}/%{_arg2}%&2."
  1406.                                
  1407.                            
  1408.                             else:
  1409.                                 send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exists!"
  1410.                         else:
  1411.                             send "{@lobby} &4You need to give up a &cname &4of the crate you want to get the path of!"
  1412.  
  1413.                     else if arg-1 is "get":
  1414.                         if arg 2 is set:
  1415.                             set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1416.                             set {_arg2} to "%arg-2 to lower case%"
  1417.                             if contains({_list::*}, {_arg2}):
  1418.                                 send "{@lobby} &2Here you have the &a%{_arg2}% &2crate!%nl%&2Place it to create a chest."
  1419.                                 give player 1 chest named "&e%{_arg2}%" with lore "&7Place to create a crate!"
  1420.                             else:
  1421.                                 send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
  1422.                         else:
  1423.                             send "{@lobby} &4You must give up a crate type!"
  1424.                    
  1425.                     else:
  1426.                         send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  1427.                 else:
  1428.                     send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
  1429.  
  1430.  
  1431. command /key [<text>] [<text>] [<text>] [<text>]:
  1432.     trigger:
  1433.         if player has permission "key.*":
  1434.             if arg-1 is set:
  1435.                 if arg-1 is "help":
  1436.                     send "&2----------[ &a%{cmd}% &2]----------"
  1437.                     send "&e&o/%{cmd}% help &d→ &fGet the help page"
  1438.                     send "&e&o/%{cmd}% get <crate/all> [number] &d→ &fGet a crate"
  1439.                     send "&e&o/%{cmd}% give <player> <crate/all> [number] &d→ &fGive a key to open a crate to a player"
  1440.                     send "&e&o/%{cmd}% remove <all/crate> [number] [player] &d→ &fRemove a key from a player"
  1441.                     send "&e&o/%{cmd}% clear <all/crate> [player] &d→ &fClear the keys from a player"
  1442.                     send "&e&o/%{cmd}% keys <all/crate> [player] &d→ &fGet the amount of keys from a player"
  1443.                     send "&2----------[ &a%{cmd}% &2]----------"
  1444.  
  1445.                 else if arg-1 is "get":
  1446.                     if arg-2 is "all":
  1447.                         if arg-3 is set:
  1448.                             if (arg-3 parsed as a number) is set:
  1449.                                 set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1450.                                 set {_num} to arg-3 parsed as a number
  1451.                                 loop {_num} times:
  1452.                                     loop {_list::*}:
  1453.                                         add 1 to {keys.%player%.%loop-value-2%}
  1454.  
  1455.                                 send "{@lobby} &2You have recieved all the &a%arg-3% &2times!"
  1456.  
  1457.                             else:
  1458.                                 send "{@lobby} &c%arg-3% &4is not a number!"
  1459.                         else:
  1460.                             set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1461.                             loop {_list::*}:
  1462.                                 add 1 to {keys.%player%.%loop-value%}
  1463.  
  1464.                             send "{@lobby} &2You have recieved all keys!"
  1465.  
  1466.                     else if arg-2 is set:
  1467.                         set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1468.                         if contains({_list::*}, "%arg-2 to lower case%"):
  1469.                             if arg-3 is set:
  1470.                                 if (arg-3 parsed as a number) is set:
  1471.                                     add (arg-3 parsed as a number) to {keys.%player%.%arg-2 to lower case%}
  1472.                                     send "{@lobby} &2You have recieved &a%arg-2 to lower case% &2key &a%arg-3% &2times!"
  1473.                                 else:
  1474.                                     send "{@lobby} &c%arg-3% &4is not a number!"
  1475.                             else:
  1476.                                 add 1 to {keys.%player%.%arg-2 to lower case%}
  1477.  
  1478.                                 send "{@lobby} &2You have recieved a &a%arg-2 to lower case% &2key!"
  1479.                         else:
  1480.                             send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  1481.                     else:
  1482.                         send "{@lobby} &4You must give up a &ccrate&4!"
  1483.  
  1484.                 else if arg-1 is "give":
  1485.                     if arg-2 is set:
  1486.                         if (arg-2 parsed as a player) is set:
  1487.                             if arg-3 is set:
  1488.                                 if arg-3 is "all":
  1489.                                     if arg-4 is set:
  1490.                                         if (arg-4 parsed as a number) is set:
  1491.                                             set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1492.                                             set {_num} to arg-4 parsed as a number
  1493.                                             loop {_num} times:
  1494.                                                 loop {_list::*}:
  1495.                                                     add 1 to {keys.%arg-2 parsed as a player%.%loop-value-2%}
  1496.  
  1497.                                             send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys &a%arg-4% &2times!"
  1498.                                             send "{@lobby} &2You have recieved all the keys &a%arg-4% &2times!" to arg-2 parsed as a player
  1499.  
  1500.                                         else:
  1501.                                             send "{@lobby} &c%arg-3% &4is not a number!"
  1502.                                     else:
  1503.                                         set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1504.                                         loop {_list::*}:
  1505.                                             add 1 to {keys.%arg-2 parsed as a player%.%loop-value%}
  1506.  
  1507.                                         send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys!"
  1508.                                         send "{@lobby} &2You have recieved all the keys!" to arg-2 parsed as a player
  1509.                                 else:
  1510.                                     set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1511.                                     if contains({_list::*}, "%arg-3 to lower case%"):
  1512.                                         if arg-4 is set:
  1513.                                             if (arg-4 parsed as a number) is set:
  1514.                                                
  1515.                                                 add (arg-4 parsed as a number) to {keys.%arg-2%.%arg-3 to lower case%}
  1516.  
  1517.                                                 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!"
  1518.                                                 send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key &a%arg-4% &2times!" to arg-2 parsed as a player
  1519.  
  1520.                                             else:
  1521.                                                 send "{@lobby} &c%arg-3% &4is not a number!"
  1522.                                         else:
  1523.                                             add 1 to {keys.%arg-2 parsed as a player%.%arg-3 to lower case%}
  1524.  
  1525.                                             send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2the &a%arg-3 to lower case% &2key!"
  1526.                                             send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key!" to arg-2 parsed as a player
  1527.                                     else:
  1528.                                         send "{@lobby} &4The crate &c%arg-3 to lower case% &4doesn't exist!"
  1529.                             else:
  1530.                                 send "{@lobby} &4You must give up a &ccrate&4!"
  1531.                         else:
  1532.                             send "{@lobby} &4The player &c%arg-2% &4is not online!"
  1533.                     else:
  1534.                         send "{@lobby} &4You must give up a &cplayer&4!"
  1535.                
  1536.  
  1537.                    
  1538.                 else if arg-1 is "remove":
  1539.                     if arg-2 is set:
  1540.                         if arg-2 is "all":
  1541.                             if arg-3 is set:
  1542.                                 if (arg-3 parsed as a number) is set:
  1543.                                     if arg-4 is set:
  1544.                                         if (arg-4 parsed as a player) is set:
  1545.                                             set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1546.                                             set {_num} to arg-3 parsed as a number
  1547.                                             loop {_list::*}:
  1548.                                                 if {keys.%arg-4 parsed as a player%.%loop-value%}-{_num} >= 0:
  1549.                                                     remove {_num} from {keys.%name of arg-4 parsed as a player%.%loop-value%}
  1550.                                                 else:
  1551.                                                     set {keys.%arg-4 parsed as a player%.%loop-value%} to 0
  1552.  
  1553.                                             send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys of &a%name of arg-4 parsed as a player%&2!"
  1554.                                             send "{@lobby} &2Removed &a%arg-3% &2from your keys!" to arg-4 parsed as a player
  1555.  
  1556.                                         else:
  1557.                                             send "{@lobby} &4The player &c%arg-4% &4is not online!"
  1558.                                     else:
  1559.                                         set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1560.                                         loop {_list::*}:
  1561.                                             if {keys.%player%.%loop-value%}-(arg-3 parsed as a number) >= 0:
  1562.                                                 remove (arg-3 parsed as a number) from {keys.%player%.%loop-value%}
  1563.                                             else:
  1564.                                                 set {keys.%player%.%loop-value%} to 0
  1565.  
  1566.                                         send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys!"
  1567.  
  1568.                                 else:
  1569.                                     send "{@lobby} &c%arg-3% &4is not a number!"
  1570.                             else:
  1571.                                 set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1572.                                 loop {_list::*}:
  1573.                                     if {keys.%player%.%loop-value%}-1 >= 0:
  1574.                                         remove 1 from {keys.%player%.%loop-value%}
  1575.  
  1576.                                 send "{@lobby} &2Succesfully removed &a1 &2from all the keys"
  1577.                         else:
  1578.                             set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1579.                             if contains({_list::*}, "%arg-2 to lower case%"):
  1580.                                 if arg-3 is set:
  1581.                                     if (arg-3 parsed as a number) is set:
  1582.                                         if arg-4 is set:
  1583.                                             if (arg-4 parsed as a player) is set:
  1584.                                                 if {keys.%arg-4 parsed as a player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
  1585.                                                     remove (arg-3 parsed as a number) from {keys.%name of arg-4 parsed as a player%.%arg-2 to lower case%}
  1586.                                                 else:
  1587.                                                     set {keys.%arg-4 parsed as a player%.%arg-2 to lower case%} to 0
  1588.  
  1589.                                                 send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys from &a%name of arg-4 parsed as a player%&2!"
  1590.                                                 send "{@lobby} &a%arg-3% %arg-2 to lower case% &2keys have been removed!" to arg-4 parsed as a player
  1591.  
  1592.                                             else:
  1593.                                                 send "{@lobby} &4The player &c%arg-4% &4is not online!"
  1594.                                         else:
  1595.                                            
  1596.                                             if {keys.%player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
  1597.                                                 remove (arg-3 parsed as a number) from {keys.%player%.%arg-2 to lower case%}
  1598.                                             send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys!"
  1599.  
  1600.                                     else:
  1601.                                         send "{@lobby} &c%arg-3% &4is not a number!"
  1602.  
  1603.                                 else:
  1604.                                     if {keys.%player%.%arg-2 to lower case%}-1 >= 0:
  1605.                                         remove 1 from {keys.%player%.%arg-2 to lower case%}
  1606.                                     send "{@lobby} &2Succesfully removed &a1 %arg-2 to lower case% &2keys!"
  1607.                             else:
  1608.                                 send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
  1609.                     else:
  1610.                         send "{@lobby} &4You must give up a &ccrate&4!"
  1611.  
  1612.                 else if arg-1 is "clear":
  1613.                     if arg-2 is set:
  1614.                         if arg-2 is "all":
  1615.                             if arg-3 is set:
  1616.                                 if (arg-3 parsed as a player) is set:
  1617.                                     set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1618.                                     loop {_list::*}:
  1619.                                         set {keys.%arg-3 parsed as a player%.%loop-value%} to 0
  1620.  
  1621.                                     send "{@lobby} &2Succesfully cleared &aall keys &2of &a%name of arg-3 parsed as a player%&2!"
  1622.                                     send "{@lobby} &aAll &2your &akeys &2have been cleared!" to arg-3 parsed as a player
  1623.                                 else:
  1624.                                     send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1625.                             else:
  1626.                                 set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1627.                                 loop {_list::*}:
  1628.                                     set {keys.%player%.%loop-value%} to 0
  1629.  
  1630.                                 send "{@lobby} &2You have cleared &aall &2your &akeys&2!"
  1631.                         else:
  1632.                             set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1633.                             if contains({_list::*}, "%arg-2 to lower case%"):
  1634.                                 if arg-3 is set:
  1635.                                     if (arg-3 parsed as a player) is set:
  1636.                                         set {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} to 0
  1637.                                         send "{@lobby} &2You have cleared the &a%arg-2 to lower case% keys &2from &a%name of arg-3 parsed as a player%&2!"
  1638.                                         send "{@lobby} &2Your &a%arg-2 to lower case% keys &2have been cleared!" to arg-3 parsed as a player
  1639.  
  1640.                                     else:
  1641.                                         send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1642.  
  1643.                                 else:
  1644.                                     set {keys.%player%.%arg-2 to lower case%} to 0
  1645.                                     send "{@lobby} &2Succesfully cleared the &a%arg-2 to lower case% keys&2!"
  1646.  
  1647.                             else:
  1648.                                 send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
  1649.                     else:
  1650.                         send "{@lobby} &4You must give up a &ccrate&4!"
  1651.  
  1652.                 else if arg-1 is "keys":
  1653.                     if arg-2 is set:
  1654.                         if arg-2 is "all":
  1655.                             if arg-3 is set:
  1656.                                 if (arg-3 parsed as a player) is set:
  1657.                                     set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1658.                                     loop {_list::*}:
  1659.                                         if {keys.%arg-3 parsed as a player%.%loop-value%} is not set:
  1660.                                             set {keys.%arg-3 parsed as a player%.%loop-value%} to 0
  1661.  
  1662.                                         if {_keys} is not set:
  1663.                                             set {_keys} to "&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
  1664.                                         else:
  1665.                                             set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
  1666.  
  1667.                                     send "{@lobby} &2This is the list of keys from &a%name of arg-3 parsed as a player%&2:%nl%%{_keys}%"
  1668.  
  1669.                                 else:
  1670.                                     send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1671.                             else:
  1672.                                 set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1673.                                 loop {_list::*}:
  1674.                                     if {keys.%player%.%loop-value%} is not set:
  1675.                                         set {keys.%player%.%loop-value%} to 0
  1676.                                     if {_keys} is not set:
  1677.                                         set {_keys} to "&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
  1678.                                     else:
  1679.                                         set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
  1680.  
  1681.                                 send "{@lobby} &2This is your list of keys&2:%nl%%{_keys}%"
  1682.                         else:
  1683.                             set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
  1684.                             if contains({_list::*}, "%arg-2 to lower case%"):
  1685.                                 if arg-3 is set:
  1686.                                     if (arg-3 parsed as a player) is set:
  1687.                                         if {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} is not set:
  1688.                                             set {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} to 0
  1689.  
  1690.                                         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."
  1691.  
  1692.                                     else:
  1693.                                         send "{@lobby} &4The player &c%arg-3% &4is not online!"
  1694.                                 else:
  1695.                                     if {keys.%player%.%arg-2 to lower case%} is not set:
  1696.                                         set {keys.%player%.%arg-2 to lower case%} to 0
  1697.  
  1698.                                     send "{@lobby} &2You have &a%{keys.%player%.%arg-2 to lower case%}% %arg-2 to lower case% &2keys."
  1699.                             else:
  1700.                                 send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
  1701.                     else:
  1702.                         send "{@lobby} &4You need to give up a &ccrate&4!"
  1703.                 else:
  1704.                     send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  1705.             else:
  1706.                 send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  1707.        
  1708.  
  1709. command /cosmetics [<text>] [<text>] [<text>]:
  1710.     aliases: /cos
  1711.     trigger:
  1712.         if player has permission "cosmetics.*":
  1713.             if arg-1 is not set:
  1714.                 send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
  1715.  
  1716.             else if arg-1 is "help":
  1717.                 send "&2----------[ &a%{cmd}% &2]----------"
  1718.                 send "&e&o/%{cmd}% help &d→ &fGet the help page"
  1719.                 send "&e&o/%{cmd}% gui [player] &d→ &fGet the cosmetics (of a player)"
  1720.                 send "&e&o/%{cmd}% setup <type> &d→ &fCreate a cosmetic"
  1721.                 send "&e&o/%{cmd}% edit [type] &d→ &fEdit a cosmetic"
  1722.                 #send "&e&o/%{cmd}% delete [type] [name] &d→ &fDelete a cosmetic"
  1723.                 send "&e&o/%{cmd}% path &d→ &fCreate your own cosmetics"
  1724.                 send "&2----------[ &a%{cmd}% &2]----------"
  1725.  
  1726.             #else if arg-1 is "gui":
  1727.             #   if arg-2 is set:
  1728.             #       if arg-2 parsed as a player is set:
  1729.             #          
  1730.  
  1731.             #       else:
  1732.             #           send "{@lobby} &4The player &c%arg-2% &4has never logged in."
  1733.  
  1734.             #   else:
  1735.  
  1736.             else if arg-1 is "setup":
  1737.                 if arg-2 is set:
  1738.                     editCos(player, "%arg-2%")
  1739.                     #open chest with 1 rows named "&8Cosmetics %arg-2%" to player
  1740.                     #format gui slot 2 of player with nether star named "&fCreate" to close
  1741.                     #format gui slot 4 of player with redstone torch on named "&fEdit" to close
  1742.                     #format gui slot 6 of player with blaze powder named "&fDelete" to close
  1743.  
  1744.                 else:
  1745.                     editCos(player, "")
  1746.                     #open chest with 1 rows named "&8Edit Cosmetics" to player
  1747.                     #format gui slot 2 of player with nether star named "&fCreate" to close
  1748.                     #format gui slot 4 of player with redstone torch on named "&fEdit" to close
  1749.                     #format gui slot 6 of player with blaze powder named "&fDelete" to close
  1750.  
  1751.             else if arg-1 is "path":
  1752.                 send "{@lobby} The path to edit your cosmetics is %nl%&a{@cosConfig} &2and to create cosmetics %nl%&a{@path}/Cosmetics/"
  1753.  
  1754.             else:
  1755.                 send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top