Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- #=========================================================#
- # __ __ _____ _ #
- # | \/ | / ____| | | #
- # | \ / | ___ __ _ __ _| | _ __ __ _| |_ ___ ___ #
- # | |\/| |/ _ \/ _` |/ _` | | | '__/ _` | __/ _ \/ __| #
- # | | | | __/ (_| | (_| | |____| | | (_| | || __/\__ \ #
- # |_| |_|\___|\__, |\__,_|\_____|_| \__,_|\__\___||___/ #
- # __/ | #
- # |___/ #
- # #
- # Creado por PiskotPiskotovic #
- #=========================================================#
- #============================================================================================#
- # Configuracion general #
- #============================================================================================#
- prefix: &b&lMegaCrates ⏐&e
- key-item: tripwire hook
- key-name-color: &c&l
- crate-block: ender chest
- animation: true
- animation-length: 5
- # animation-length: especifica el largo de la animacion EN SEGUNDOS.
- no-key-explosion: false
- # no-key-explosion: si esta opcion esta en false y el jugador no tiene una llave le dara un pequeño empujon. Si esta en true lo empujara mucho mas.
- open-messages: true
- # Aqui puedes cambiar los items que salen en la animacion al abrir una caja.
- animation-item1: red stained glass pane
- animation-item2: yellow stained glass pane
- animation-item3: green stained glass pane
- autoclose: 2
- # Aqui puedes definir cuanto tarda en auto cerrarse el menu luego de dar la recompensa. EN SEGUNDOS.
- doautoclose: true
- # La caja no se cierra sola si esto esta en false.
- virtual-key: false
- # Los jugador no necesitan un item como llave. En lugar de ellos, sera una variable y la caja solo se abrira si tiene 1 o mas.
- website: example.com
- # Aqui puedes cambiar el enlace a la tienda de tu servidor, que se mostrara en las llaves.
- hover-message: &a¿Quieres mas llaves?||&a¡Visita nuestra tienda||&ao vota en nuestro sitio web!
- # Aqui puedes cambiar la informacion de las llaves virtuales.
- # || = nueva linea
- giveonwincommand: false
- # No se ejecutara un comando si esta establecido y esto esta en false.
- # Ayuda para comandos al ganar:
- # PLAYER = nombre del jugador
- #============================================================================================#
- # Configuracion de las cajas al minar (tambien conocidasc omo PrisionCrates) #
- #============================================================================================#
- appear-chance: 2
- # Este debe ser un numero entre 0.01 y 100. Escribalo sin el signo de porcentaje.
- # Si quieres desactivarlo completamente pon 0.
- block: chest
- # Este es el tipo de bloque de la caja.
- open-crate: prison
- # Escribe aqui el nombre que quieres usar para la PrisionCrate, o simplemente dejale el nombre 'prison'.
- staytime: 10
- # Tiempo (en segundos) que la caja estara ahi. Luego de X segundos desaparecera.
- appear-title: &a&l¡Acaba de aparecer un cofre!
- appear-subtitle: &7¡Abrelo antes de que desaparezca!
- # Aqui puedes cambiar el titulo y el subtitulo que aparece al jugador cuando encuentra una caja.
- find-broadcast: true
- # Manda un mensaje a todos los jugador cuando alguien encuentra una caja si esto esta en true.
- find-message: ¡%player% ha encontrado una caja minando!
- # Este es el mensaje que sera enviado a todos.
- openable-only-by-player: true
- # Solo el jugador que encontro la caja la puede abrir si esto esta en true.
- # Si te estas preguntando como hacer que la PrisionCrate aparezca la respuesta es simple.
- # Necesitas agregar la region de WorldGuard a una lista especial con /crate addregion <region>
- # pára hacer que los cofres aparescan en ella.
- # ¡ADVERTENCIA! Las PrisonCrates no soportan chances para items, pero soportan comandos al ganar.
- # Se necesita WorldGuard para las PrisonCrates. Si no las quieres usar, no necesitaras WorldGuard.
- #============================================================================================#
- command /megacrates [<text>] [<text>] [<text>] [<text>] [<text>]:
- trigger:
- if arg 1 isn't set:
- make player execute command "crate"
- else if arg 1 is set:
- if arg 2 isn't set:
- make player execute command "crate %arg 1%"
- else if arg 2 is set:
- if arg 3 isn't set:
- make player execute command "crate %arg 1% %arg 2%"
- else if arg 3 is set:
- if arg 4 isn't set:
- make player execute command "crate %arg 1% %arg 2% %arg 3%"
- else if arg 4 is set:
- if arg 5 isn't set:
- make player execute command "crate %arg 1% %arg 2% %arg 3% %arg 4%"
- else if arg 5 is set:
- make player execute command "crate %arg 1% %arg 2% %arg 3% %arg 4% %arg 5%"
- command /megacrate [<text>] [<text>] [<text>] [<text>] [<text>]:
- trigger:
- if arg 1 isn't set:
- make player execute command "crate"
- else if arg 1 is set:
- if arg 2 isn't set:
- make player execute command "crate %arg 1%"
- else if arg 2 is set:
- if arg 3 isn't set:
- make player execute command "crate %arg 1% %arg 2%"
- else if arg 3 is set:
- if arg 4 isn't set:
- make player execute command "crate %arg 1% %arg 2% %arg 3%"
- else if arg 4 is set:
- if arg 5 isn't set:
- make player execute command "crate %arg 1% %arg 2% %arg 3% %arg 4%"
- else if arg 5 is set:
- make player execute command "crate %arg 1% %arg 2% %arg 3% %arg 4% %arg 5%"
- command /crates [<text>] [<text>] [<text>] [<text>] [<text>]:
- trigger:
- if arg 1 isn't set:
- make player execute command "crate"
- else if arg 1 is set:
- if arg 2 isn't set:
- make player execute command "crate %arg 1%"
- else if arg 2 is set:
- if arg 3 isn't set:
- make player execute command "crate %arg 1% %arg 2%"
- else if arg 3 is set:
- if arg 4 isn't set:
- make player execute command "crate %arg 1% %arg 2% %arg 3%"
- else if arg 4 is set:
- if arg 5 isn't set:
- make player execute command "crate %arg 1% %arg 2% %arg 3% %arg 4%"
- else if arg 5 is set:
- make player execute command "crate %arg 1% %arg 2% %arg 3% %arg 4% %arg 5%"
- command /consolegive [<text>] [<text>]:
- Executable by: console
- trigger:
- if {@virtual-key} is false:
- set {giveto} to "%arg 2%" parsed as player
- message " {@prefix} &e¡Le has dado una &cLlave &l%arg 2%&e a &a%{giveto}%&e!"
- give 1 {@key-item} named "{@key-name-color}Llave %arg 1%" to {giveto}
- else if {@virtual-key} is true:
- add 1 to {key.%arg 1%.%arg 2%}
- message " {@prefix} &e¡Has agregado una &cllave &l%arg 1%&e a la cuenta de &a%arg 2%&e!"
- on load:
- if {CrateList::*} isn't set:
- set {CrateList::*} to "&c&l¡No has creado ninguna caja!"
- command /crate [<text>] [<text>] [<text>] [<text>] [<text>]:
- Executable by: players and console
- trigger:
- if arg 1 isn't set:
- message " &2>> {@prefix} &a&lv1.8.2.3"
- message " "
- message "&b/crate give <nombre> <jugador> &eDa una llave a un jugador especifico."
- message "&b/crate create <nombre> &eCrea una nueva caja con un nombre especifico."
- message "&b/crate additem <nombre> <chance> <nombre custom=yes/no> <comando de consola opcional> &eAgregar el item que tienes en la mano a una caja."
- message "&b/crate removeitem <nombre> &eEliminar el ultimo item agregado a una caja especifica."
- message "&b/crate place <nombre> &ePoner una caja a donde mires."
- message "&b/crate delete <nombre> &eEliminar una caja especifica."
- message "&b/crate addregion <nombre> &eAgrega una region para que en ella aparezcan cajas. (WorldGuard requerido)"
- message "&b/crate delregion <nombre> &eElimina una region para que no aparezcan mas cajas en ella. (WorldGuard requerido)"
- message "&b/crate fixname &ePrepara el item que tienes para agregarlo a una caja."
- message "&b/crate list &eEnvia una lista de todas las cajas disponibles."
- message "&b/crate reload &eRecargar MegaCrates."
- message " "
- message " &cCreado por PiskotPiskotovic"
- else if arg 1 is "give":
- if player has permission "megacrates.give":
- if arg 2 is set:
- if {Crate.%arg 2%} is set:
- if arg 3 is set:
- if {@virtual-key} is false:
- set {giveto} to "%arg 3%" parsed as player
- message " {@prefix} &e¡Le has dado una Llave &c&l%arg 2%&e a &a%{giveto}%&e!"
- give 1 {@key-item} named "{@key-name-color}Llave %arg 2%" to {giveto}
- else if {@virtual-key} is true:
- add 1 to {key.%arg 2%.%arg 3%}
- message " {@prefix} &e¡Has agregado una &cLlave &l%arg 2%&e a la cuenta de &a%arg 3%&e!"
- else:
- message " {@prefix} &c¡No has especificado el jugador!"
- else:
- message " {@prefix} &cEsa caja no existe."
- else:
- message "{@prefix} &c¡No has especificado una caja!"
- else if arg 1 is "fixname":
- if player's tool isn't air:
- set player's tool's name to "%player's tool%"
- message " {@prefix} &a&lCompletado. Ahora puedes agregarlo a una caja."
- else:
- message " {@prefix} &cNo puedes renombrar el aire..."
- else if arg 1 is "addregion":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- set {region} to "%arg 2%"
- loop all blocks in the region {region}:
- set {PrisonCrate.%loop-block's location%} to true
- add "%{region}% in world %player's world%" to {Regions::*}
- message " {@prefix} &a¡Agregada correctamente!"
- message "&4&l¡ADVERTENCIA! &bSi la region esta en un mundo diferente al que estas no funcionara. ¡Debes ir al mismo mundo!"
- message "&d&lNOMBRE: &b%{region}%"
- delete {region}
- else:
- message " {@prefix} &c¡No has especificado ninguna region de WorldGuard!"
- else:
- message " {@prefix} &cParece que no tienes permiso para hacer eso."
- else if arg 1 is "delregion":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- set {region} to "%arg 2%"
- loop all blocks in the region {region}:
- delete {PrisonCrate.%loop-block's location%}
- remove "%{region}% in world %player's world%" from {Regions::*}
- message " {@prefix} &a¡Eliminada correctamente!"
- message "&4&l¡ADVERTENCIA! &bSi la region esta en un mundo diferente al que estas no funcionara. ¡Debes ir al mismo mundo!"
- message "&d&lNOMBRE: &b%{region}%"
- delete {region}
- else:
- message " {@prefix} &c¡No has especificado ninguna region de WorldGuard!"
- else:
- message " {@prefix} &cParece que no tienes permiso para hacer eso."
- else if arg 1 is "create":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- if {Crate.%arg 2%} isn't set:
- message " {@prefix} &e¡Se ha creado una caja llamada &a%arg 2%&e!"
- set {Crate.%arg 2%} to true
- set {chancetotal.%arg 2%} to 100
- if {CrateList::*} is "&c&l¡No hay ninguna caja!":
- delete {CrateList::*}
- add "%arg 2%" to {CrateList::*}
- else:
- message " {@prefix} &c¡Ya existe una caja con ese nombre!"
- else:
- message " {@prefix} &c¡No has especificado el nombre de la caja!"
- else:
- message " {@prefix} &cParece que no tienes permiso para hacer eso."
- else if arg 1 is "additem":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- if {Crate.%arg 2%} is set:
- if player's tool isn't air:
- if arg 3 is set:
- if arg 4 is set:
- add 1 to {CrateItemsTotal.%arg 2%}
- if arg 5 is set:
- set {CrateItemCommand.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%arg 5%"
- if arg 4 is "yes":
- set {chance} to "%arg 3%" parsed as integer
- if {chancetotal.%arg 2%} is higher or equal to {chance}:
- message " {@prefix} &e¡Has agregado un nuevo item a la caja &a%arg 2%&e!"
- message " {@prefix} &eChance: &a&l%{chance}% %%"
- if player's tool's name isn't set:
- set {name} to "%player's tool%"
- if player's tool's name is set:
- set {name} to "%player's tool's name%"
- set {lore} to "%player's tool's lore%"
- set {CrateItemChance.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%{chance}%" parsed as integer
- set {lore} to "%player's tool's lore%"
- set {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%player's tool%" parsed as item
- set name of {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%{name}%"
- set lore of {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%{lore}%"
- remove {chance} from {chancetotal.%arg 2%}
- if {CrateItemsTotal.%arg 2%} is 0 or 1:
- add 1 to {CrateItemsTotal.%arg 2%}
- if player's tool's name isn't set:
- set {name} to "%player's tool%"
- if player's tool's name is set:
- set {name} to "%player's tool's name%"
- set {lore} to "%player's tool's lore%"
- set {CrateItemChance.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%{chance}%" parsed as integer
- set {lore} to "%player's tool's lore%"
- set {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%player's tool%" parsed as item
- set name of {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%{name}%"
- set lore of {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%{lore}%"
- else:
- message " {@prefix} &cLa chance que hsa puesto es muy alta. MAX: %{chancetotal.%arg 2%}%"
- else if arg 4 is "no":
- set {chance} to "%arg 3%" parsed as integer
- message " {@prefix} &e¡Has agregado un nuevo item a la caja &a%arg 2%&e!"
- message " {@prefix} &eChance: &a&l%{chance}% %%"
- set {CrateItemChance.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%{chance}%" parsed as integer
- set {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%player's tool%" parsed as item
- set name of {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%player's tool%"
- remove {chance} from {chancetotal.%arg 2%}
- if {CrateItemsTotal.%arg 2%} is 0 or 1:
- add 1 to {CrateItemsTotal.%arg 2%}
- set {CrateItemChance.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%{chance}%" parsed as integer
- set {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%player's tool%" parsed as item
- set name of {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to "%player's tool%"
- else:
- message " {@prefix} &cRespuesta esperada yes/no, pero pusiste %arg 4%."
- else:
- message " {@prefix} &cRespuesta esperada yes/no, pero no pusiste nada."
- else:
- message " {@prefix} &c¡No especificaste la chance de tu item! MAX: %{chancetotal.%arg 2%}%"
- else:
- message " {@prefix} &cNo puedes agregar aire a las recompensas..."
- else:
- message " {@prefix} &c¡Esa caja no existe!"
- else:
- message " {@prefix} &c¡No has especificado el nombre de la caja!"
- else:
- message " {@prefix} &cParece que no tienes permiso para hacer eso."
- else if arg 1 is "place":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- if {Crate.%arg 2%} is set:
- set player's target block to {@crate-block}
- message " {@prefix} &e¡Caja colocada correctamente!"
- message "&d&lTIP &aPara rotar la caja, seleccionala con WorldEdit y escribe //set enderchest:1, enderchest:2 etc."
- set {CrateLocation.%player's target block's location%} to "%arg 2%"
- else:
- message " {@prefix} &c¡Esa caja no existe!"
- else:
- message " {@prefix} &c¡No has especificado el nombre de la caja!"
- else:
- message " {@prefix} &cParece que no tienes permiso para hacer eso."
- else if arg 1 is "delete":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- if {Crate.%arg 2%} is set:
- delete {CrateItem.%arg 2%}
- delete {Crate.%arg 2%}
- delete {CrateItemsTotal.%arg 2%}
- message " {@prefix} &e¡La caja &a%arg 2% &eha sido eliminada!"
- delete {chancetotal.%arg 2%}
- remove "%arg 2%" from {CrateList::*}
- if {CrateList::*} isn't set:
- set {CrateList::*} to "&c&l¡No hay ninguna caja!"
- else:
- message " {@prefix} &c¡Esa caja no existe!"
- else:
- message " {@prefix} &c¡No has especificado el nombre de la caja!"
- else:
- message " {@prefix} &cParece que no tienes permiso para hacer eso."
- else if arg 1 is "list":
- if player has permission "megacrates.admin":
- message " {@prefix} &d&lTodas las cajas:"
- message " &a&l• %{CrateList::*}%"
- else:
- message " {@prefix} &cParece que no tienes permiso para hacer eso."
- else if arg 1 is "removeitem":
- if player has permission "megacrates.admin":
- if arg 2 is set:
- if {Crate.%arg 2%} is set:
- if {CrateItemsTotal.%arg 2%} isn't 0:
- message " {@prefix} &e¡Has eliminado correctamente %{CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%}% de la caja %arg 2%!"
- add {CrateItemChance.%arg 2%::%{CrateItemsTotal.%arg 2%}%} to {chancetotal.%arg 2%}
- message " {@prefix} &eAhora la chance disponible para usar es: &a&l%{chancetotal.%arg 2%}% %%"
- remove {CrateItem.%arg 2%::%{CrateItemsTotal.%arg 2%}%} from {CrateItem.%arg 2%::*}
- remove 1 from {CrateItemsTotal.%arg 2%}
- else:
- message " {@prefix} &cNo hay nada que quitar de la caja."
- else:
- message " {@prefix} &c¡Esa caja no existe!"
- else:
- message " {@prefix} &c¡No has especificado el nombre de la caja!"
- else:
- message " {@prefix} &cParece que no tienes permiso para hacer eso."
- else if arg 1 is "reload":
- if player has permission "megacrates.admin":
- execute console command "sk reload %script%"
- message " {@prefix} &eLa configuracion ha sido recargada."
- else:
- message " {@prefix} &cParece que no tienes permiso para hacer eso."
- else:
- message " {@prefix} &cComando no encontrado. Usa /crate."
- on load:
- set {update} to text from url "http://www.piskotuj.8u.cz/megacrates.txt"
- if {update} isn't "1.8.2.3":
- message " {@prefix} &e¡Hay una nueva version disponible!" to console
- message " &aDescarga: &ehttp://bit.ly/1r3ykw2" to console
- on join:
- if player has permission "megacrates.admin":
- set {update} to text from url "http://www.piskotuj.8u.cz/megacrates.txt"
- if {update} isn't "1.8.2.3":
- message " {@prefix} &e¡Hay una nueva version disponible!"
- message " &aDescarga: &ehttp://bit.ly/1r3ykw2"
- on inventory close:
- set {opening.%player%} to false
- wait 0.1 second
- set {virtual.%player%} to false
- # Esto es seguro, porque mira si el jugador ha abierto el menu para la llave virtual. #
- command /open:
- trigger:
- wait 3 ticks
- close player's inventory
- if {virtual.%player%} is true:
- if {key.%{CrateLocation.%{virtualcrate.%player%}%}%.%player%} is higher or equal to 1:
- remove 1 from {key.%{CrateLocation.%{virtualcrate.%player%}%}%.%player%}
- set {opening.%player%} to true
- if {@animation} is false:
- loop 5 times:
- wait 0.1 second
- play mob spawner flames at target block
- play raw sound "note.bass" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.bassattack" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.harp" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.pling" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.snare" at player with pitch 5 volume 10
- make player execute "randomtry"
- play raw sound "random.successful_hit" at player with pitch 1 volume 10
- delete {random}
- set {opening.%player%} to false
- else if {@animation} is true:
- open chest with 3 rows named "&d&l%{CrateLocation.%{virtualcrate.%player%}%}%" to player
- wait 3 ticks
- if inventory name of player's current inventory is "&d&l%{CrateLocation.%{virtualcrate.%player%}%}%":
- loop {@animation-length} times:
- play raw sound "note.pling" at player with pitch 1 volume 10
- format slot 0 of player with black stained glass pane to be unstealable
- format slot 1 of player with {@animation-item1} to be unstealable
- format slot 2 of player with {@animation-item1} to be unstealable
- format slot 3 of player with {@animation-item1} to be unstealable
- format slot 4 of player with torch to be unstealable
- format slot 5 of player with {@animation-item1} to be unstealable
- format slot 6 of player with {@animation-item1} to be unstealable
- format slot 7 of player with {@animation-item1} to be unstealable
- format slot 8 of player with black stained glass pane to be unstealable
- format slot 9 of player with black stained glass pane to be unstealable
- set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- format slot 10 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
- set {_randomprize2.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- format slot 11 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize2.%player%}%} to be unstealable
- set {_randomprize3.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- format slot 12 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize3.%player%}%} to be unstealable
- set {_randomprize4.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- format slot 13 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize4.%player%}%} to be unstealable
- set {_randomprize5.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- format slot 14 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize5.%player%}%} to be unstealable
- set {_randomprize6.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- format slot 15 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize6.%player%}%} to be unstealable
- set {_randomprize7.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- format slot 16 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize7.%player%}%} to be unstealable
- format slot 17 of player with black stained glass pane to be unstealable
- format slot 18 of player with black stained glass pane to be unstealable
- format slot 19 of player with {@animation-item1} to be unstealable
- format slot 20 of player with {@animation-item1} to be unstealable
- format slot 21 of player with {@animation-item1} to be unstealable
- format slot 22 of player with torch to be unstealable
- format slot 23 of player with {@animation-item1} to be unstealable
- format slot 24 of player with {@animation-item1} to be unstealable
- format slot 25 of player with {@animation-item1} to be unstealable
- format slot 26 of player with black stained glass pane to be unstealable
- play raw sound "note.harp" at player with pitch 1 volume 10
- wait 0.3 seconds
- format slot 0 of player with black stained glass pane to be unstealable
- format slot 1 of player with {@animation-item1} to be unstealable
- format slot 2 of player with {@animation-item1} to be unstealable
- format slot 3 of player with {@animation-item1} to be unstealable
- format slot 4 of player with torch to be unstealable
- format slot 5 of player with {@animation-item1} to be unstealable
- format slot 6 of player with {@animation-item1} to be unstealable
- format slot 7 of player with {@animation-item1} to be unstealable
- format slot 8 of player with black stained glass pane to be unstealable
- format slot 9 of player with black stained glass pane to be unstealable
- set {_randomprize8.%player%} to {_randomprize1.%player%}
- format slot 11 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize8.%player%}%} to be unstealable
- set {_randomprize9.%player%} to {_randomprize2.%player%}
- format slot 12 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize9.%player%}%} to be unstealable
- set {_randomprize10.%player%} to {_randomprize3.%player%}
- format slot 13 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize10.%player%}%} to be unstealable
- set {_randomprize11.%player%} to {_randomprize4.%player%}
- format slot 14 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize11.%player%}%} to be unstealable
- set {_randomprize12.%player%} to {_randomprize5.%player%}
- format slot 15 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize12.%player%}%} to be unstealable
- set {_randomprize13.%player%} to {_randomprize6.%player%}
- format slot 16 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize13.%player%}%} to be unstealable
- set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- format slot 10 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
- format slot 17 of player with black stained glass pane to be unstealable
- format slot 18 of player with black stained glass pane to be unstealable
- format slot 19 of player with {@animation-item1} to be unstealable
- format slot 20 of player with {@animation-item1} to be unstealable
- format slot 21 of player with {@animation-item1} to be unstealable
- format slot 22 of player with torch to be unstealable
- format slot 23 of player with {@animation-item1} to be unstealable
- format slot 24 of player with {@animation-item1} to be unstealable
- format slot 25 of player with {@animation-item1} to be unstealable
- format slot 26 of player with black stained glass pane to be unstealable
- play raw sound "note.pling" at player with pitch 1 volume 10
- wait 0.3 second
- format slot 0 of player with black stained glass pane to be unstealable
- format slot 1 of player with {@animation-item3} to be unstealable
- format slot 2 of player with {@animation-item3} to be unstealable
- format slot 3 of player with {@animation-item3} to be unstealable
- format slot 4 of player with torch to be unstealable
- format slot 5 of player with {@animation-item3} to be unstealable
- format slot 6 of player with {@animation-item3} to be unstealable
- format slot 7 of player with {@animation-item3} to be unstealable
- format slot 8 of player with black stained glass pane to be unstealable
- format slot 9 of player with black stained glass pane to be unstealable
- set {_randomprize14.%player%} to {_randomprize3.%player%}
- format slot 12 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize14.%player%}%} to be unstealable
- set {randomprize15.%player%} to {_randomprize4.%player%}
- format slot 13 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{randomprize15.%player%}%} to be unstealable
- set {_randomprize16.%player%} to {_randomprize5.%player%}
- format slot 14 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize16.%player%}%} to be unstealable
- set {_randomprize17.%player%} to {_randomprize6.%player%}
- format slot 15 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize17.%player%}%} to be unstealable
- set {_randomprize18.%player%} to {_randomprize7.%player%}
- format slot 16 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize18.%player%}%} to be unstealable
- set {_randomprize2.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- format slot 11 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
- set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- format slot 10 of player with {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{_randomprize1.%player%}%} to be unstealable
- format slot 17 of player with black stained glass pane to be unstealable
- format slot 18 of player with black stained glass pane to be unstealable
- format slot 19 of player with {@animation-item3} to be unstealable
- format slot 20 of player with {@animation-item3} to be unstealable
- format slot 21 of player with {@animation-item3} to be unstealable
- format slot 22 of player with torch to be unstealable
- format slot 23 of player with {@animation-item3} to be unstealable
- format slot 24 of player with {@animation-item3} to be unstealable
- format slot 25 of player with {@animation-item3} to be unstealable
- format slot 26 of player with black stained glass pane to be unstealable
- play raw sound "note.harp" at player with pitch 1 volume 10
- wait 0.2 second
- set {random} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%{virtualcrate.%player%}%}%}
- if {@animation} is false:
- give {CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{random}%} to player
- else:
- make player execute "guirandomtry"
- if {@open-messages} is true:
- if {@animation} is false:
- broadcast " {@prefix} &a¡%player% &eha ganado &a%{CrateItem.%{CrateLocation.%{virtualcrate.%player%}%}%::%{random}%}'s name%&e!"
- else:
- stop
- play raw sound "random.successful_hit" at player with pitch 1 volume 10
- delete {random}
- loop 2 times:
- format slot 10 of player with {@animation-item1} to be unstealable
- format slot 16 of player with {@animation-item1} to be unstealable
- wait 0.2 second
- format slot 11 of player with {@animation-item2} to be unstealable
- format slot 15 of player with {@animation-item2} to be unstealable
- wait 0.2 second
- format slot 12 of player with {@animation-item1} to be unstealable
- format slot 14 of player with {@animation-item1} to be unstealable
- wait 0.2 second
- format slot 10 of player with {@animation-item3} to be unstealable
- format slot 16 of player with {@animation-item3} to be unstealable
- wait 0.2 second
- format slot 11 of player with {@animation-item3} to be unstealable
- format slot 15 of player with {@animation-item3} to be unstealable
- wait 0.2 second
- format slot 12 of player with {@animation-item3} to be unstealable
- format slot 14 of player with {@animation-item3} to be unstealable
- if {@doautoclose} is true:
- wait {@autoclose} seconds
- set {opening.%player%} to false
- close player's inventory
- set {opening.%player%} to false
- else:
- send player title "&bNo tienens ninguna llave" with subtitle "&bpara la caja &e&l%{CrateLocation.%{virtualcrate.%player%}%}%&b." for 2 seconds
- on break:
- set {curregion} to "%region at event-block's location%" parsed as text
- if "%{Regions::*}%" contains "%{curregion}%":
- chance of {@appear-chance}%:
- if {@openable-only-by-player} is true:
- set {playeropen.%block's location%} to "%player%"
- wait 1 tick
- set block to {@block}
- if {@find-broadcast} is true:
- broadcast " {@prefix} {@find-message}"
- send player title "{@appear-title}" with subtitle "{@appear-subtitle}" for 3 seconds
- set {Openable.%block's location%} to true
- wait {@staytime} seconds
- set block to air
- delete {Openable.%block's location%}
- delete {playeropen.%block's location%}
- on break of {@block}:
- if {Openable.%block's location%} is true:
- cancel event
- message " {@prefix} &d&l¡Eso no puede ser destruido! ¡Clic derecho en el!" to event-player
- on rightclick on {@block}:
- if player's gamemode isn't creative:
- if {Openable.%block's location%} is true:
- if {@openable-only-by-player} is true:
- if {playeropen.%block's location%} isn't "%player%":
- message " {@prefix} &c&l¡Lo sentimos! Esta caja no es tuya."
- stop
- set player's target block to air
- wait 2 ticks
- open chest with 3 rows named "&e&lAbriendo: &6&l{@open-crate}" to player
- loop 30 times:
- format slot 0 of player with yellow stained glass pane named " " to be unstealable
- format slot 1 of player with yellow stained glass pane named " " to be unstealable
- format slot 2 of player with yellow stained glass pane named " " to be unstealable
- format slot 3 of player with yellow stained glass pane named " " to be unstealable
- format slot 4 of player with yellow stained glass pane named " " to be unstealable
- format slot 5 of player with yellow stained glass pane named " " to be unstealable
- format slot 6 of player with yellow stained glass pane named " " to be unstealable
- format slot 7 of player with yellow stained glass pane named " " to be unstealable
- format slot 8 of player with yellow stained glass pane named " " to be unstealable
- format slot 9 of player with yellow stained glass pane named " " to be unstealable
- format slot 10 of player with yellow stained glass pane named " " to be unstealable
- format slot 11 of player with yellow stained glass pane named " " to be unstealable
- format slot 12 of player with yellow stained glass pane named " " to be unstealable
- set {_random} to random integer between 1 and {CrateItemsTotal.{@open-crate}}
- format slot 13 of player with {CrateItem.{@open-crate}::%{_random}%} to be unstealable
- format slot 14 of player with yellow stained glass pane named " " to be unstealable
- format slot 15 of player with yellow stained glass pane named " " to be unstealable
- format slot 16 of player with yellow stained glass pane named " " to be unstealable
- format slot 17 of player with yellow stained glass pane named " " to be unstealable
- format slot 18 of player with yellow stained glass pane named " " to be unstealable
- format slot 19 of player with yellow stained glass pane named " " to be unstealable
- format slot 20 of player with yellow stained glass pane named " " to be unstealable
- format slot 21 of player with yellow stained glass pane named " " to be unstealable
- format slot 22 of player with yellow stained glass pane named " " to be unstealable
- format slot 23 of player with yellow stained glass pane named " " to be unstealable
- format slot 24 of player with yellow stained glass pane named " " to be unstealable
- format slot 25 of player with yellow stained glass pane named " " to be unstealable
- format slot 26 of player with yellow stained glass pane named " " to be unstealable
- wait 0.1 second
- set {_random} to random integer between 1 and {CrateItemsTotal.{@open-crate}}
- format slot 13 of player with {CrateItem.{@open-crate}::%{_random}%} to be unstealable
- if {CrateItemCommand.{@open-crate}::%{_random}%} is set:
- if {@giveonwincommand} is true:
- give {CrateItem.{@open-crate}::%{_random}%} to player
- set {CrateCommand.%player%} to "%{CrateItemCommand.{@open-crate}::%{_random}%}%"
- replace "PLAYER" in {CrateCommand.%player%} with "%player's name%"
- execute console command "%{CrateCommand.%player%}%"
- else:
- give {CrateItem.{@open-crate}::%{_random}%} to player
- if {@open-messages} is true:
- message " {@prefix} &e¡Has ganado &a%{CrateItem.{@open-crate}::%{_random}%}'s name%&e!"
- if {@doautoclose} is true:
- wait {@autoclose} seconds
- close player's inventory
- else:
- message " {@prefix} &c¡No puedes abrir cajas en modo creativo!"
- on rightclick on {@crate-block}:
- if {chancetotal.%block's location%} isn't set:
- set {chancetotal.%block's location%} to 100
- if {CrateLocation.%block's location%} is set:
- cancel event
- if {key.%{CrateLocation.%block's location%}%.%player%} isn't set:
- set {key.%{CrateLocation.%block's location%}%.%player%} to 0
- if player's gamemode isn't creative:
- if {@virtual-key} is true:
- open chest with 1 row named "&b&l¿Abrir caja?" to player
- wait 1 tick
- set {virtual.%player%} to true
- set {virtualcrate.%player%} to block's location
- format slot 4 of player with {@key-item} named "&b&lLlaves %{CrateLocation.%block's location%}%: &e&l%{key.%{CrateLocation.%block's location%}%.%player%}%" with lore "{@hover-message}||&e{@website}" to be unstealable
- format slot 2 of player with green stained glass pane named "&a&lAbrir" to run [make player execute "open"]
- format slot 0 of player with green stained glass pane named "&a&lAbrir" to run [make player execute "open"]
- format slot 1 of player with green stained glass pane named "&a&lAbrir" to run [make player execute "open"]
- format slot 3 of player with green stained glass pane named "&a&lAbrir" to run [make player execute "open"]
- format slot 6 of player with red stained glass pane named "&c&lCancelar" to close
- format slot 5 of player with red stained glass pane named "&c&lCancelar" to close
- format slot 7 of player with red stained glass pane named "&c&lCancelar" to close
- format slot 8 of player with red stained glass pane named "&c&lCancelar" to close
- else if {@virtual-key} is false:
- if player's tool is {@key-item} named "{@key-name-color}Llave %{CrateLocation.%block's location%}%":
- remove {@key-item} named "{@key-name-color}Llave %{CrateLocation.%block's location%}%" from player's inventory
- set {opening.%player%} to true
- if {@animation} is false:
- loop 5 times:
- wait 0.1 second
- play mob spawner flames at target block
- play raw sound "note.bass" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.bassattack" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.harp" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.pling" at player with pitch 5 volume 10
- wait 0.1 second
- play raw sound "note.snare" at player with pitch 5 volume 10
- make player execute "randomtry"
- play raw sound "random.successful_hit" at player with pitch 1 volume 10
- delete {random}
- set {opening.%player%} to false
- else if {@animation} is true:
- open chest with 3 rows named "&d&l%{CrateLocation.%block's location%}%" to player
- wait 3 ticks
- if inventory name of player's current inventory is "&d&l%{CrateLocation.%block's location%}%":
- loop {@animation-length} times:
- play raw sound "note.pling" at player with pitch 1 volume 10
- format slot 0 of player with black stained glass pane to be unstealable
- format slot 1 of player with {@animation-item1} to be unstealable
- format slot 2 of player with {@animation-item1} to be unstealable
- format slot 3 of player with {@animation-item1} to be unstealable
- format slot 4 of player with torch to be unstealable
- format slot 5 of player with {@animation-item1} to be unstealable
- format slot 6 of player with {@animation-item1} to be unstealable
- format slot 7 of player with {@animation-item1} to be unstealable
- format slot 8 of player with black stained glass pane to be unstealable
- format slot 9 of player with black stained glass pane to be unstealable
- set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 10 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize1.%player%}%} to be unstealable
- set {_randomprize2.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 11 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize2.%player%}%} to be unstealable
- set {_randomprize3.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 12 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize3.%player%}%} to be unstealable
- set {_randomprize4.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize4.%player%}%} to be unstealable
- set {_randomprize5.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 14 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize5.%player%}%} to be unstealable
- set {_randomprize6.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 15 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize6.%player%}%} to be unstealable
- set {_randomprize7.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 16 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize7.%player%}%} to be unstealable
- format slot 17 of player with black stained glass pane to be unstealable
- format slot 18 of player with black stained glass pane to be unstealable
- format slot 19 of player with {@animation-item1} to be unstealable
- format slot 20 of player with {@animation-item1} to be unstealable
- format slot 21 of player with {@animation-item1} to be unstealable
- format slot 22 of player with torch to be unstealable
- format slot 23 of player with {@animation-item1} to be unstealable
- format slot 24 of player with {@animation-item1} to be unstealable
- format slot 25 of player with {@animation-item1} to be unstealable
- format slot 26 of player with black stained glass pane to be unstealable
- play raw sound "note.harp" at player with pitch 1 volume 10
- wait 0.3 seconds
- format slot 0 of player with black stained glass pane to be unstealable
- format slot 1 of player with {@animation-item1} to be unstealable
- format slot 2 of player with {@animation-item1} to be unstealable
- format slot 3 of player with {@animation-item1} to be unstealable
- format slot 4 of player with torch to be unstealable
- format slot 5 of player with {@animation-item1} to be unstealable
- format slot 6 of player with {@animation-item1} to be unstealable
- format slot 7 of player with {@animation-item1} to be unstealable
- format slot 8 of player with black stained glass pane to be unstealable
- format slot 9 of player with black stained glass pane to be unstealable
- set {_randomprize8.%player%} to {_randomprize1.%player%}
- format slot 11 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize8.%player%}%} to be unstealable
- set {_randomprize9.%player%} to {_randomprize2.%player%}
- format slot 12 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize9.%player%}%} to be unstealable
- set {_randomprize10.%player%} to {_randomprize3.%player%}
- format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize10.%player%}%} to be unstealable
- set {_randomprize11.%player%} to {_randomprize4.%player%}
- format slot 14 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize11.%player%}%} to be unstealable
- set {_randomprize12.%player%} to {_randomprize5.%player%}
- format slot 15 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize12.%player%}%} to be unstealable
- set {_randomprize13.%player%} to {_randomprize6.%player%}
- format slot 16 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize13.%player%}%} to be unstealable
- set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 10 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize1.%player%}%} to be unstealable
- format slot 17 of player with black stained glass pane to be unstealable
- format slot 18 of player with black stained glass pane to be unstealable
- format slot 19 of player with {@animation-item1} to be unstealable
- format slot 20 of player with {@animation-item1} to be unstealable
- format slot 21 of player with {@animation-item1} to be unstealable
- format slot 22 of player with torch to be unstealable
- format slot 23 of player with {@animation-item1} to be unstealable
- format slot 24 of player with {@animation-item1} to be unstealable
- format slot 25 of player with {@animation-item1} to be unstealable
- format slot 26 of player with black stained glass pane to be unstealable
- play raw sound "note.pling" at player with pitch 1 volume 10
- wait 0.3 second
- format slot 0 of player with black stained glass pane to be unstealable
- format slot 1 of player with {@animation-item3} to be unstealable
- format slot 2 of player with {@animation-item3} to be unstealable
- format slot 3 of player with {@animation-item3} to be unstealable
- format slot 4 of player with torch to be unstealable
- format slot 5 of player with {@animation-item3} to be unstealable
- format slot 6 of player with {@animation-item3} to be unstealable
- format slot 7 of player with {@animation-item3} to be unstealable
- format slot 8 of player with black stained glass pane to be unstealable
- format slot 9 of player with black stained glass pane to be unstealable
- set {_randomprize14.%player%} to {_randomprize3.%player%}
- format slot 12 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize14.%player%}%} to be unstealable
- set {randomprize15.%player%} to {_randomprize4.%player%}
- format slot 13 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{randomprize15.%player%}%} to be unstealable
- set {_randomprize16.%player%} to {_randomprize5.%player%}
- format slot 14 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize16.%player%}%} to be unstealable
- set {_randomprize17.%player%} to {_randomprize6.%player%}
- format slot 15 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize17.%player%}%} to be unstealable
- set {_randomprize18.%player%} to {_randomprize7.%player%}
- format slot 16 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize18.%player%}%} to be unstealable
- set {_randomprize2.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 11 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize1.%player%}%} to be unstealable
- set {_randomprize1.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot 10 of player with {CrateItem.%{CrateLocation.%block's location%}%::%{_randomprize1.%player%}%} to be unstealable
- format slot 17 of player with black stained glass pane to be unstealable
- format slot 18 of player with black stained glass pane to be unstealable
- format slot 19 of player with {@animation-item3} to be unstealable
- format slot 20 of player with {@animation-item3} to be unstealable
- format slot 21 of player with {@animation-item3} to be unstealable
- format slot 22 of player with torch to be unstealable
- format slot 23 of player with {@animation-item3} to be unstealable
- format slot 24 of player with {@animation-item3} to be unstealable
- format slot 25 of player with {@animation-item3} to be unstealable
- format slot 26 of player with black stained glass pane to be unstealable
- play raw sound "note.harp" at player with pitch 1 volume 10
- wait 0.2 second
- set {random} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%block's location%}%}
- if {@animation} is false:
- give {CrateItem.%{CrateLocation.%block's location%}%::%{random}%} to player
- else:
- make player execute "guirandomtry"
- if {@open-messages} is true:
- if {@animation} is false:
- broadcast " {@prefix} &a¡%player% &eha ganado &a%{CrateItem.%{CrateLocation.%block's location%}%::%{random}%}'s name%&e!"
- else:
- stop
- play raw sound "random.successful_hit" at player with pitch 1 volume 10
- delete {random}
- loop 2 times:
- format slot 10 of player with {@animation-item1} to be unstealable
- format slot 16 of player with {@animation-item1} to be unstealable
- wait 0.2 second
- format slot 11 of player with {@animation-item2} to be unstealable
- format slot 15 of player with {@animation-item2} to be unstealable
- wait 0.2 second
- format slot 12 of player with {@animation-item1} to be unstealable
- format slot 14 of player with {@animation-item1} to be unstealable
- wait 0.2 second
- format slot 10 of player with {@animation-item3} to be unstealable
- format slot 16 of player with {@animation-item3} to be unstealable
- wait 0.2 second
- format slot 11 of player with {@animation-item3} to be unstealable
- format slot 15 of player with {@animation-item3} to be unstealable
- wait 0.2 second
- format slot 12 of player with {@animation-item3} to be unstealable
- format slot 14 of player with {@animation-item3} to be unstealable
- if {@doautoclose} is true:
- wait {@autoclose} seconds
- set {opening.%player%} to false
- close player's inventory
- set {opening.%player%} to false
- else:
- message " {@prefix} &c¡No tienes la llave correcta!"
- if {@no-key-explosion} is true:
- push player backwards at speed 2
- play raw sound "random.explode" at player with pitch 5 volume 6
- else if {@no-key-explosion} is false:
- push player backwards at speed 0.9
- play raw sound "random.explode" at player with pitch 2 volume 3
- else:
- message " {@prefix} &c¡No puedes abrir cajas en modo creativo!"
- on break of {@crate-block}:
- if {CrateLocation.%block's location%} is set:
- if event-player has permission "megacrates.admin":
- if event-player is sneaking:
- set block to air
- message " {@prefix} &d&l¡Esa caja ha sido destruida!" to event-player
- wait 2 ticks
- close player's inventory
- stop
- else:
- message " {@prefix} &d&l¡Debes estar agachado (shift) para romper esa caja!"
- cancel event
- else:
- message " {@prefix} &cParece que no tienes permiso para hacer eso."
- # NOTA! Este comando es seguro, ya que solo se puede usar si el jugador esta abriendo una caja. Este es usado para escoger un item aleatorio de los que se han agregado. #
- # Este detecta si el nombre del inventario del jugador es igual al de la caja. #
- command /guirandomtry:
- trigger:
- if {opening.%player%} is true:
- if {CrateItemChance.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%} is set:
- set {randomprize15.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%player's target block's location%}%}
- set {randomchance.%player%} to random integer between 0 and 100
- if {randomchance.%player%} is less or equal to {CrateItemChance.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%}:
- format slot 13 of player with {CrateItem.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%} to be unstealable
- set {winplayer} to "%player%"
- if {@open-messages} is true:
- broadcast " {@prefix} &e¡&a%player% &egano &a%{CrateItem.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%}'s name%&e!"
- if {CrateItemCommand.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%} is set:
- if {@giveonwincommand} is true:
- give {CrateItem.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%} to player
- set {CrateCommand.%player%} to "%{CrateItemCommand.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%}%"
- replace "PLAYER" in {CrateCommand.%player%} with "%player's name%"
- execute console command "%{CrateCommand.%player%}%"
- else:
- give {CrateItem.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%} to player
- else:
- make player execute "guirandomtry"
- else:
- format slot 13 of player with {CrateItem.%{CrateLocation.%player's target block's location%}%::%{randomprize15.%player%}%} to be unstealable
- # NOTA! Este comando es seguro, ya que solo se puede usar si el jugador esta abriendo una caja. Este es usado para escoger un item aleatorio de los que se han agregado. #
- # Este detecta si el nombre del inventario del jugador es igual al de la caja. #
- command /randomtry:
- trigger:
- if {opening.%player%} is true:
- format slot 13 of player with {CrateItem.%{CrateLocation.%player's target block's location%}%::%{random}%} to be unstealable
- set {random.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%player's target block's location%}%}
- if {CrateItemChance.%{CrateLocation.%player's target block's location%}%::%{random.%player%}%} is set:
- set {random.%player%} to random integer between 1 and {CrateItemsTotal.%{CrateLocation.%player's target block's location%}%}
- set {randomchance.%player%} to random integer between 0 and 100
- if {randomchance.%player%} is less or equal to {CrateItemChance.%{CrateLocation.%player's target block's location%}%::%{random.%player%}%}:
- set {winitem.%player%} to "%{CrateItem.%{CrateLocation.%player's target block's location%}%::%{random.%player%}%}%"
- set {winplayer} to player's name
- if {@open-messages} is true:
- broadcast " {@prefix} &a¡%player% &egano &a%{winitem.%player%}'s name%&e!"
- if {CrateItemCommand.%{CrateLocation.%player's target block's location%}%::%{random.%player%}%} is set:
- if {@giveonwincommand} is true:
- give player {winitem.%player%}
- set {CrateCommand.%player%} to "%{CrateItemCommand.%{CrateLocation.%player's target block's location%}%::%{random.%player%}%}%"
- replace "PLAYER" in {CrateCommand.%player%} with "%player's name%"
- execute console command "%{CrateCommand.%player%}%"
- else:
- give player {winitem.%player%}
- else:
- make player execute "randomtry"
- else:
- set {winitem.%player%} to {CrateItem.%{CrateLocation.%player's target block's location%}%::%{random}%}
- on leftclick on {@crate-block}:
- if {CrateLocation.%block's location%} is set:
- open chest with 3 rows named "{@prefix} &eRecompensas" to player
- set {item} to 0
- set {times} to 0
- loop {CrateItemsTotal.%{CrateLocation.%block's location%}%} times:
- add 1 to {item}
- if {CrateItemChance.%{CrateLocation.%block's location%}%::%{item}%} isn't set:
- set {nochance} to 100/{CrateItemsTotal.%{CrateLocation.%block's location%}%}
- format slot {times} of player with {CrateItem.%{CrateLocation.%block's location%}%::%{item}%} named "&c%{CrateItem.%{CrateLocation.%block's location%}%::%{item}%}'s name%" with lore "%{CrateItem.%{CrateLocation.%block's location%}%::%{item}%}'s lore%||&eChance: &a%{nochance}% %%" to close
- else:
- format slot {times} of player with {CrateItem.%{CrateLocation.%block's location%}%::%{item}%} named "&c%{CrateItem.%{CrateLocation.%block's location%}%::%{item}%}'s name%" with lore "%{CrateItem.%{CrateLocation.%block's location%}%::%{item}%}'s lore%||&eChance: &a%{CrateItemChance.%{CrateLocation.%block's location%}%::%{item}%}% %%" to close
- add 1 to {times}
- if {CrateItemsTotal.%{CrateLocation.%block's location%}%} isn't set:
- set {slot} to 0
- loop 27 times:
- format slot {slot} of player with red stained glass pane named "&c&l¡No hay items!" with lore "&8• &bPor favor avisa a los administradores." to be unstealable
- add 1 to {slot}
- if {CrateItemsTotal.%{CrateLocation.%block's location%}%} is 0 or 1:
- set {slot} to 0
- loop 27 times:
- format slot {slot} of player with red stained glass pane named "&c&l¡No hay items!" with lore "&8• &bPor favor avisa a los administradores." to be unstealable
- add 1 to {slot}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement