Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &8[&a&lUniverse&2&lHub&8]
- on load:
- set {kits::*} to "spiller", "yt1", "quito1", "king1" and "titan1"
- function toSmall(text: text) :: text:
- set {_big::*} to "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y" and "Z"
- set {_small::*} to "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y" and "z"
- loop {_big::*}:
- replace all "%loop-value%" with "%{_small::%loop-index%}%" in {_text}
- if {_text} is "youtube1":
- set {_text} to "yt1"
- return {_text}
- function startBig(text: text) :: text:
- set {_text::*} to {_text} split at ""
- set {_big::*} to "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y" and "Z"
- set {_small::*} to "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y" and "z"
- loop {_small::*}:
- replace all "%loop-value%" with "%{_big::%loop-index%}%" in {_text::1}
- set {_text} to ""
- loop {_text::*}:
- set {_text} to "%{_text}%%loop-value%"
- return {_text}
- function kitExists(kit: text) :: boolean:
- loop {kits::*}:
- if loop-value is {_kit}:
- return true
- return false
- command /savekit [<text>]:
- permission: *
- trigger:
- if arg 1 is set:
- set {_kit} to toSmall(arg 1)
- if kitExists({_kit}) is true:
- clear {kits.%{_kit}%::*}
- loop items in player's inventory:
- add loop-value to {kits.%{_kit}%::*}
- send "{@prefix} &7Du har gemt kittet&8: &a%startBig(arg 1)%"
- else:
- send "{@prefix} &7Kittet&8: &a%startBig(arg 1)%&7 eksistere ikke.."
- else:
- send "{@prefix} &7Venligst definér et kit.."
- on join:
- loop {kits::*}:
- if {kits.%uuid of player%.%loop-value%::*} isn't set:
- #set {kits.%uuid of player%.%loop-value%::*} to "%{kits.%loop-value%::*}%" parsed as items
- loop {kits.%loop-value%::*}:
- add loop-value to {kits.%uuid of player%.%loop-value%::*}
- set {_perm} to loop-value
- replace all "1" with "" in {_perm}
- if player has permission "%{_perm}%":
- set {kits.%uuid of player%.defaultKit} to loop-value
- if size of {kits.%uuid of player%.settings::*} is 0:
- set {kits.%uuid of player%.settings::autoSpawn} to true
- set {kits.%uuid of player%.settings::autoArmor} to true
- function getStatus(uuid: object, setting: text) :: text:
- set {_status} to "&c&lFRA"
- if {kits.%{_uuid}%.settings::%{_setting}%} is true:
- set {_status} to "&2&lTIL"
- return {_status}
- function kitConfig(uuid: object):
- set {_p} to player from {_uuid}
- if {kits.%{_uuid}%.defaultKit} is set:
- wait 3 ticks
- open chest with 3 row named "&8Konfigurer dit kit" to {_p}
- while uncolored inventory name of {_p}'s current inventory is "Konfigurer dit kit":
- wait 3 ticks
- if uncolored inventory name of {_p}'s current inventory is "Konfigurer dit kit":
- set slot 4 of {_p}'s current inventory to sign item named "&2&lKONFIGURER DIT KIT" with lore "&7&l&oVelkommen||&7&oHerinde kan du||&7&okonfigurére dit||&7&okit.||||&7&oHold musen over||&7&ode forskellige items||&7&ofor at se deres||&7&ofunktioner!" with no nbt
- set slot 10 of {_p}'s current inventory to name tag named "&2&lKIT RÆKKEFØLGE" with lore "&7&oHvilken rækkefølge||&7&oskal dit kit spawne||&7&omed?||||&7Klik på 2 items||&7for at bytte||&7rundt på dem||||&a&lKlik&7 for at ændre" with no nbt
- set slot 12 of {_p}'s current inventory to diamond chestplate named "&2&lAUTO ARMOR" with lore "&7Status&8: %getStatus({_uuid}, ""autoArmor"")%||||&7&oSkal du automatisk||&7&ospawne med dit armor?||||&a&lKlik&7 for at ændre" with no nbt
- set slot 14 of {_p}'s current inventory to clock named "&2&lAUTO SPAWN" with lore "&7Status&8: %getStatus({_uuid}, ""autoSpawn"")%||||&7&oSkal du automatisk||&7&ospawne med dit kit?||||&a&lKlik&7 for at ændre" with no nbt
- set slot 16 of {_p}'s current inventory to anvil named "&2&lOPGRADER KIT" with lore "&7&oTrænger dit kit til en||&7&oopgradering? Gør det her!||||&a&lKlik&7 for at gå til menuen||&8(&c&lKUN SPILLER KITTET&8)" with no nbt
- set {_rows} to 3
- set {_1st} to green glass
- set {_2nd} to gray glass
- set {_block} to {_1st}
- loop numbers between 0 and 8:
- set {_slot} to loop-value
- if slot {_slot} of {_p}'s current inventory is air:
- set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
- if {_block} is {_1st}:
- set {_block} to {_2nd}
- else:
- set {_block} to {_1st}
- set {_block} to {_1st}
- loop numbers between ({_rows} * 9 - 9) and ({_rows} * 9 - 1):
- set {_slot} to loop-value
- if slot {_slot} of {_p}'s current inventory is air:
- set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
- if {_block} is {_1st}:
- set {_block} to {_2nd}
- else:
- set {_block} to {_1st}
- else:
- send "{@prefix} &7Der opstod en fejl!" to {_p}
- function upgradeKit(uuid: object):
- set {_p} to player from {_uuid}
- if {kits.%{_uuid}%.defaultKit} is set:
- if {kits.%{_uuid}%.defaultKit} is "spiller":
- wait 3 ticks
- open chest with 6 rows named "&8Opgrader kit" to {_p}
- wait 3 ticks
- if uncolored inventory name of {_p}'s current inventory is "Opgrader kit":
- set slot 4 of {_p}'s current inventory to sign item named "&2&lOPGRADER DIT KIT" with lore "&7&oHer kan du opgradere||&7&oog enchante dit kit!||||&7Venstreklik&8: &aEnchant||&7Højreklik&8: &aOpgrader &8(&fIron &8- &bDiamond&8)" with no nbt
- set slot 49 of {_p}'s current inventory to red dye named "&c&lTILBAGE" with no nbt
- set {_kit::*} to {kits.%{_uuid}%.%{kits.%{_uuid}%.defaultKit}%::*}
- loop {_kit::*}:
- set {_item} to loop-value
- if {_item} is helmet:
- if {_helmet} isn't set:
- set {_helmet} to true
- set slot 13 of {_p}'s current inventory to {_item}
- clear {_lore::*}
- if {_item} is iron helmet:
- add "&bDiamond&8: &a$&7350" to {_lore::*}
- if size of {_lore::*} is higher than 0:
- set {_lore} to ""
- loop {_lore::*}:
- if (loop-index-2 parsed as a number) is higher than or equal to 2:
- set {_lore} to "%{_lore}%||"
- set {_lore} to "%{_lore}%%loop-value-2%"
- set slot 13 of {_p}'s current inventory's lore to {_lore}
- if {_item} is chestplate:
- if {_chestplate} isn't set:
- set {_chestplate} to true
- set slot 22 of {_p}'s current inventory to {_item}
- clear {_lore::*}
- if {_item} is iron chestplate:
- add "&bDiamond&8: &a$&7750" to {_lore::*}
- if size of {_lore::*} is higher than 0:
- set {_lore} to ""
- loop {_lore::*}:
- if (loop-index-2 parsed as a number) is higher than or equal to 2:
- set {_lore} to "%{_lore}%||"
- set {_lore} to "%{_lore}%%loop-value-2%"
- set slot 22 of {_p}'s current inventory's lore to {_lore}
- if {_item} is leggings:
- if {_leggings} isn't set:
- set {_leggings} to true
- set slot 31 of {_p}'s current inventory to {_item}
- clear {_lore::*}
- if {_item} is iron leggings:
- add "&bDiamond&8: &a$&7450" to {_lore::*}
- if size of {_lore::*} is higher than 0:
- set {_lore} to ""
- loop {_lore::*}:
- if (loop-index-2 parsed as a number) is higher than or equal to 2:
- set {_lore} to "%{_lore}%||"
- set {_lore} to "%{_lore}%%loop-value-2%"
- set slot 31 of {_p}'s current inventory's lore to {_lore}
- if {_item} is boots:
- if {_boots} isn't set:
- set {_boots} to true
- set slot 40 of {_p}'s current inventory to {_item}
- clear {_lore::*}
- if {_item} is iron boots:
- add "&bDiamond&8: &a$&7350" to {_lore::*}
- if size of {_lore::*} is higher than 0:
- set {_lore} to ""
- loop {_lore::*}:
- if (loop-index-2 parsed as a number) is higher than or equal to 2:
- set {_lore} to "%{_lore}%||"
- set {_lore} to "%{_lore}%%loop-value-2%"
- set slot 40 of {_p}'s current inventory's lore to {_lore}
- if {_item} is sword:
- if {_sword} isn't set:
- set {_sword} to true
- set slot 21 of {_p}'s current inventory to {_item}
- clear {_lore::*}
- if {_item} is iron sword:
- add "&bDiamond&8: &a$&7500" to {_lore::*}
- if size of {_lore::*} is higher than 0:
- set {_lore} to ""
- loop {_lore::*}:
- if (loop-index-2 parsed as a number) is higher than or equal to 2:
- set {_lore} to "%{_lore}%||"
- set {_lore} to "%{_lore}%%loop-value-2%"
- set slot 21 of {_p}'s current inventory's lore to {_lore}
- if {_item} is bow:
- if {_bow} isn't set:
- set {_bow} to true
- set slot 23 of {_p}'s current inventory to {_item}
- set {_rows} to 6
- set {_1st} to green glass
- set {_2nd} to gray glass
- set {_block} to {_1st}
- loop numbers between 0 and 8:
- set {_slot} to loop-value
- if slot {_slot} of {_p}'s current inventory is air:
- set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
- if {_block} is {_1st}:
- set {_block} to {_2nd}
- else:
- set {_block} to {_1st}
- set {_block} to {_1st}
- loop numbers between ({_rows} * 9 - 9) and ({_rows} * 9 - 1):
- set {_slot} to loop-value
- if slot {_slot} of {_p}'s current inventory is air:
- set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
- if {_block} is {_1st}:
- set {_block} to {_2nd}
- else:
- set {_block} to {_1st}
- else:
- send "{@prefix} &7Dit kit kan ikke opgraderes!" to {_p}
- else:
- send "{@prefix} &7Der opstod en fejl!" to {_p}
- function enchant(uuid: object, piece: text):
- set {_piece} to {_piece} parsed as item
- set {_p} to player from {_uuid}
- if {kits.%{_uuid}%.defaultKit} is set:
- if {kits.%{_uuid}%.defaultKit} is "spiller":
- wait 3 ticks
- open chest with 5 rows named "&8Enchant dit kit" to {_p}
- wait 3 ticks
- if uncolored inventory name of {_p}'s current inventory is "Enchant dit kit":
- set slot 4 of {_p}'s current inventory to {_piece}
- set slot 40 of {_p}'s current inventory to red dye named "&c&lTILBAGE" with no nbt
- if {_piece} isn't enchanted with unbreaking 1:
- set slot 20 of {_p}'s current inventory to glowing book named "&2&lUNBREAKING I" with lore "&2Pris&8: &a$&7300||||&a&lKlik&7 for at enchante" with no nbt
- else:
- set slot 20 of {_p}'s current inventory to book named "&2&lUNBREAKING I &8(&7&lFÆRDIG&8)" with lore "&7Dette piece er||&7er i maximum||&7af dette enchant!" with no nbt
- if {_piece} is helmet, chestplate, leggings or boots:
- if {_piece} isn't enchanted with protection 3:
- set {_enchants::*} to protection 1, protection 2 and protection 3
- set {_prices::*} to 1500, 2000 and 3500
- set {_level} to ""
- loop {_enchants::*}:
- set {_level} to "%{_level}%I"
- set {_enchant} to loop-value
- if {_piece} is enchanted with {_enchant}:
- set {_continue} to true
- else if {_level} is "I":
- if {_piece} is enchanted with {_enchants::2}:
- set {_continue} to true
- if {_continue} isn't set:
- set slot 24 of {_p}'s current inventory to glowing book named "&2&lPROTECTION %{_level}%" with lore "&2Pris&8: &a$&7%{_prices::%loop-index%}%||||&a&lKlik&7 for at enchante" with no nbt
- stop loop
- else:
- delete {_continue}
- else:
- set slot 24 of {_p}'s current inventory to book named "&2&lPROTECTION III &8(&7&lFÆRDIG&8)" with lore "&7Dette piece har||&7allerede dette||&7enchant!" with no nbt
- if {_piece} is sword:
- set {_price} to 1500
- if {_piece} isn't enchanted with fire aspect 1:
- set slot 22 of {_p}'s current inventory to glowing book named "&2&lFIRE ASPECT I" with lore "&2Pris&8: &a$&7%{_price}%||||&a&lKlik&7 for at enchante" with no nbt
- else:
- set slot 22 of {_p}'s current inventory to book named "&2&lFIRE ASPECT I &8(&7&lFÆRDIG&8)" with lore "&7Dette piece har||&7allerede dette||&7enchant!" with no nbt
- if {_piece} isn't enchanted with sharpness 3:
- set {_enchants::*} to sharpness 1, sharpness 2 and sharpness 3
- set {_prices::*} to 250, 500 and 1000
- set {_level} to ""
- loop {_enchants::*}:
- set {_level} to "%{_level}%I"
- set {_enchant} to loop-value
- if {_piece} is enchanted with {_enchant}:
- set {_continue} to true
- else if {_level} is "I":
- if {_piece} is enchanted with {_enchants::2}:
- set {_continue} to true
- if {_continue} isn't set:
- set slot 24 of {_p}'s current inventory to glowing book named "&2&lSHARPNESS %{_level}%" with lore "&2Pris&8: &a$&7%{_prices::%loop-index%}%||||&a&lKlik&7 for at enchante" with no nbt
- stop loop
- else:
- delete {_continue}
- else:
- set slot 24 of {_p}'s current inventory to book named "&2&lSHARPNESS III &8(&7&lFÆRDIG&8)" with lore "&7Dette piece har||&7allerede dette||&7enchant!" with no nbt
- if {_piece} is bow:
- set {_price} to 1500
- if {_piece} isn't enchanted with flame 1:
- set slot 22 of {_p}'s current inventory to glowing book named "&2&lFLAME I" with lore "&2Pris&8: &a$&7%{_price}%||||&a&lKlik&7 for at enchante" with no nbt
- else:
- set slot 22 of {_p}'s current inventory to book named "&2&lFLAME I &8(&7&lFÆRDIG&8)" with lore "&7Dette piece har||&7allerede dette||&7enchant!" with no nbt
- if {_piece} isn't enchanted with power 3:
- set {_enchants::*} to power 1, power 2 and power 3
- set {_prices::*} to 250, 500 and 1000
- set {_level} to ""
- loop {_enchants::*}:
- set {_level} to "%{_level}%I"
- set {_enchant} to loop-value
- if {_piece} is enchanted with {_enchant}:
- set {_continue} to true
- else if {_level} is "I":
- if {_piece} is enchanted with {_enchants::2}:
- set {_continue} to true
- if {_continue} isn't set:
- set slot 24 of {_p}'s current inventory to glowing book named "&2&lPOWER %{_level}%" with lore "&2Pris&8: &a$&7%{_prices::%loop-index%}%||||&a&lKlik&7 for at enchante" with no nbt
- stop loop
- else:
- delete {_continue}
- else:
- set slot 24 of {_p}'s current inventory to book named "&2&lPOWER III &8(&7&lFÆRDIG&8)" with lore "&7Dette piece har||&7allerede dette||&7enchant!" with no nbt
- set {_rows} to 5
- set {_1st} to green glass
- set {_2nd} to gray glass
- set {_block} to {_1st}
- loop numbers between 0 and 8:
- set {_slot} to loop-value
- if slot {_slot} of {_p}'s current inventory is air:
- set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
- if {_block} is {_1st}:
- set {_block} to {_2nd}
- else:
- set {_block} to {_1st}
- set {_block} to {_1st}
- loop numbers between ({_rows} * 9 - 9) and ({_rows} * 9 - 1):
- set {_slot} to loop-value
- if slot {_slot} of {_p}'s current inventory is air:
- set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
- if {_block} is {_1st}:
- set {_block} to {_2nd}
- else:
- set {_block} to {_1st}
- else:
- send "{@prefix} &7Dit kit kan ikke opgraderes!" to {_p}
- else:
- send "{@prefix} &7Der opstod en fejl!" to {_p}
- function kitOrder(uuid: object):
- set {_p} to player from {_uuid}
- if {kits.%{_uuid}%.defaultKit} is set:
- set {_kit::*} to {kits.%{_uuid}%.%{kits.%{_uuid}%.defaultKit}%::*}
- wait 3 ticks
- open chest with 1 row named "&8Kit rækkefølge" to {_p}
- wait 3 ticks
- if uncolored inventory name of {_p}'s current inventory is "Kit rækkefølge":
- set {_slot} to 0
- loop {_kit::*}:
- set {_item} to loop-value
- if {_item} is helmet, chestplate, leggings or boots:
- if {_armor} isn't set:
- set {_armor} to true
- set slot {_slot} of {_p}'s current inventory to diamond chestplate named "&a&lARMOR"
- add 1 to {_slot}
- add {_item} to {kits.%{_uuid}%.kitOrder.armor::*}
- else:
- set slot {_slot} of {_p}'s current inventory to {_item}
- add 1 to {_slot}
- else:
- send "{@prefix} &7Der opstod en fejl!" to {_p}
- function donatorKit(uuid: object, kit: text):
- set {_p} to player from {_uuid}
- if {_p} has permission "%{_kit}%":
- wait 3 ticks
- open chest with 3 rows named "&8Kit %startBig({_kit})%" to {_p}
- wait 3 ticks
- if uncolored inventory name of {_p}'s current inventory is "Kit %startBig({_kit})%":
- set slot 22 of {_p}'s current inventory to red dye named "&c&lTILBAGE" with no nbt
- if {_kit} is "quito":
- set slot 12 of {_p}'s current inventory to 95:14 named "&c&lQUITO" with no nbt
- set slot 14 of {_p}'s current inventory to 95:14 named "&c&lQUITO I" with no nbt
- if {_kit} is "titan":
- set slot 12 of {_p}'s current inventory to 95:1 named "&6&lTITAN" with no nbt
- set slot 14 of {_p}'s current inventory to 95:1 named "&6&lTITAN I" with no nbt
- if {_kit} is "king":
- set slot 12 of {_p}'s current inventory to 95:10 named "&5&lKING" with no nbt
- set slot 14 of {_p}'s current inventory to 95:10 named "&5&lKING I" with no nbt
- if {_kit} is "youtube":
- set slot 12 of {_p}'s current inventory to 95:10 named "&4&lYOU&f&lTUBE" with no nbt
- set slot 14 of {_p}'s current inventory to 95:10 named "&4&lYOU&f&lTUBE &4&lI" with no nbt
- set {_rows} to 3
- set {_1st} to green glass
- set {_2nd} to gray glass
- set {_block} to {_1st}
- loop numbers between 0 and 8:
- set {_slot} to loop-value
- if slot {_slot} of {_p}'s current inventory is air:
- set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
- if {_block} is {_1st}:
- set {_block} to {_2nd}
- else:
- set {_block} to {_1st}
- set {_block} to {_1st}
- loop numbers between ({_rows} * 9 - 9) and ({_rows} * 9 - 1):
- set {_slot} to loop-value
- if slot {_slot} of {_p}'s current inventory is air:
- set slot {_slot} of {_p}'s current inventory to {_block} named " " with no nbt
- if {_block} is {_1st}:
- set {_block} to {_2nd}
- else:
- set {_block} to {_1st}
- on inventory click:
- if uncolored inventory name of player's current inventory is "Konfigurer dit kit":
- cancel event
- if click item is green glass, gray glass, air or sign:
- stop
- set {_name} to uncolored clicked item's name
- if {_name} is "AUTO ARMOR":
- if {kits.%uuid of player%.settings::autoArmor} is true:
- set {kits.%uuid of player%.settings::autoArmor} to false
- else:
- set {kits.%uuid of player%.settings::autoArmor} to true
- stop
- if {_name} is "AUTO SPAWN":
- if {kits.%uuid of player%.settings::autoSpawn} is true:
- set {kits.%uuid of player%.settings::autoSpawn} to false
- else:
- set {kits.%uuid of player%.settings::autoSpawn} to true
- stop
- if {_name} is "KIT RÆKKEFØLGE":
- kitOrder(uuid of player)
- if {_name} is "OPGRADER KIT":
- upgradeKit(uuid of player)
- close player's inventory
- if uncolored inventory name of player's current inventory is "Kit rækkefølge":
- cancel event
- if {kits.%uuid of player%.kitOrder} is set:
- set {_item1} to slot {kits.%uuid of player%.kitOrder} of player's current inventory
- set {_item2} to clicked item
- set slot {kits.%uuid of player%.kitOrder} of player's current inventory to {_item2}
- set slot (clicked slot) of player's current inventory to {_item1}
- delete {kits.%uuid of player%.kitOrder}
- stop
- set {kits.%uuid of player%.kitOrder} to clicked slot
- if uncolored inventory name of player's current inventory is "Opgrader kit":
- cancel event
- if click item is green glass, gray glass, air or sign:
- stop
- set {_name} to uncolored clicked item's name
- if {_name} is "TILBAGE":
- close player's inventory
- kitConfig(uuid of player)
- stop
- set {_kit::*} to {kits.%uuid of player%.%{kits.%uuid of player%.defaultKit}%::*}
- if click type is left mouse button:
- if clicked item is iron sword, iron helmet, iron chestplate, iron leggings or iron boots:
- loop {_kit::*}:
- if "%loop-value%" is "%clicked item%":
- if loop-value is sword:
- set {_price} to 500
- set {_item} to diamond sword
- else if loop-value is helmet:
- set {_price} to 350
- set {_item} to diamond helmet
- else if loop-value is chestplate:
- set {_price} to 750
- set {_item} to diamond chestplate
- else if loop-value is leggings:
- set {_price} to 450
- set {_item} to diamond leggings
- else if loop-value is boots:
- set {_price} to 350
- set {_item} to diamond boots
- if player's balance is greater than or equal to {_price}:
- set {_name} to name of loop-value
- set {_lore} to loop-value's lore
- set {_enchants::*} to enchants of loop-value
- set {_durability} to loop-value's durability
- if {_name} is set:
- set name of {_item} to {_name}
- if {_lore} is set:
- set {_item}'s lore to {_lore}
- loop {_enchants::*}:
- enchant {_item} with loop-value-2
- set durability of {_item} to {_durability}
- set {kits.%uuid of player%.%{kits.%uuid of player%.defaultKit}%::%loop-index%} to {_item}
- remove {_price} from player's balance
- send "{@prefix} &7Du har opgradet dit armor.."
- stop loop
- else:
- send "{@prefix} &7Du har ikke penge nok.."
- else:
- stop
- if click type is right mouse button:
- loop {_kit::*}:
- if "%loop-value%" is "%clicked item%":
- enchant(uuid of player, "%loop-value%")
- stop loop
- close player's inventory
- if uncolored inventory name of player's current inventory is "Enchant dit kit":
- cancel event
- set {_piece} to slot 4 of player's current inventory
- if click item is green glass, gray glass, air, sign or {_piece}:
- stop
- set {_name} to uncolored clicked item's name
- if {_name} is "TILBAGE":
- close player's inventory
- upgradeKit(uuid of player)
- stop
- else if {_name} contains "(FÆRDIG)":
- stop
- if {_name} contains "UNBREAKING":
- set {_enchant} to unbreaking 1
- set {_price} to 300
- else if {_name} contains "PROTECTION":
- set {_enchants::*} to protection 1, protection 2 and protection 3
- set {_prices::*} to 1500, 2000 and 3500
- set {_level} to ""
- loop {_enchants::*}:
- set {_level} to "%{_level}%I"
- set {_enchant} to loop-value
- if {_piece} is enchanted with {_enchant}:
- set {_continue} to true
- else if {_level} is "I":
- if {_piece} is enchanted with {_enchants::2}:
- set {_continue} to true
- if {_continue} isn't set:
- set {_enchant} to {_enchants::%loop-index%}
- set {_price} to {_prices::%loop-index%}
- stop loop
- else:
- delete {_continue}
- else if {_name} contains "SHARPNESS":
- set {_enchants::*} to sharpness 1, sharpness 2 and sharpness 3
- set {_prices::*} to 250, 500 and 1000
- set {_level} to ""
- loop {_enchants::*}:
- set {_level} to "%{_level}%I"
- set {_enchant} to loop-value
- if {_piece} is enchanted with {_enchant}:
- set {_continue} to true
- else if {_level} is "I":
- if {_piece} is enchanted with {_enchants::2}:
- set {_continue} to true
- if {_continue} isn't set:
- set {_enchant} to {_enchants::%loop-index%}
- set {_price} to {_prices::%loop-index%}
- stop loop
- else:
- delete {_continue}
- else if {_name} contains "FIRE ASPECT":
- set {_enchant} to flame 1
- set {_price} to 1500
- else if {_name} contains "POWER":
- set {_enchants::*} to power 1, power 2 and power 3
- set {_prices::*} to 250, 500 and 1000
- set {_level} to ""
- loop {_enchants::*}:
- set {_level} to "%{_level}%I"
- set {_enchant} to loop-value
- if {_piece} is enchanted with {_enchant}:
- set {_continue} to true
- else if {_level} is "I":
- if {_piece} is enchanted with {_enchants::2}:
- set {_continue} to true
- if {_continue} isn't set:
- set {_enchant} to {_enchants::%loop-index%}
- set {_price} to {_prices::%loop-index%}
- stop loop
- else:
- delete {_continue}
- else if {_name} contains "FLAME":
- set {_enchant} to flame 1
- set {_price} to 1500
- if player's balance is greater than or equal to {_price}:
- set {_kit::*} to {kits.%uuid of player%.%{kits.%uuid of player%.defaultKit}%::*}
- loop {_kit::*}:
- if "%loop-value%" is "%{_piece}%":
- enchant {kits.%uuid of player%.%{kits.%uuid of player%.defaultKit}%::%loop-index%} with {_enchant}
- remove {_price} from player's balance
- send "{@prefix} &7Du har enchantet dit armor.."
- stop loop
- else:
- send "{@prefix} &7Du har ikke penge nok.."
- close player's inventory
- if uncolored inventory name of player's current inventory is "Kits":
- cancel event
- if click item is green glass, gray glass, air or sign:
- stop
- set {_name} to uncolored clicked item's name
- set {_lore} to uncolored clicked item's lore
- if {_name} is "spiller":
- execute player command "/kit spiller"
- if {_name} is "QUITO":
- if {_lore} contains "JA":
- donatorKit(uuid of player, "quito")
- else:
- stop
- if {_name} is "TITAN":
- if {_lore} contains "JA":
- donatorKit(uuid of player, "titan")
- else:
- stop
- if {_name} is "KING":
- if {_lore} contains "JA":
- donatorKit(uuid of player, "king")
- else:
- stop
- if {_name} is "YOUTUBE":
- if {_lore} contains "JA":
- donatorKit(uuid of player, "youtube")
- else:
- stop
- close player's inventory
- if uncolored inventory name of player's current inventory is "Kit Quito" or "Kit Titan" or "Kit King" or "Kit Youtube":
- cancel event
- if click item is green glass, gray glass, air or sign:
- stop
- set {_name} to uncolored clicked item's name
- if {_name} is "TILBAGE":
- close player's inventory
- execute player command "/kit"
- stop
- if {_name} is "QUITO":
- execute player command "/essentials:kits quito"
- else if {_name} is "QUITO I":
- execute player command "/kit quito1"
- if {_name} is "TITAN":
- execute player command "/essentials:kits titan"
- else if {_name} is "TITAN I":
- execute player command "/kit titan1"
- if {_name} is "KING":
- execute player command "/essentials:kits king"
- else if {_name} is "KING I":
- execute player command "/kit king1"
- if {_name} is "YOUTUBE":
- execute player command "/essentials:kits yt"
- else if {_name} is "YOUTUBE I":
- execute player command "/kit yt1"
- close player's inventory
- on inventory close:
- if uncolored inventory name of player's current inventory is "Kit rækkefølge":
- set {_slot} to 0
- loop 9 times:
- set {_item} to slot {_slot} of player's current inventory
- if {_item} isn't air:
- if {_item} is diamond chestplate named "&a&lARMOR":
- loop {kits.%uuid of player%.kitOrder.armor::*}:
- add loop-value-2 to {_kit::*}
- set {_armor} to 2
- else:
- add {_item} to {_kit::*}
- add 1 to {_slot}
- delete {kits.%uuid of player%.kitOrder}
- delete {kits.%uuid of player%.kitOrder.armor::*}
- set {kits.%uuid of player%.%{kits.%uuid of player%.defaultKit}%::*} to {_kit::*}
- send "{@prefix} &7Du har gemt din kit rækkefølge!"
- function giveKit(uuid: object, kit: text):
- set {_p} to player from {_uuid}
- set {_kit} to toSmall({_kit})
- set {_kit::*} to {kits.%{_uuid}%.%{_kit}%::*}
- if {kits.%{_uuid}%.settings::autoArmor} is true:
- if {_p}'s helmet, chestplate, leggings and boots isn't air:
- send "{@prefix} &7Venligst ryd dit inventory.." to {_p}
- stop
- loop {_kit::*}:
- set {_item} to loop-value
- if {_item} is helmet, chestplate, leggings or boots:
- if size of {_armor::*} is 0:
- set {_kit::%loop-index%} to air
- add {_item} to {_armor::*}
- set {_kit::%loop-index%} to air
- set {_slot} to 0
- set {_freeSlots} to 0
- loop (size of {_kit::*}) times:
- if slot {_slot} of {_p}'s inventory is air:
- add 1 to {_freeSlots}
- else if {_kit::%loop-value%} is air:
- add 1 to {_freeSlots}
- add 1 to {_slot}
- if {_freeSlots} isn't higher than or equal to size of {_kit::*}:
- send "{@prefix} &7Venligst ryd dit inventory.." to {_p}
- stop
- loop {_armor::*}:
- equip {_p} with loop-value
- set {_slot} to 0
- loop {_kit::*}:
- set {_item} to loop-value
- if {_item} is air:
- if {_slot} isn't higher than or equal to 9:
- add 1 to {_slot}
- set {_continue} to true
- if {_continue} isn't set:
- set slot {_slot} of {_p}'s inventory to {_item}
- add 1 to {_slot}
- else:
- delete {_continue}
- send "{@prefix} &7Du har modtaget kittet&8: &a%startBig({_kit})%" to {_p}
- command /konfigurerkit:
- aliases: /kitkonfigurer, /kitconfig, /configtkit, /lavkit, /kitlav
- trigger:
- wait 3 ticks
- kitConfig(uuid of player)
- command /kit [<text>]:
- aliases: /kits
- trigger:
- wait 3 ticks
- if arg 1 isn't set:
- open chest with 6 rows named "&8Kits" to player
- wait 3 ticks
- if uncolored inventory name of player's current inventory is "Kits":
- set slot 4 of player's current inventory to sign item named "&2&lTAG DINE KITS" with lore "&7&oHer ser du de||&7&okits du har adgang til" with no nbt
- set slot 22 of player's current inventory to 95:8 named "&7&lSPILLER" with no nbt
- if player has permission "quito":
- set {_perm} to "&a&lJA"
- else:
- set {_perm} to "&c&lNEJ"
- set slot 28 of player's current inventory to 95:14 named "&c&lQUITO" with lore "&7Adgang&8: &a%{_perm}%" with no nbt
- if player has permission "titan":
- set {_perm} to "&a&lJA"
- else:
- set {_perm} to "&c&lNEJ"
- set slot 30 of player's current inventory to 95:1 named "&6&lTITAN" with lore "&7Adgang&8: &a%{_perm}%" with no nbt
- if player has permission "king":
- set {_perm} to "&a&lJA"
- else:
- set {_perm} to "&c&lNEJ"
- set slot 32 of player's current inventory to 95:10 named "&5&lKING" with lore "&7Adgang&8: &a%{_perm}%" with no nbt
- if player has permission "yt":
- set {_perm} to "&a&lJA"
- else:
- set {_perm} to "&c&lNEJ"
- set slot 34 of player's current inventory to 95 named "&4&lYOU&f&lTUBE" with lore "&7Adgang&8: &a%{_perm}%" with no nbt
- set {_rows} to 6
- set {_1st} to green glass
- set {_2nd} to gray glass
- set {_block} to {_1st}
- loop numbers between 0 and 8:
- set {_slot} to loop-value
- if slot {_slot} of player's current inventory is air:
- set slot {_slot} of player's current inventory to {_block} named " " with no nbt
- if {_block} is {_1st}:
- set {_block} to {_2nd}
- else:
- set {_block} to {_1st}
- set {_block} to {_1st}
- loop numbers between ({_rows} * 9 - 9) and ({_rows} * 9 - 1):
- set {_slot} to loop-value
- if slot {_slot} of player's current inventory is air:
- set slot {_slot} of player's current inventory to {_block} named " " with no nbt
- if {_block} is {_1st}:
- set {_block} to {_2nd}
- else:
- set {_block} to {_1st}
- else:
- if kitExists(arg 1) is true:
- set {_perm} to toSmall(arg 1)
- replace all "1" with "" in {_perm}
- if player has permission "%{_perm}%":
- giveKit(uuid of player, arg 1)
- else:
- send "{@prefix} &7Du har ikke tilladelse til at tage dette kit.."
- else:
- execute player command "/essentials:kits %arg 1%"
- on respawn:
- if {kits.%uuid of player%.settings::autoSpawn} is true:
- execute player command "/kit %{kits.%uuid of player%.defaultKit}%"
- on click on entity:
- if name of entity is "&6&lLAV KIT":
- execute player command "/konfigurerkit"
- if name of entity is "&b&lOPGRADER KIT":
- upgradeKit(uuid of player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement