Crates Skript.

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Jun 13, 2019
3
0
0
Hi, so I've been looking to make a crates skript but I'm afraid my skripting knowledge is not high enough to make what I'm looking for. Basiclly a crates skript cs-go rolling style and lets say chance for wood sword is 90% and diamond sword 10% and the crate would roll through 50 items. It would show the wood sword 45 times and the diamond sword 5 times and when it lands make the glass the item is in enchanted. Also playing the sound "minecraft:entity.experience_orb_pickup" <-- not sure thats the correct name basically the sound of when u pickup an experience orb maybe make it slow down as the roll is starting to slow down.
<glass> <glass> <glass> <enchanted glass> <glass> <glass> <glass>
item item item Item you won item item item
<glass> <glass> <glass> <enchanted glass> <glass> <glass> <glass>

Anyone up for the challenge?
Thanks!
 
Hi, so I've been looking to make a crates skript but I'm afraid my skripting knowledge is not high enough to make what I'm looking for. Basiclly a crates skript cs-go rolling style and lets say chance for wood sword is 90% and diamond sword 10% and the crate would roll through 50 items. It would show the wood sword 45 times and the diamond sword 5 times and when it lands make the glass the item is in enchanted. Also playing the sound "minecraft:entity.experience_orb_pickup" <-- not sure thats the correct name basically the sound of when u pickup an experience orb maybe make it slow down as the roll is starting to slow down.
<glass> <glass> <glass> <enchanted glass> <glass> <glass> <glass>
item item item Item you won item item item
<glass> <glass> <glass> <enchanted glass> <glass> <glass> <glass>

Anyone up for the challenge?
Thanks!
Some time ago I did a skript de crates, here I will leave you a small sample of how I did it. It will not fulfill everything you asks, but it will do something good.
It should be noted that Part of the text is in Spanish. The version I used was 1.8.8 (Spigot) and for skript it was 2.2 dev36
code_language.skript:
function worldAbriendoLaCajaPaneles(p: player):

    set {_t} to random integer between 1 and 5
    set {_c} to random integer between 0 and 9
       
    if {_t} = 1:
        format a gui slot 0 of {_p} with pink stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 1 of {_p} with yellow stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 2 of {_p} with light blue stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 3 of {_p} with light green stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 5 of {_p} with orange stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 6 of {_p} with red stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 7 of {_p} with white stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 8 of {_p} with magenta stained glass pane named "§%{_c}%&l???" to do nothing
    else if {_t} = 2:
        format a gui slot 2 of {_p} with green stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 0 of {_p} with yellow stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 1 of {_p} with light blue stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 5 of {_p} with light green stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 7 of {_p} with orange stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 8 of {_p} with red stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 6 of {_p} with white stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 3 of {_p} with magenta stained glass pane named "§%{_c}%&l???" to do nothing
    else if {_t} = 3:
        format a gui slot 0 of {_p} with purple stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 1 of {_p} with blue stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 2 of {_p} with brown stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 3 of {_p} with cyan stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 5 of {_p} with light green stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 6 of {_p} with light blue stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 7 of {_p} with orange stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 8 of {_p} with yellow stained glass pane named "§%{_c}%&l???" to do nothing
    else if {_t} = 4:
        format a gui slot 0 of {_p} with white stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 1 of {_p} with gray stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 2 of {_p} with green stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 3 of {_p} with purple stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 5 of {_p} with light blue stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 6 of {_p} with yellow stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 7 of {_p} with cyan stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 8 of {_p} with blue stained glass pane named "§%{_c}%&l???" to do nothing
    else if {_t} = 5:
        format a gui slot 0 of {_p} with light green stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 1 of {_p} with orange stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 2 of {_p} with white stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 3 of {_p} with yellow stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 5 of {_p} with light blue stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 6 of {_p} with magenta stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 7 of {_p} with black stained glass pane named "§%{_c}%&l???" to do nothing
        format a gui slot 8 of {_p} with pink stained glass pane named "§%{_c}%&l???" to do nothing
       
           
               

on click:
    if "%region at player%" contains "crates":
        if clicked block is iron block:
            cancel event
            set {_loreitem 1} to "&eEste item fue creado por mineros"
            set {_loreitem 2} to "&equienes luego de pasar meses de agotador"
            set {_loreitem 3} to "&etrabajo y sufrimiento lograron obtener"
            set {_loreitem 4} to "&eeste maravilloso producto para usted."
           
            set {_rankup.itemname} to "&eCaja &7RankUp"
            set {_rankup.item} to tripwire hook named {_rankup.itemname}
            set line 2 of lore of {_rankup.item} to "&eDescubre lo que ganaras con"
            set line 3 of lore of {_rankup.item} to "&ela llave %{_rankup.itemname}%&e en &n/warp crates"
            enchant {_rankup.item} with unbreaking 9999
            if player's held item != {_rankup.item}:
                message "&cNecesitas la llave &7RankUp&c para abrir esta caja!"
                stop
            if player's held item = {_rankup.item}:
                message "&eAbriendo la %{_rankup.itemname}%&e..."
                open virtual chest inventory with size 1 named "%{_rankup.itemname}%" to player
                remove 1 of {_rankup.item} from player's inventory
               
                set {_sorteo1} to iron helmet named "%{_rankup.itemname}%"
                set line 2 of lore of {_sorteo1} to {_loreitem 1}
                set line 3 of lore of {_sorteo1} to {_loreitem 2}
                set line 4 of lore of {_sorteo1} to {_loreitem 3}
                set line 5 of lore of {_sorteo1} to {_loreitem 4}
                enchant {_sorteo1} with protection 5
                enchant {_sorteo1} with unbreaking 3
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo1} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo2} to iron chestplate named "%{_rankup.itemname}%"
                set line 2 of lore of {_sorteo2} to {_loreitem 1}
                set line 3 of lore of {_sorteo2} to {_loreitem 2}
                set line 4 of lore of {_sorteo2} to {_loreitem 3}
                set line 5 of lore of {_sorteo2} to {_loreitem 4}
                enchant {_sorteo2} with protection 5
                enchant {_sorteo2} with unbreaking 3
                enchant {_sorteo2} with knockback 1
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo2} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo3} to iron leggings named "%{_rankup.itemname}%"
                set line 2 of lore of {_sorteo3} to {_loreitem 1}
                set line 3 of lore of {_sorteo3} to {_loreitem 2}
                set line 4 of lore of {_sorteo3} to {_loreitem 3}
                set line 5 of lore of {_sorteo3} to {_loreitem 4}
                enchant {_sorteo3} with protection 5
                enchant {_sorteo3} with unbreaking 3
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo3} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo4} to iron boots named "%{_rankup.itemname}%"
                set line 2 of lore of {_sorteo4} to {_loreitem 1}
                set line 3 of lore of {_sorteo4} to {_loreitem 2}
                set line 4 of lore of {_sorteo4} to {_loreitem 3}
                set line 5 of lore of {_sorteo4} to {_loreitem 4}
                enchant {_sorteo4} with protection 5
                enchant {_sorteo4} with unbreaking 3
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo4} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo5} to iron sword named "%{_rankup.itemname}%"
                set line 2 of lore of {_sorteo5} to {_loreitem 1}
                set line 3 of lore of {_sorteo5} to {_loreitem 2}
                set line 4 of lore of {_sorteo5} to {_loreitem 3}
                set line 5 of lore of {_sorteo5} to {_loreitem 4}
                enchant {_sorteo5} with sharpness 3
                enchant {_sorteo5} with looting 2
                enchant {_sorteo5} with unbreaking 3
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo5} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo6} to iron pickaxe named "%{_rankup.itemname}%"
                set line 2 of lore of {_sorteo6} to {_loreitem 1}
                set line 3 of lore of {_sorteo6} to {_loreitem 2}
                set line 4 of lore of {_sorteo6} to {_loreitem 3}
                set line 5 of lore of {_sorteo6} to {_loreitem 4}
                enchant {_sorteo6} with efficiency 4
                enchant {_sorteo6} with fortune 3
                enchant {_sorteo6} with unbreaking 4
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo6} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo7} to diamond pickaxe named "%{_rankup.itemname}%"
                set line 2 of lore of {_sorteo7} to {_loreitem 1}
                set line 3 of lore of {_sorteo7} to {_loreitem 2}
                set line 4 of lore of {_sorteo7} to {_loreitem 3}
                set line 5 of lore of {_sorteo7} to {_loreitem 4}
                enchant {_sorteo7} with efficiency 5
                enchant {_sorteo7} with fortune 5
                enchant {_sorteo7} with unbreaking 5
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo7} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo8} to paper named "&2&l$100.000"
                enchant {_sorteo8} with unbreaking 9999
                set line 2 of lore of {_sorteo8} to "&eDale &nclick derecho&e a este item"
                set line 3 of lore of {_sorteo8} to "&epara que se te añada el dinero."
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo8} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo9} to paper named "&2&l$200.000"
                enchant {_sorteo9} with unbreaking 9999
                set line 2 of lore of {_sorteo9} to "&eDale &nclick derecho&e a este item"
                set line 3 of lore of {_sorteo9} to "&epara que se te añada el dinero."
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo9} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo10} to golden pickaxe named "%{_rankup.itemname}%"
                set line 2 of lore of {_sorteo10} to {_loreitem 1}
                set line 3 of lore of {_sorteo10} to {_loreitem 2}
                set line 4 of lore of {_sorteo10} to {_loreitem 3}
                set line 5 of lore of {_sorteo10} to {_loreitem 4}
                enchant {_sorteo10} with efficiency 50
                enchant {_sorteo10} with fortune 6
                enchant {_sorteo10} with unbreaking 5
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo10} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo11} to "&eCaja &a&lVIP"
                set {_sorteo11.item} to tripwire hook named {_sorteo11}
                set line 2 of lore of {_sorteo11.item} to "&eDescubre lo que ganaras con"
                set line 3 of lore of {_sorteo11.item} to "&ela llave %{_sorteo11}%&e en &n/warp crates"
                enchant {_sorteo11.item} with unbreaking 9999
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo11.item} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_rankup.item} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_sorteo13} to bow named "%{_rankup.itemname}%"
                set line 2 of lore of {_sorteo13} to {_loreitem 1}
                set line 3 of lore of {_sorteo13} to {_loreitem 2}
                set line 4 of lore of {_sorteo13} to {_loreitem 3}
                set line 5 of lore of {_sorteo13} to {_loreitem 4}
                enchant {_sorteo13} with power 4
                enchant {_sorteo13} with flame 1
                enchant {_sorteo13} with unbreaking 3
                worldAbriendoLaCajaPaneles(player)
                format a gui slot 4 of player with {_sorteo13} to do nothing
                play "CLICK" to player at volume 1
               
                wait 4 ticks
               
                set {_r} to random integer between 1 and 13
                set {_???} to 0
                loop 9 times:
                    format a gui slot {_???} of player with BUCKET named "&8&l0%%" to do nothing
                    add 1 to {_???}
                play "VILLAGER_IDLE" to player at volume 1
                wait 20 ticks
                format a gui slot 0 of player with WATER BUCKET named "&7&l23%%" to do nothing
                format a gui slot 8 of player with WATER BUCKET named "&7&l23%%" to do nothing
                play "VILLAGER_NO" to player at volume 1
                wait 20 ticks
                format a gui slot 1 of player with WATER BUCKET named "&7&l56%%" to do nothing
                format a gui slot 7 of player with WATER BUCKET named "&7&l56%%" to do nothing
                play "VILLAGER_NO" to player at volume 1
                wait 20 ticks
                format a gui slot 2 of player with WATER BUCKET named "&6&l81%%" to do nothing
                format a gui slot 6 of player with WATER BUCKET named "&6&l81%%" to do nothing
                play "VILLAGER_NO" to player at volume 1
                wait 20 ticks
                format a gui slot 3 of player with WATER BUCKET named "&a&l99%%" to do nothing
                format a gui slot 5 of player with WATER BUCKET named "&a&l99%%" to do nothing
                play "VILLAGER_NO" to player at volume 1
                wait 20 ticks
                if {_r} = 1:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo1} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo1} to player's inventory
                else if {_r} = 2:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo2} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo2} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 3:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo3} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo3} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 4:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo4} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo4} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 5:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo5} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo5} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 6:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo6} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo6} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 7:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo7} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo7} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 8:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo8} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo8} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 9:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo9} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo9} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 10:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo10} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo10} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 11:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo11} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo11.item} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 12:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo12} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_rankup.item} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                else if {_r} = 13:
                    format a gui slot 3 of player with GOLD INGOT named "&6&lFelicidades!" to do nothing
                    format a gui slot 5 of player with DIAMOND named "&b&lFelicidades" to do nothing
                    format a gui slot 4 of player with {_sorteo13} to do nothing 
                    play "VILLAGER_YES" to player at volume 1
                    give 1 of {_sorteo13} to player's inventory
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
                    wait 10 ticks
                    spawn 1 firework at player's location
 
yeah not really what i was looking for I thought i could add the items ingame with custom chances as i said in the post
 
Status
Not open for further replies.