Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #© This Skript reselling/reuploading and claiming as it is yours is not allowed! ©
- #© Using this Skript in a video is no problem, only mention the things below this ©
- #
- #Skript made by Zeldaboy111
- #YouTube creator: https://www.youtube.com/channel/UClmeX0PpxrQd9q-4kRaBefg?view_as=subscriber
- #More content of the creator: https://forums.skunity.com/search/26443679/
- options:
- logo: &6Server &7▬ &2
- lobby: &cLobby &7► &2
- lcompass: &9C&3ompass
- cGuiName: &9M&3inigames
- path: Files/Lobby
- config: Files/Lobby/config.yml
- cosConfig: Files/Lobby/Cosmetics/config.yml
- suitPath: Files/Lobby/Cosmetics/Suits
- helmetPath: Files/Lobby/Cosmetics/Helmets
- window1: yml value "Lobby.Crates.Animations.Window1" of file "Files/Lobby/config.yml"
- randomAnimation: yml value "Lobby.Crates.Animations.Random.Enabled" of file "Files/Lobby/config.yml"
- animation: yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "Files/Lobby/config.yml"
- particles: yml value "Lobby.Crates.Particles.Enabled" of file "Files/Lobby/config.yml"
- heads: yml value "Lobby.Crates.Heads.Enabled" of file "Files/Lobby/config.yml"
- suits: yml value "Lobby.Crates.Suits.Enabled" of file "Files/Lobby/config.yml"
- #alt + 15 = ☼
- #alt + 26 = →
- #alt + 16 = ►
- #alt + 22 = ▬
- #------------------- Functions -------------------
- function contains(list: objects, check: object) :: boolean:
- loop {_list::*}:
- if loop-value is {_check}:
- return true
- return false
- 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):
- open chest with {_rows} rows named {_gname} to {_p}
- set name of {_item1} to {_i1name}
- set name of {_item2} to {_i2name}
- format gui slot {_slot1} of {_p} with {_item1} to run:
- close {_p}'s inventory
- if {_command} is true:
- execute player command {_accept}
- else:
- send {_accept} to {_p}
- format gui slot {_slot2} of {_p} with {_item2} to run:
- close {_p}'s inventory
- send {_deny} to {_p}
- function openCompass(p: Player):
- if {lobby.compassRows} is not set:
- set {lobby.compassRows} to 1
- open chest with {lobby.compassRows} rows named "{@cGuiName}" to {_p}
- loop {lobby.minigames.list::*}:
- if {lobby.minigames.%loop-value%.slot} starts with "-":
- stop
- else:
- if ({lobby.minigames.%loop-value%.slot} parsed as a number) is set:
- if {lobby.minigames.%loop-value%.item} is "&cNone":
- set {_item} to paper
- else if ({lobby.minigames.%loop-value%.item} parsed as an item) is not set:
- set {_item} to paper
- else:
- set {_item} to {lobby.minigames.%loop-value%.item}
- set {_slot} to ({lobby.minigames.%loop-value%.slot} parsed as a number)
- if {lobby.minigames.%loop-value%.name} is set:
- if {lobby.minigames.%loop-value%.name} is not "&cNone":
- set {_name} to {lobby.minigames.%loop-value%.name}
- replace "&" in {_name} with "§"
- if {lobby.minigames.%loop-value%.lore} is set:
- if {lobby.minigames.%loop-value%.lore} is not "&cNone":
- set {_lore} to {lobby.minigames.%loop-value%.lore}
- replace "&" in {_lore} with "§"
- format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" with lore "%{_lore}%" to do nothing
- else:
- format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to do nothing
- else:
- format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item named "%{_name}%" to do nothing
- else:
- format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to do nothing
- else:
- format gui slot {_slot} of {_p} with "%{lobby.minigames.%loop-value%.item}%" parsed as an item to do nothing
- function randomReward(crate: String) :: Item:
- set {_rewards1::*} to yml list "Item.List" of file "{@path}/%{_crate}%.yml"
- set {_rewardsNames::*} to yml list "Item.ConfigName" of file "{@path}/%{_crate}%.yml"
- set {_count} to 1
- loop {_rewards1::*}:
- if yml value "Item.Chance.%{_rewardsNames::%{_count}%}%" of file "{@path}/%{_crate}%.yml" is set:
- set {_chance} to yml value "Item.Chance.%{_rewardsNames::%{_count}%}%" of file "{@path}/%{_crate}%.yml" parsed as a string
- if ({_chance} parsed as a number) is set:
- loop ({_chance} parsed as a number) times:
- add "%loop-value-1% [{$^^$}] %{_rewardsNames::%{_count}%}%" to {_rewards::*}
- else:
- send "%nl%{@lobby} &c%{_chance}% &4is not a number!%nl%" to console
- add 1 to {_count}
- set {_length} to size of {_rewards::*}
- set {_prizeCount} to a random integer between 0 and {_length}
- set {_splitPrize::*} to {_rewards::%{_prizeCount}%} split at " [{$^^$}] "
- set {_prize} to {_splitPrize::1}
- set {_prizeCName} to {_splitPrize::2}
- if ({_prize} parsed as an item) is not set:
- send "{@lobby} &c%{_prize}% &4is not an item! Stopping opening the crate!" to console
- else:
- set {_prize} to {_prize} parsed as an item
- if yml value "Item.Name.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml" is set:
- set {_prizeName} to yml value "Item.Name.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml"
- set {_prizeName} to "%colored {_prizeName}%"
- set name of {_prize} to "&f%{_prizeName}%"
- if yml value "Item.Amount.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml" is set:
- set {_prizeAmount} to yml value "Item.Amount.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml"
- set {_prizeAmount} to ({_prizeAmount} parsed as a number)
- if {_prizeAmount} is set:
- set {_prize} to ("%{_prizeAmount}% %{_prize}%" parsed as an item)
- else:
- send "{@lobby} &c%{_prizeAmount}% &4is not a number!" to console
- set {_prize} to ("1 %{_prize}%" parsed as an item)
- if yml value "Item.Lore.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml" is set:
- set {_loreList::*} to yml list "Item.Lore.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml"
- loop {_loreList::*}:
- if {_lore} is not set:
- set {_lore} to "%loop-value%"
- else:
- set {_lore} to "%{_lore}%||%loop-value%"
- set lore of {_prize} to {_lore}
- if yml value "Item.Enchants.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml" is set:
- set {_enchantList::*} to yml list "Item.Enchants.%{_prizeCName}%" of file "{@path}/%{_crate}%.yml"
- loop {_enchantList::*}:
- set {_ench} to "%loop-value%"
- set {_split::*} to {_ench} split at ""
- if contains({_split::*}, ":") is true:
- set {_eSplit::*} to {_ench} split at ":"
- set {_ench1} to {_eSplit::1}
- set {_ench2} to {_eSplit::2}
- if ({_ench1} parsed as an enchantment type) is set:
- if ({_ench2} parsed as a number) is set:
- enchant {_prize} with "%{_ench1}% %{_ench2}%" parsed as an enchantment type
- set name of {_prize} to "&b%{_prizeName}%"
- else:
- send "%nl%{@lobby} &c%{_s2}% &4is not a number!%nl%" to console
- else:
- send "%nl%{@lobby} &c%{_s1}% &4is not an enchantment type!%nl%" to console
- else:
- if (loop-value parsed as an enchantment type) is set:
- enchant {_prize} with "%loop-value% 1" parsed as an enchantment type
- else:
- send "{@lobby} &c%loop-value% &4is not an enchantment type!" to console
- return {_prize}
- function animation1(p: Player, count: Integer, count2: Integer) :: boolean:
- loop 9 times:
- if {crates.reopening.%{_p}%} is true:
- delete {crates.reopening.%{_p}%}
- clear {crate.%{_p}%.inv::*}
- clear {crate.%{_p}%.name}
- if {crates.closed.%{_p}%} is true:
- if {_count} = {_count2}-18:
- set {crate.%{_p}%.inv::%{_count}%} to "light green glass"
- set {crate.%{_p}%.inv::%{_count2}%} to "light green glass"
- else:
- set {crate.%{_p}%.inv::%{_count}%} to "gray glass"
- set {crate.%{_p}%.inv::%{_count2}%} to "gray glass"
- else:
- if {_count} = {_count2}-18:
- format gui slot {_count} of {_p} with light green stained glass pane to do nothing
- format gui slot {_count2} of {_p} with light green stained glass pane to do nothing
- else:
- format gui slot {_count} of {_p} with gray stained glass pane to do nothing
- format gui slot {_count2} of {_p} with gray stained glass pane to do nothing
- add 1 to {_count}
- remove 1 from {_count2}
- wait 5 ticks
- set {animation.%{_p}%} to false
- function runAnimation(p: Player, animation: Integer, count: Integer, count2: Integer, forced: Boolean):
- if {_animation} is 1:
- if {_forced} is false:
- if {@window1} is true:
- animation1({_p}, {_count}, {_count2})
- set {animation.%{_p}%} to true
- else:
- animation1({_p}, {_count}, {_count2})
- set {animation.%{_p}%} to true
- function openCrate(p: Player, crate: String):
- if {keys.%{_p}%.%{_crate}%} > 0:
- open chest with 3 rows named "&2%{_crate}%" to {_p}
- set {crates.opening.%{_p}%} to true
- #Value to wait for animation
- set {animation.%{_p}%} to false
- set {_count} to 0
- set {_count2} to 26
- #Animations
- set {_random} to randomReward({_crate})
- if {@randomAnimation} is true:
- set {_animationNumber} to a random integer between 0 and 1
- else:
- set {_animation} to yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "{@config}"
- if {_animation} is "Window1":
- set {_animationNumber} to 1
- else:
- send "{@lobby} &4The animation &c%{_animation}% &4doesn't exist! Running Window1 as animation!" to console
- set {_animationNumber} to 1
- runAnimation({_p}, {_animationNumber}, {_count}, {_count2}, false)
- if {animation.%{_p}%} is false:
- runAnimation({_p}, 1, {_count}, {_count2}, true)
- while {animation.%{_p}%} is true:
- wait 1 tick
- delete {animation.%{_p}%}
- format gui slot 13 of {_p} with {_random} to do nothing
- play sound "entity.experience_orb.pickup" with volume 10 and pitch 5 at {_p} for all players
- delete {crates.closed.%{_p}%}
- remove {_p} from {crates.openinglist::*}
- delete {crate.%{_p}%.inv::*}
- delete {crate.%{_p}%.name}
- delete {crates.opening.%{_p}%}
- remove 1 from {keys.%{_p}%.%{_crate}%}
- set {_name} to name of {_random}
- launch ball coloured aqua and blue at {_p}'s location timed 0.9
- give {_p} {_random}
- send "{@lobby} You've won &a%{_name}%&2!" to {_p}
- else:
- send "{@lobby} &4You don't have anough keys to do this!" to {_p}
- play sound "entity.item.break" with volume 10 and pitch 1 at {_p} for {_p}
- function editCosFormat(p: Player, piece: String, pieceText: String) :: item:
- set {_item} to ("barrier" parsed as an item)
- if {cosmetics.edit.%{_p}%.%{_piece}%} is set:
- if {cosmetics.edit.%{_p}%.%{_piece}%} parsed as an item is set:
- set {_item} to ({cosmetics.edit.%{_p}%.%{_piece}%} parsed as an item)
- if {cosmetics.edit.%{_p}%.%{_piece}%.name} is set:
- set name of {_item} to {cosmetics.edit.%{_p}%.%{_piece}%.name}
- else:
- set name of {_item} to "&2%{_pieceText}%"
- if {cosmetics.edit.%{_p}%.%{_piece}%.lore} is set:
- set lore of {_item} to {cosmetics.edit.%{_p}%.%{_piece}%.lore}
- else:
- set name of {_item} to "&4%{_pieceText}%"
- return {_item}
- function editCos(p: Player, type: String):
- set {cosmetics.edit.%{_p}%.type} to {_type}
- open chest with 1 rows named "&8Choose Category" to {_p}
- set {_count} to 0
- if {@particles} is true:
- format gui slot {_count} of {_p} with redstone named "&cParticle" to do nothing
- add 1 to {_count}
- if {@heads} is true:
- format gui slot {_count} of {_p} with skull of {_p} named "&2Heads" to do nothing
- add 1 to {_count}
- if {@suits} is true:
- format gui slot {_count} of {_p} with golden helmet named "&5Suits" to close then run function editSuit({_p}, {_type})
- add 1 to {_count}
- if {_count} is 0:
- format gui slot 0 of {_p} with barrier named "&4None Enabled" to close
- function editSuit(p: Player, type: String):
- #=========== Variables ===========
- set {cosmetics.edit.%{_p}%.type} to {_type}
- if {cosmetics.edit.%{_p}%.crate} is not set:
- set {cosmetics.edit.%{_p}%.crate} to ""
- set {_helmet} to editCosFormat({_p}, "helmet", "Helmet")
- set {_chestplate} to editCosFormat({_p}, "chestplate", "Chestplate")
- set {_leggings} to editCosFormat({_p}, "leggings", "Leggings")
- set {_boots} to editCosFormat({_p}, "boots", "Boots")
- #=========== GUI ===========
- open chest with 6 rows named "&8Edit" to {_p}
- if {cosmetics.edit.%{_p}%.type} is "":
- format gui slot 18 of {_p} with a paper named "&7Type: &c<none>" to run:
- set {cosmetics.edit.%{_p}%} to "setType"
- close {_p}'s inventory
- send "{@lobby} Type the new type of your set in the chat" to {_p}
- else:
- format gui slot 18 of {_p} with a paper named "&7Type: &e%{cosmetics.edit.%{_p}%.type}%" to run:
- close {_p}'s inventory
- set {cosmetics.edit.%{_p}%} to "setType"
- send "{@lobby} Type the new type of your set in the chat" to {_p}
- if {cosmetics.edit.%{_p}%.crate} is "":
- format gui slot 27 of {_p} with a chest named "&7Crate: &c<none>" to run:
- set {cosmetics.edit.%{_p}%} to "setCrate"
- close {_p}'s inventory
- send "{@lobby} Type the new crate of your set in the chat" to {_p}
- else:
- format gui slot 27 of {_p} with a chest named "&7Crate: &e%{cosmetics.edit.%{_p}%.crate}%" to run:
- set {cosmetics.edit.%{_p}%} to "setCrate"
- close {_p}'s inventory
- send "{@lobby} Type the new crate of your set in the chat" to {_p}
- format gui slot 10 of {_p} with {_helmet} to close then run function editPiece({_p}, "helmet", "Helmet", {cosmetics.edit.%{_p}%.type})
- format gui slot 19 of {_p} with {_chestplate} to close then run function editPiece({_p}, "chestplate", "Chestplate", {cosmetics.edit.%{_p}%.type})
- format gui slot 28 of {_p} with {_leggings} to close then run function editPiece({_p}, "leggings", "Leggings", {cosmetics.edit.%{_p}%.type})
- format gui slot 37 of {_p} with {_boots} to close then run function editPiece({_p}, "boots", "Boots", {cosmetics.edit.%{_p}%.type})
- #Option to set the crate, if the crate doesn't exists it sends a message
- #When pressing 'back' and then go back to the item it resets the item.
- #Set item instead of barrier if the item is set
- function editPiece(p: Player, piece: String, pieceText: String, type: String):
- wait 3 ticks
- #=========== Variables ===========
- set {cosmetics.edit.%{_p}%.current} to "%{_piece}%"
- set {cosmetics.edit.%{_p}%.pieceText} to "%{_pieceText}%"
- set {_item} to editCosFormat({_p}, "%{_piece}%", "%{_pieceText}%")
- if {cosmetics.edit.%{_p}%.%{_piece}%} is not set:
- set {cosmetics.edit.%{_p}%.%{_piece}%} to ""
- #=========== GUI ===========
- open chest with 3 rows named "&8Edit %{_pieceText}%" to {_p}
- format gui slot 10 of {_p} with {_item} to do nothing
- #item, name and lore (lore || -> new line (also in message!!!))
- format gui slot 18 of {_p} with arrow named "&c<< Go Back" to close then run function editSuit({_p}, {_type})
- if {cosmetics.edit.%{_p}%.%{_piece}%} is "":
- format gui slot 12 of {_p} with an item frame named "&7Item: &c<none>" to run:
- set {cosmetics.edit.%{_p}%} to "set%{_pieceText}%Item"
- close {_p}'s inventory
- send "{@lobby} Type the new crate of the %{_piece}% in the chat" to {_p}
- else:
- format gui slot 12 of {_p} with an item frame named "&7Item: &e%{cosmetics.edit.%{_p}%.%{_piece}%}%" to run:
- set {cosmetics.edit.%{_p}%} to "set%{_pieceText}%Item"
- close {_p}'s inventory
- send "{@lobby} Type the new crate of the %{_piece}% in the chat" to {_p}
- #format gui slot 12 of {_p} with
- #if {_helmet} is "":
- #{cosmetics.edit.%player%.type}
- #if {_type} is "":
- #set {_type} to {cosmetics.edit.%player%.type}
- #if {_type} is "":
- # format gui slot 10 of {_p} with barrier named "&4Helmet" to run:
- # send "{@lobby} Type the type of your helmet in chat" to {_p}
- # set {cosmetics.edit.%{_p}%} to "helmetItem"
- # close {_p}'s inventory
- #
- #
- # else if yml file "{@helmetPath}" doesn't exist:
- # if yml file "{@suitPath}" doesn't exist:
- # format gui slot 10 of {_p} with barrier named "&4Helmet" to run:
- # send "{@lobby} Type the type of your helmet in chat" to {_p}
- # set {cosmetics.edit.%{_p}%} to "helmetItem"
- # close {_p}'s inventory
- #else:
- # #Item variable, Name variable, Lore variable, Enchantment list variable
- # format gui slot 10 of {_p} with ({cosmetics.edit.%player%.type} parsed as an item type) named "&aHelmet" to run:
- # send "{@lobby} Type the type of your helmet in chat" to {_p}
- # set {cosmetics.edit.%{_p}%} to "helmetItem"
- # close {_p}'s inventory
- #------------------- Periotic Events -------------------
- #------------------- Events -------------------
- on enable:
- if file "{@config}" doesn't exist:
- create file "{@config}"
- set yml value "Lobby.Crates.Animations.Window1" of file "Files/Lobby/config.yml" to true
- set yml value "Lobby.Crates.Animations.Random.Enabled" of file "Files/Lobby/config.yml" to true
- set yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "Files/Lobby/config.yml" to "Window1"
- set yml value "Lobby.Crates.Particles.Enabled" of file "Files/Lobby/config.yml" to true
- set yml value "Lobby.Crates.Heads.Enabled" of file "Files/Lobby/config.yml" to true
- set yml value "Lobby.Crates.Suits.Enabled" of file "Files/Lobby/config.yml" to true
- else:
- if yml value "Lobby.Crates.Animations.Window1" of file "Files/Lobby/config.yml" is not set:
- set yml value "Lobby.Crates.Animations.Window1" of file "Files/Lobby/config.yml" to true
- if yml value "Lobby.Crates.Animations.Random.Enabled" of file "Files/Lobby/config.yml" is not set:
- set yml value "Lobby.Crates.Animations.Random.Enabled" of file "Files/Lobby/config.yml" to true
- if yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "Files/Lobby/config.yml" is not set:
- set yml value "Lobby.Crates.Animations.Random.DisabledAnimation" of file "Files/Lobby/config.yml" to "Window1"
- if yml value "Lobby.Crates.Particles.Enabled" of file "Files/Lobby/config.yml" is not set:
- set yml value "Lobby.Crates.Particles.Enabled" of file "Files/Lobby/config.yml" to true
- if yml value "Lobby.Crates.Heads.Enabled" of file "Files/Lobby/config.yml" is not set:
- set yml value "Lobby.Crates.Heads.Enabled" of file "Files/Lobby/config.yml" to true
- if yml value "Lobby.Crates.Suits.Enabled" of file "Files/Lobby/config.yml" is not set:
- set yml value "Lobby.Crates.Suits.Enabled" of file "Files/Lobby/config.yml" to true
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- set {_world} to world of {lobby.location}
- loop {lobbycr.%loop-value%.location::*}:
- set {holo-crate-%{_world}%-%loop-value-2%} to a new hologram at block above loop-value-2
- add text "&a&l%loop-value-1%" to hologram {holo-crate-%{_world}%-%loop-value-2%}
- on disable:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- set {_world} to world of {lobby.location}
- loop {_list::*}:
- delete yml list "Locations" of file "{@path}/%loop-value%.yml"
- loop {lobbycr.%loop-value%.location::*}:
- add "%loop-value-2%" to yml list "Locations" of file "{@path}/%loop-value-1%.yml"
- unregister hologram {holo-crate-%{_world}%-%loop-value-2%}
- loop {crates.openinglist::*}:
- clear {crates.opening.%loop-value%}
- clear {crates.%loop-value%.inv::*}
- clear {crates.%loop-value%.name}
- clear {crate.closed.%loop-value%}
- clear {crates.openinglist::*}
- on join:
- if {lobby.location} is set:
- teleport player to {lobby.location}
- set join message to ""
- wait 10 ticks
- clear player's inventory
- send "{@lobby} &fThe player %player% has joined!" to all players in world of player
- set slot 4 of player to a compass named "{@lcompass}"
- on quit:
- if {crates.opening.%player%} is set:
- clear {crates.opening.%player%}
- clear {crates.%player%.inv::*}
- clear {crates.%player%.name}
- clear {crates.closed.%player%}
- remove player from {crates.openinglist::*}
- on command:
- command is "plugins" or "pl":
- cancel event
- if player is not op:
- stop
- else:
- set {_list::*} to list of plugins
- set {_count} to 0
- loop {_list::*}:
- add 1 to {_count}
- send "{@logo} Plugin list:%nl%&f(&a%{_count}%&f) &2%list of plugins%"
- else:
- set {cmd} to "%command to lower case%"
- on damage:
- if world of victim is world of {lobby.location}:
- if damage cause is "void" parsed as a damage cause:
- set victim's health to 0
- else:
- cancel event
- on death:
- if world of player is world of {lobby.location}:
- set death message to ""
- on respawn:
- if world of player is world of {lobby.location}:
- set slot 4 of player to a compass named "{@lcompass}"
- teleport player to {lobby.location}
- on inventory click:
- if player is in world of {lobby.location}:
- if clicked item is a compass named "{@lcompass}":
- cancel event
- close player's inventory
- openCompass(player)
- on click:
- if player is in world of {lobby.location}:
- if player's held item is a compass named "{@lcompass}":
- cancel event
- openCompass(player)
- on place of chest:
- set {_world} to world of event-block
- if {_world} is world of {lobby.location}:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- if contains({_list::*}, "%uncolored name of player's tool%"):
- add location of block at event-block to {lobbycr.%uncolored name of player's tool%.location::*}
- add world of event-block to {lobbycr.%uncolored name of player's tool%.world::*}
- set {holo-crate-%world of event-block%-%location of event-block%} to new hologram at location 1 meters above event-block
- add text "&a&l%uncolored name of player's tool%" to hologram {holo-crate-%world of event-block%-%location of event-block%}
- add "%location of block at event-block%" to yml list "Locations" of file "{@path}/%uncolored name of player's tool%.yml"
- send "{@lobby} &2Succesfully created a &a%uncolored name of player's tool% &2Crate!"
- on break of chest:
- set {_world} to world of event-block
- if {_world} is world of {lobby.location}:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- loop {lobbycr.%loop-value-1%.location::*}:
- if loop-value-2 is location of event-block:
- remove location of block at event-block from {lobbycr.%loop-value-1%.location::*}
- remove world of event-block from {lobbycr.%loop-value-1%.world::*}
- unregister hologram {holo-crate-%world of event-block%-%location of event-block%}
- delete {holo-crate-%world of event-block%-%location of event-block%}
- remove "%location of event-block%" from yml list "Locations" of file "{@path}/%loop-value-1%.yml"
- send "{@lobby} &2Succesfully removed a &a%loop-value-1% &2Crate!"
- on rightclick on a chest:
- set {_world} to world of clicked block
- if {_world} is "%world of {lobby.location}%":
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- loop {lobbycr.%loop-value-1%.location::*}:
- if "%loop-value-2%" is "%location of clicked block%":
- cancel event
- if "%uncolored {crate.%player%.name}%" = loop-value-1:
- if {crates.opening.%player%} is true:
- open chest with 3 rows named "&2%{crate.%player%.name}%" to player
- set {crates.reopening.%player%} to true
- set {_count} to 0
- loop 27 times:
- if {crate.%player%.inv::%{_count}%} is set:
- set {_value} to "%{crate.%player%.inv::%{_count}%}%"
- set {_color::*} to {_value} split at " "
- if contains({_color::*}, "glass") is true:
- if contains({_color::*}, "light") is true:
- format gui slot {_count} of player with ("light %{_color::2}% stained glass pane" parsed as an item) to do nothing
- else if contains({_color::*}, "dark") is true:
- format gui slot {_count} of player with ("dark %{_color::2}% stained glass pane" parsed as an item) to do nothing
- else:
- format gui slot {_count} of player with ("%{_color::1}% stained glass pane" parsed as an item) to do nothing
- else:
- format gui slot {_count} of player with ({crate.%player%.inv::%{_count}%} parsed as an item) to do nothing
- add 1 to {_count}
- delete {crates.closed.%player%}
- delete {crates.openinglist::*}
- delete {crate.%player%.inv::*}
- delete {crate.%player%.name}
- else:
- open chest with 3 rows named "&2%loop-value-1%" to player
- 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%")
- stop loop
- else:
- open chest with 3 rows named "&2%loop-value-1%" to player
- 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%")
- stop loop
- on inventory close:
- if {crates.opening.%player%} is true:
- set {crates.closed.%player%} to true
- add player to {crates.openinglist::*}
- clear {crate.%player%.inv::*}
- set {crate.%player%.name} to name of player's current inventory
- set {_count} to 0
- loop 27 times:
- set {crate.%player%.inv::%{_count}%} to slot {_count} of player's current inventory
- add 1 to {_count}
- else if {crates.opening.%player%} is set:
- delete {crates.opening.%player%}
- if name of current inventory of player is "&8Edit" or "&8Edit Helmet" or "&8Choose Category":
- if {cosmetics.edit.%player%} is not set:
- set {_piece} to ("%{cosmetics.edit.%player%.pieceText}%" to lower case)
- delete {cosmetics.edit.%player%.%{_piece}%}
- delete {cosmetics.edit.%player%.type}
- delete {cosmetics.edit.%player%.current}
- delete {cosmetics.edit.%player%.crate}
- delete {cosmetics.edit.%player%.pieceText}
- on chat:
- if {cosmetics.edit.%player%} is set:
- cancel event
- if {cosmetics.edit.%player%} is "set%{cosmetics.edit.%player%.pieceText}%Item":
- if "%message%" is "cancel":
- send "{@lobby} Cancelled setting the item."
- editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
- delete {cosmetics.edit.%player%}
- else if "%message%" parsed as an item type is not set:
- send "{@lobby} &c%message% &4is not a a %{cosmetics.edit.%player%.pieceText} to lower case%!"
- else:
- if {cosmetics.edit.%player%.type} is not set:
- set {cosmetics.edit.%player%.type} to ""
- set {_var} to "%message%"
- replace all " " in {_var} with "_"
- if {_var} contains "_":
- set {_message::*} to {_var} split at "_"
- if ({cosmetics.edit.%player%.pieceText} to lower case) is "helmet":
- set {_piece} to ("%{cosmetics.edit.%player%.pieceText}%" to lower case)
- if contains({_message::*}, "helmet"):
- set {cosmetics.edit.%player%.%{_piece}%} to ("%message%" parsed as an item)
- else if "%message%" = "head":
- set {cosmetics.edit.%player%.%{_piece}%} to "head"
- else if contains({_message::*}, "head"):
- set {cosmetics.edit.%player%.%{_piece}%} to "head"
- send "{@lobby} Succesfully set item to &a%message%"
- editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
- delete {cosmetics.edit.%player%}
- #else if ({cosmetics.edit.%player%.pieceText} to lower case) is "chestplate":
- #else if ({cosmetics.edit.%player%.pieceText} to lower case) is "leggings":
- #else if ({cosmetics.edit.%player%.pieceText} to lower case) is "boots":
- else:
- send "{@lobby} &c%message% &4is not a helmet!"
- else if {cosmetics.edit.%player%} is "setType":
- if "%message%" is "cancel":
- send "{@lobby} Cancelled setting the type."
- editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
- delete {cosmetics.edit.%player%}
- set {cosmetics.edit.%player%.type} to "%message%"
- delete {cosmetics.edit.%player%}
- send "{@lobby} Succesfully set type to &a%message%"
- editSuit(player, {cosmetics.edit.%player%.type})
- else if {cosmetics.edit.%player%} is "setCrate":
- if "%message%" is "cancel":
- send "{@lobby} Cancelled setting the crate."
- editPiece(player, {cosmetics.edit.%player%.current}, {cosmetics.edit.%player%.pieceText}, {cosmetics.edit.%player%.type})
- delete {cosmetics.edit.%player%}
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- if contains({_list::*}, "%message to lower case%"):
- set {cosmetics.edit.%player%.crate} to "%message to lower case%"
- editSuit(player, {cosmetics.edit.%player%.type})
- delete {cosmetics.edit.%player%}
- else:
- send "{@lobby} &c%message% &4is not a valid crate!"
- else if world of player is world of {lobby.location}:
- cancel event
- send "&7[&e%player%&7] &8>> &f%message%" to all players in world of player
- send "&7[&eLobby&7][&e%player%&7] &f>> %message%" to console
- #------------------- Commands -------------------
- command /lobby [<text>] [<text>]:
- aliases: /hub
- trigger:
- if player has permission "lobby.*":
- if arg-1 is set:
- if arg-1 is "help":
- send "&2----------[ &a%{cmd}% &2]----------"
- send "&e&o/%{cmd}% help &d→ &fGet the help page"
- send "&e&o/%{cmd}% set &d→ &fSet the lobby"
- send "&2----------[ &a%{cmd}% &2]----------"
- else if arg-1 is "set":
- send "{@logo} &2Succesfully set the &a%{cmd}% &2to your location!"
- set {lobby.location} to location of player
- else:
- if {lobby.location} is set:
- if world of player is not "%world of {lobby.location}%":
- teleport player to {lobby.location}
- send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
- clear player's inventory
- set slot 4 of player to a compass named "{@lcompass}"
- else:
- teleport player to {lobby.location}
- else:
- send "{@lobby} &cThe %{cmd}% is not set yet!"
- else if {lobby.location} is set:
- if world of player is not "%world of {lobby.location}%":
- teleport player to {lobby.location}
- send "{@lobby} &fThe player %player% went to the lobby!" to all players in world of player
- clear player's inventory
- set slot 4 of player to a compass named "{@lcompass}"
- else:
- teleport player to {lobby.location}
- else:
- send "{@lobby} &cThe %{cmd}% is not set yet!"
- command /lobbycompass [<text>] [<text>] [<text>]:
- aliases: /lcomp, /lcompass
- trigger:
- if player has permission "lobbycompass.*":
- if arg 1 is not set:
- send "{@lobby} &4Do &c&o/%{cmd}% help &4for more info."
- else if arg 1 is set:
- if arg 1 is "help":
- send "&2----------[ &a%{cmd}% &2]----------"
- send "&e&o/%{cmd}% help &d→ &fKrijg help pagina"
- send "&e&o/%{cmd}% create <minigame> &d→ &fCreate a minigame"
- send "&e&o/%{cmd}% remove/delete <minigame> &d→ &fDelete a minigame"
- send "&e&o/%{cmd}% setspawn <minigame> &d→ &fSet the spawn of a minigame"
- send "&e&o/%{cmd}% slot <minigame> <number> &d→ &fSet the GUI slot of a minigame"
- send "&e&o/%{cmd}% setname <minigame> <name> &d→ &fSet a name"
- send "&e&o/%{cmd}% deletename <minigame> &d→ &fDelete the name of a minigame"
- send "&e&o/%{cmd}% setlore <minigame> <lore> &d→ &fSet a lore"
- send "&e&o/%{cmd}% deletelore <minigame> <minigame> &d→ &fDelete the lore of a minigame"
- send "&e&o/%{cmd}% setitem <minigame> <item> &d→ &fSet the item of a minigame"
- send "&e&o/%{cmd}% list &d→ &fGet a list of all the minigames"
- send "&e&o/%{cmd}% setrows <number> &d→ &fSet the amount of rows in the GUI"
- send "&e&o/%{cmd}% gui <minigame> &d→ &fOpen the config-GUI"
- send "&2----------[ &a%{cmd}% &2]----------"
- else if arg 1 is "create":
- if arg 2 is set:
- if {lobby.minigames.%arg 2%} is not set:
- set {lobby.minigames.%arg 2%} to true
- set {lobby.minigames.%arg 2%.name} to "&cNone"
- set {lobby.minigames.%arg 2%.lore} to "&cNone"
- set {lobby.minigames.%arg 2%.item} to "&cNone"
- set {lobby.minigames.%arg 2%.slot} to "&cNone"
- set {lobby.minigames.%arg 2%.spawn} to "&cNone"
- add arg 2 to {lobby.minigames.list::*}
- send "{@lobby} &2Succesfully made the minigame &a%arg 2%&2!"
- else:
- send "{@lobby} &4The minigame &c%arg 2% &4already exists!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1% <minigame>&4."
- else if arg 1 is "delete" or "remove":
- if arg 2 is set:
- if {lobby.minigames.%arg 2%} is set:
- delete {lobby.minigames.%arg 2%}
- delete {lobby.minigames.%arg 2%.name}
- delete {lobby.minigames.%arg 2%.lore}
- delete {lobby.minigames.%arg 2%.item}
- delete {lobby.minigames.%arg 2%.slot}
- delete {lobby.minigames.%arg 2%.spawn}
- remove arg 2 from {lobby.minigames.list::*}
- send "{@lobby} &2Succesfully removed the minigame &a%arg 2%&2!"
- else:
- send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
- else if arg 1 is "setspawn":
- if arg 2 is set:
- if {lobby.minigames.%arg 2%} is set:
- set {lobby.minigames.%arg 2%.spawn} to location of player
- send "{@lobby} &2Succesfully set the spawn of the minigame%nl%&a%arg 2% &2arg &a%location of player%&2!"
- else:
- send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
- else if arg 1 is "slot":
- if arg 2 is set:
- if {lobby.minigames.%arg 2%} is set:
- if arg 3 is set:
- if (arg 3 parsed as a number) is set:
- if {lobby.compassRows} is not set:
- set {lobby.compassRows} to 1
- if {lobby.compassRows} < 1:
- set {lobby.compassRows} to 1
- if {lobby.compassRows}*9-1 < arg-3 parsed as a number:
- send "{@lobby} &4The amount &c%arg 3% &4is to large bacause the max amount of slots is &c%{lobby.compassRows}*9+1%&4!"
- else:
- loop {lobby.minigames.list::*}:
- if {lobby.minigames.%loop-value%.slot} is arg 3:
- set {_set} to loop-value
- stop loop
- if {_set} is set:
- send "{@lobby} &4The slot &c%arg 3% &4is already in use by the minigame &c%{_set}%&4!"
- else:
- set {lobby.minigames.%arg 2%.slot} to arg 3
- send "{@lobby} &2Succesfully set the slot of the minigame &a%arg 2% &2to &a%arg 3%&2!"
- else:
- send "{@lobby} &c%arg 3% &4is not a number!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <number>&4."
- else:
- send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <number>&4."
- else if arg 1 is "setname":
- if arg 2 is set:
- if {lobby.minigames.%arg 2%} is set:
- if arg 3 is set:
- set {lobby.minigames.%arg 2%.name} to arg 3
- send "{@lobby} &2Succesfully set the name of the minigame &a%arg 2% &2to &a%arg 3%&2!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <name>&4."
- else:
- send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
- else if arg 1 is "delname" or "deletename":
- if arg 2 is set:
- delete {lobby.minigames.%arg 2%.name}
- send "{@lobby} &2Succesfully deleted the name from the minigame &a%arg 2%&2!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
- else if arg 1 is "setlore":
- if arg 2 is set:
- if {lobby.minigames.%arg 2%} is set:
- if arg 3 is set:
- set {lobby.minigames.%arg 2%.lore} to arg 3
- send "{@lobby} &2Succesfully set the lore of the minigame &a%arg 2% &2to &a%arg 3%&2!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <lore>&4."
- else:
- send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <lore>&4."
- else if arg 1 is "dellore" or "deletelore":
- if arg 2 is set:
- if {lobby.minigames.%arg 2%} is set:
- delete {lobby.minigames.%arg 2%.lore}
- send "{@lobby} &2Succesfully deleted the lore from the minigame &a%arg 2%&2!"
- else:
- send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <name>&4."
- else if arg 1 is "setitem":
- if arg 2 is set:
- if {lobby.minigames.%arg 2%} is set:
- if arg 3 is set:
- if (arg 3 parsed as an item) is set:
- set {lobby.minigames.%arg 2%.item} to arg 3 parsed as an item
- send "{@lobby} &2Succesfully set the item from the minigame &a%arg 2% &2to &a%arg 3%&2!"
- else:
- send "{@lobby} &c%arg 3% &4is not an item!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% %arg 2% <item>&4."
- else:
- send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame> <item>&4."
- else if arg 1 is "list":
- if {lobby.minigames.list::*} is not empty:
- loop {lobby.minigames.list::*}:
- if {_list} is set:
- set {_list} to "%{_list}%&2, &a%loop-value%"
- else:
- set {_list} to "%loop-value%"
- else:
- set {_list} to "Geen"
- send "{@lobby} &2This is the list of all the minigames:%nl%&a%{_list}%"
- else if arg 1 is "setrows":
- if arg 2 is set:
- if (arg 2 parsed as a number) is set:
- if (arg-2 parsed as a number) < 7:
- set {lobby.compassRows} to (arg-2 parsed as a number)
- send "{@lobby} &2Succesfully set the amount of rows to &a%arg 2%&2!"
- else:
- send "{@lobby} &4The max amount of rows is &c6&4!"
- else:
- send "{@lobby} &c%arg 2% &4is not a number!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <number>&4."
- else if arg 1 is "gui":
- if arg 2 is set:
- if {lobby.minigames.%arg 2%} is set:
- open chest with 2 rows named "&7Config GUI" to player
- set {_name} to {lobby.minigames.%arg 2%.name}
- replace "&" in {_name} with "§"
- set {_lore} to {lobby.minigames.%arg 2%.lore}
- replace "&" in {_lore} with "§"
- format gui slot 2 of player with a book named "&2Minigame: &a%arg-2%" to do nothing
- 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)
- 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)
- 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)
- 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)
- 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)
- format gui slot 13 of player with a barrier named "&cClose menu" to close
- 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)
- else:
- send "{@lobby} &4The minigame &c%arg 2% &4doesn't exist!"
- else:
- send "{@lobby} &4Command not used correct! &c&o/%{cmd}% %arg 1 to lower case% <minigame>&4."
- else:
- send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
- command /lobbycrate [<text>] [<text>]:
- aliases: /lobbycr, /lcrate
- trigger:
- if player is in world of {lobby.location}:
- if player has permission "votecrate.*":
- if arg-1 is set:
- if arg-1 is "help":
- send "&2----------[ &a%{cmd}% &2]----------"
- send "&e&o/%{cmd}% help &d→ &fGet the help page"
- send "&e&o/%{cmd}% list &d→ &fGet a list with all crates"
- send "&e&o/%{cmd}% create <crate> &d→ &fCreate a create"
- send "&e&o/%{cmd}% delete/remove <crate> &d→ &fDelete a crate"
- send "&e&o/%{cmd}% path <crate> &d→ &fGet the edit path of a crate"
- send "&e&o/%{cmd}% get <crate> &d→ &fGet a crate"
- send "&2----------[ &a%{cmd}% &2]----------"
- else if arg-1 is "list":
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- if {_list::*} is not empty:
- loop {_list::*}:
- if {_list} is set:
- set {_list} to "%{_list}%&2, &a%loop-value%"
- else:
- set {_list} to "%loop-value%"
- send "{@lobby} &2There are the following crates:%nl%&a%{_list}%"
- else:
- send "{@lobby} &2There are no crates made yet."
- else if arg-1 is "create":
- if arg-2 is set:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- set {_arg2} to "%arg-2 to lower case%"
- if contains({_list::*}, {_arg2}):
- send "{@lobby} &4The crate &c%{_arg2}% &4already exists!"
- else:
- send "{@lobby} &2Making the crate &a%{_arg2}%&2..."
- add {_arg2} to yml list "Lobby.Crates.List" of file "{@config}"
- create file "{@path}/%{_arg2}%.yml"
- add "diamond_sword" to yml list "Item.List" of file "{@path}/%{_arg2}%.yml"
- add "diamond_sword-1" to yml list "Item.ConfigName" of file "{@path}/%{_arg2}%.yml"
- set yml value "Item.Chance.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "100"
- set yml value "Item.Name.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to "&aDiamond Sword"
- set yml value "Item.Amount.diamond_sword-1" of file "{@path}/%{_arg2}%.yml" to 1
- add "This is a lore" to yml list "Item.Lore.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
- add "sharpness:1" to yml list "Item.Enchants.diamond_sword-1" of file "{@path}/%{_arg2}%.yml"
- send "{@lobby} &2Succesfully made the crate &a%{_arg2}%&2!"
- else:
- send "{@lobby} &4You need to give up a &cname &4for the crate!"
- else if arg-1 is "delete" or "remove":
- if arg-2 is set:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- set {_arg2} to "%arg-2 to lower case%"
- if contains({_list::*}, {_arg2}):
- send "{@lobby} &2Deleting the crate &a%{_arg2}%&2..."
- remove "%{_arg2}%" from yml list "Lobby.Crates.List" of file "{@config}"
- delete file "{@path}/%{_arg2}%.yml"
- send "{@lobby} &2Succesfully deleted the crate &a%{_arg2}%&2!"
- else:
- send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
- else:
- send "{@lobby} &4You need to give up a &cname &4of the crate you want to delete!"
- else if arg-1 is "path":
- if arg-2 is set:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- set {_arg2} to "%arg-2 to lower case%"
- if contains({_list::*}, {_arg2}):
- send "{@lobby} &2Location of %{_arg2}%: &a{@path}/%{_arg2}%&2."
- else:
- send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exists!"
- else:
- send "{@lobby} &4You need to give up a &cname &4of the crate you want to get the path of!"
- else if arg-1 is "get":
- if arg 2 is set:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- set {_arg2} to "%arg-2 to lower case%"
- if contains({_list::*}, {_arg2}):
- send "{@lobby} &2Here you have the &a%{_arg2}% &2crate!%nl%&2Place it to create a chest."
- give player 1 chest named "&e%{_arg2}%" with lore "&7Place to create a crate!"
- else:
- send "{@lobby} &4The crate &c%{_arg2}% &4doesn't exist!"
- else:
- send "{@lobby} &4You must give up a crate type!"
- else:
- send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
- else:
- send "{@lobby} &4Do &c/%{cmd}% help &4for more info."
- command /key [<text>] [<text>] [<text>] [<text>]:
- trigger:
- if player has permission "key.*":
- if arg-1 is set:
- if arg-1 is "help":
- send "&2----------[ &a%{cmd}% &2]----------"
- send "&e&o/%{cmd}% help &d→ &fGet the help page"
- send "&e&o/%{cmd}% get <crate/all> [number] &d→ &fGet a crate"
- send "&e&o/%{cmd}% give <player> <crate/all> [number] &d→ &fGive a key to open a crate to a player"
- send "&e&o/%{cmd}% remove <all/crate> [number] [player] &d→ &fRemove a key from a player"
- send "&e&o/%{cmd}% clear <all/crate> [player] &d→ &fClear the keys from a player"
- send "&e&o/%{cmd}% keys <all/crate> [player] &d→ &fGet the amount of keys from a player"
- send "&2----------[ &a%{cmd}% &2]----------"
- else if arg-1 is "get":
- if arg-2 is "all":
- if arg-3 is set:
- if (arg-3 parsed as a number) is set:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- set {_num} to arg-3 parsed as a number
- loop {_num} times:
- loop {_list::*}:
- add 1 to {keys.%player%.%loop-value-2%}
- send "{@lobby} &2You have recieved all the &a%arg-3% &2times!"
- else:
- send "{@lobby} &c%arg-3% &4is not a number!"
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- add 1 to {keys.%player%.%loop-value%}
- send "{@lobby} &2You have recieved all keys!"
- else if arg-2 is set:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- if contains({_list::*}, "%arg-2 to lower case%"):
- if arg-3 is set:
- if (arg-3 parsed as a number) is set:
- add (arg-3 parsed as a number) to {keys.%player%.%arg-2 to lower case%}
- send "{@lobby} &2You have recieved &a%arg-2 to lower case% &2key &a%arg-3% &2times!"
- else:
- send "{@lobby} &c%arg-3% &4is not a number!"
- else:
- add 1 to {keys.%player%.%arg-2 to lower case%}
- send "{@lobby} &2You have recieved a &a%arg-2 to lower case% &2key!"
- else:
- send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
- else:
- send "{@lobby} &4You must give up a &ccrate&4!"
- else if arg-1 is "give":
- if arg-2 is set:
- if (arg-2 parsed as a player) is set:
- if arg-3 is set:
- if arg-3 is "all":
- if arg-4 is set:
- if (arg-4 parsed as a number) is set:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- set {_num} to arg-4 parsed as a number
- loop {_num} times:
- loop {_list::*}:
- add 1 to {keys.%arg-2 parsed as a player%.%loop-value-2%}
- send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys &a%arg-4% &2times!"
- send "{@lobby} &2You have recieved all the keys &a%arg-4% &2times!" to arg-2 parsed as a player
- else:
- send "{@lobby} &c%arg-3% &4is not a number!"
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- add 1 to {keys.%arg-2 parsed as a player%.%loop-value%}
- send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2all the keys!"
- send "{@lobby} &2You have recieved all the keys!" to arg-2 parsed as a player
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- if contains({_list::*}, "%arg-3 to lower case%"):
- if arg-4 is set:
- if (arg-4 parsed as a number) is set:
- add (arg-4 parsed as a number) to {keys.%arg-2%.%arg-3 to lower case%}
- 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!"
- send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key &a%arg-4% &2times!" to arg-2 parsed as a player
- else:
- send "{@lobby} &c%arg-3% &4is not a number!"
- else:
- add 1 to {keys.%arg-2 parsed as a player%.%arg-3 to lower case%}
- send "{@lobby} &2Succesfully given &a%name of arg-2 parsed as a player% &2the &a%arg-3 to lower case% &2key!"
- send "{@lobby} &2You have recieved the &a%arg-3 to lower case% &2key!" to arg-2 parsed as a player
- else:
- send "{@lobby} &4The crate &c%arg-3 to lower case% &4doesn't exist!"
- else:
- send "{@lobby} &4You must give up a &ccrate&4!"
- else:
- send "{@lobby} &4The player &c%arg-2% &4is not online!"
- else:
- send "{@lobby} &4You must give up a &cplayer&4!"
- else if arg-1 is "remove":
- if arg-2 is set:
- if arg-2 is "all":
- if arg-3 is set:
- if (arg-3 parsed as a number) is set:
- if arg-4 is set:
- if (arg-4 parsed as a player) is set:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- set {_num} to arg-3 parsed as a number
- loop {_list::*}:
- if {keys.%arg-4 parsed as a player%.%loop-value%}-{_num} >= 0:
- remove {_num} from {keys.%name of arg-4 parsed as a player%.%loop-value%}
- else:
- set {keys.%arg-4 parsed as a player%.%loop-value%} to 0
- send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys of &a%name of arg-4 parsed as a player%&2!"
- send "{@lobby} &2Removed &a%arg-3% &2from your keys!" to arg-4 parsed as a player
- else:
- send "{@lobby} &4The player &c%arg-4% &4is not online!"
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- if {keys.%player%.%loop-value%}-(arg-3 parsed as a number) >= 0:
- remove (arg-3 parsed as a number) from {keys.%player%.%loop-value%}
- else:
- set {keys.%player%.%loop-value%} to 0
- send "{@lobby} &2Succesfully removed &a%arg-3% &2from all the keys!"
- else:
- send "{@lobby} &c%arg-3% &4is not a number!"
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- if {keys.%player%.%loop-value%}-1 >= 0:
- remove 1 from {keys.%player%.%loop-value%}
- send "{@lobby} &2Succesfully removed &a1 &2from all the keys"
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- if contains({_list::*}, "%arg-2 to lower case%"):
- if arg-3 is set:
- if (arg-3 parsed as a number) is set:
- if arg-4 is set:
- if (arg-4 parsed as a player) is set:
- if {keys.%arg-4 parsed as a player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
- remove (arg-3 parsed as a number) from {keys.%name of arg-4 parsed as a player%.%arg-2 to lower case%}
- else:
- set {keys.%arg-4 parsed as a player%.%arg-2 to lower case%} to 0
- send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys from &a%name of arg-4 parsed as a player%&2!"
- send "{@lobby} &a%arg-3% %arg-2 to lower case% &2keys have been removed!" to arg-4 parsed as a player
- else:
- send "{@lobby} &4The player &c%arg-4% &4is not online!"
- else:
- if {keys.%player%.%arg-2 to lower case%}-(arg-3 parsed as a number) >= 0:
- remove (arg-3 parsed as a number) from {keys.%player%.%arg-2 to lower case%}
- send "{@lobby} &2Succesfully removed &a%arg-3% %arg-2 to lower case% &2keys!"
- else:
- send "{@lobby} &c%arg-3% &4is not a number!"
- else:
- if {keys.%player%.%arg-2 to lower case%}-1 >= 0:
- remove 1 from {keys.%player%.%arg-2 to lower case%}
- send "{@lobby} &2Succesfully removed &a1 %arg-2 to lower case% &2keys!"
- else:
- send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist."
- else:
- send "{@lobby} &4You must give up a &ccrate&4!"
- else if arg-1 is "clear":
- if arg-2 is set:
- if arg-2 is "all":
- if arg-3 is set:
- if (arg-3 parsed as a player) is set:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- set {keys.%arg-3 parsed as a player%.%loop-value%} to 0
- send "{@lobby} &2Succesfully cleared &aall keys &2of &a%name of arg-3 parsed as a player%&2!"
- send "{@lobby} &aAll &2your &akeys &2have been cleared!" to arg-3 parsed as a player
- else:
- send "{@lobby} &4The player &c%arg-3% &4is not online!"
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- set {keys.%player%.%loop-value%} to 0
- send "{@lobby} &2You have cleared &aall &2your &akeys&2!"
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- if contains({_list::*}, "%arg-2 to lower case%"):
- if arg-3 is set:
- if (arg-3 parsed as a player) is set:
- set {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} to 0
- send "{@lobby} &2You have cleared the &a%arg-2 to lower case% keys &2from &a%name of arg-3 parsed as a player%&2!"
- send "{@lobby} &2Your &a%arg-2 to lower case% keys &2have been cleared!" to arg-3 parsed as a player
- else:
- send "{@lobby} &4The player &c%arg-3% &4is not online!"
- else:
- set {keys.%player%.%arg-2 to lower case%} to 0
- send "{@lobby} &2Succesfully cleared the &a%arg-2 to lower case% keys&2!"
- else:
- send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
- else:
- send "{@lobby} &4You must give up a &ccrate&4!"
- else if arg-1 is "keys":
- if arg-2 is set:
- if arg-2 is "all":
- if arg-3 is set:
- if (arg-3 parsed as a player) is set:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- if {keys.%arg-3 parsed as a player%.%loop-value%} is not set:
- set {keys.%arg-3 parsed as a player%.%loop-value%} to 0
- if {_keys} is not set:
- set {_keys} to "&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
- else:
- set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%name of arg-3 parsed as a player%.%loop-value%}%"
- send "{@lobby} &2This is the list of keys from &a%name of arg-3 parsed as a player%&2:%nl%%{_keys}%"
- else:
- send "{@lobby} &4The player &c%arg-3% &4is not online!"
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- loop {_list::*}:
- if {keys.%player%.%loop-value%} is not set:
- set {keys.%player%.%loop-value%} to 0
- if {_keys} is not set:
- set {_keys} to "&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
- else:
- set {_keys} to "%{_keys}%%nl%&2%loop-value%: &a%{keys.%player%.%loop-value%}%"
- send "{@lobby} &2This is your list of keys&2:%nl%%{_keys}%"
- else:
- set {_list::*} to yml list "Lobby.Crates.List" of file "{@config}"
- if contains({_list::*}, "%arg-2 to lower case%"):
- if arg-3 is set:
- if (arg-3 parsed as a player) is set:
- if {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} is not set:
- set {keys.%arg-3 parsed as a player%.%arg-2 to lower case%} to 0
- 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."
- else:
- send "{@lobby} &4The player &c%arg-3% &4is not online!"
- else:
- if {keys.%player%.%arg-2 to lower case%} is not set:
- set {keys.%player%.%arg-2 to lower case%} to 0
- send "{@lobby} &2You have &a%{keys.%player%.%arg-2 to lower case%}% %arg-2 to lower case% &2keys."
- else:
- send "{@lobby} &4The crate &c%arg-2 to lower case% &4doesn't exist!"
- else:
- send "{@lobby} &4You need to give up a &ccrate&4!"
- else:
- send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
- else:
- send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
- command /cosmetics [<text>] [<text>] [<text>]:
- aliases: /cos
- trigger:
- if player has permission "cosmetics.*":
- if arg-1 is not set:
- send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
- else if arg-1 is "help":
- send "&2----------[ &a%{cmd}% &2]----------"
- send "&e&o/%{cmd}% help &d→ &fGet the help page"
- send "&e&o/%{cmd}% gui [player] &d→ &fGet the cosmetics (of a player)"
- send "&e&o/%{cmd}% setup <type> &d→ &fCreate a cosmetic"
- send "&e&o/%{cmd}% edit [type] &d→ &fEdit a cosmetic"
- #send "&e&o/%{cmd}% delete [type] [name] &d→ &fDelete a cosmetic"
- send "&e&o/%{cmd}% path &d→ &fCreate your own cosmetics"
- send "&2----------[ &a%{cmd}% &2]----------"
- #else if arg-1 is "gui":
- # if arg-2 is set:
- # if arg-2 parsed as a player is set:
- #
- # else:
- # send "{@lobby} &4The player &c%arg-2% &4has never logged in."
- # else:
- else if arg-1 is "setup":
- if arg-2 is set:
- editCos(player, "%arg-2%")
- #open chest with 1 rows named "&8Cosmetics %arg-2%" to player
- #format gui slot 2 of player with nether star named "&fCreate" to close
- #format gui slot 4 of player with redstone torch on named "&fEdit" to close
- #format gui slot 6 of player with blaze powder named "&fDelete" to close
- else:
- editCos(player, "")
- #open chest with 1 rows named "&8Edit Cosmetics" to player
- #format gui slot 2 of player with nether star named "&fCreate" to close
- #format gui slot 4 of player with redstone torch on named "&fEdit" to close
- #format gui slot 6 of player with blaze powder named "&fDelete" to close
- else if arg-1 is "path":
- send "{@lobby} The path to edit your cosmetics is %nl%&a{@cosConfig} &2and to create cosmetics %nl%&a{@path}/Cosmetics/"
- else:
- send "{@lobby} &4Do &c/%{cmd}% help &4for more info!"
Add Comment
Please, Sign In to add comment