Custom crate templates (Creating crate designs for free)

  • 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 comminuty!

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

LimeGlass

VIP
Supporter ++
Regular Diner
Addon Developer
Jan 24, 2017
633
443
73
26
location of "LimeGlass" parsed as player
Custom crate templates by LimeGlass

Basically I will be creating your crate ideas in any way you wish. All you have todo is explain how the crate rotates or moves with a picture or explaination.

Why am I doing this? Doesn't it seem like alot of work? Won't people request alot?
Yes and I don't mind. If I can help anyone in anyway for simply sharing my love for GUI's that's all fine with me.

Here are some crates you can use on the fly right now if you don't want to wait for me to respond :emoji_grinning:

(The spaces used to be tabs, SkUnity just converts them)
All Crates need SkQuery and Skellett or just Skript dev-35+

Class CSGO style:
79911b65564e1f63b0c52aa302072e005ab2b57b
code_language.skript:
options:
    #This is the name of the crate
    name: "&6Crates System"
on rightclick on jukebox:
    cancel event
    open chest with 3 rows named {@name} to player
    #Add your items below
    #If you want to adjust the percent of an item. Add more of the other items.
   #So if you want to make beacons rare. Add every item except beacon again. This raises the chance to get a different item than beacon.
    add stone, diamond, diamond sword, gold block, redstone, redstone block, beacon, name tag, emerald and gravel to {_roll::*}
    add dirt named "&6DIRT" to {_roll::*}
    #Speed option safety net, so running 0 ticks doesn't crash your server.
    #This is basically how fast the rolling starts (Should be higher than 0)
    set {_speedFinal} to 2
    #Selector settings (Where the selectors should be)
    set {_Selector1} to 4
    set {_Selector2} to 22
    #Main code below. This random integer is the time length of the crate opening, which is random.
    loop (random integer between 21 and 50) times:
        #If they close their inventory stop the system
        if inventory name of player's current inventory is not {@name}:
            stop
        #The {_sel} tells the script how many item slots there are, in order to save them.
        set {_sel} to 21
        loop {_sel} times:
            #This is the data saving for the scroll effect
            set {_sel2} to {_sel} - 1
            set {_item::%{_sel}%} to {_item::%{_sel2}%}
            subtract 1 from {_sel}
        #Grab a new item from the options
        set {_item::1} to a random element out of {_roll::*}
        #This below just updates the GUI
        loop integers between 0 and inventory size of player's current inventory - 1:
            if loop-number-2 is {_Selector1} or {_Selector2}:
                set slot loop-number-2 of player's current inventory to shiny light green stained glass pane named " "
            else:
                set slot loop-number-2 of player's current inventory to black stained glass pane named " "
            loop 9 times:
                set slot 8 + loop-number-3 of player's current inventory to {_item::%loop-number-3%}
        #This below is just sound. It plays it for the player.
        add 1 to {_sound}
        if {_sound} > 3:
            set {_sound} to 1
        if {_sound} = 1:
            play BLOCK_NOTE_PLING for player with volume 1 and pitch 4
        else if {_sound} = 2:
            play BLOCK_NOTE_PLING for player with volume 1 and pitch 3
        else if {_sound} = 3:
            play BLOCK_NOTE_PLING for player with volume 1 and pitch 1
        add 1 to {_speed}
        #This below causes the crate to slow down when it gets closer to the end of the animation. The greater the {_speed} test, the longer the tick delay will be.
        #Meaning it will slow down more of the speed every X number of updates.
        if {_speed} is 5:
            set {_speed} to 0
            add 1 to {_speedFinal}
        loop {_speedFinal} times:
            wait a tick
    #This is where you can give players or test for which item has won and give stuff based on that item.
    set {_wonItem} to slot 13 of player's current inventory
    message "You won %{_wonItem}%"
    give player {_wonItem}
#This is just a system so that they can't steal any of the items
on inventory click:
    if inventory name of player's current inventory is {@name}:
        cancel event
Hypixel soul crate
JucibUF.png

72114145-3142-46de-8edd-7ba1176a4c8e
code_language.skript:
options:
    #This is the name of the crate
    name: "&6Crates System"
on rightclick on gold block:
    player is not sneaking
    cancel event
    open chest with 5 rows named {@name} to player
    #Add your items below
    #If you want to adjust the percent of an item. Add more of the other items.
    #So if you want to make beacons rare. Add every item except beacon again. This raises the chance to get a different item than beacon.
    add stone, diamond, diamond sword, gold block, redstone, redstone block, beacon, name tag, emerald and gravel to {_roll::*}
    add dirt named "&6DIRT" to {_roll::*}
    #Speed option safety net, so running 0 ticks doesn't crash your server.
    #This is basically how fast the rolling starts (Should be higher than 0)
    set {_speedFinal} to 2
    #Selector settings (Where the selectors should be)
    set {_Selector1} to 21
    set {_Selector2} to 23
    #Main code below. This random integer is the time length of the crate opening, which is random.
    loop (random integer between 10 and 40) times:
        #If they close their inventory stop the system
        if inventory name of player's current inventory is not {@name}:
            stop
        #The {_sel} tells the script how many item slots there are, in order to save them.
        set {_sel} to 5
        loop {_sel} times:
            #This is the data saving for the scroll effect
            set {_sel2} to {_sel} - 1
            set {_item::%{_sel}%} to {_item::%{_sel2}%}
            subtract 1 from {_sel}
        #Grab a new item from the options
        set {_item::1} to a random element out of {_roll::*}
        #This below just updates the GUI
        loop integers between 0 and inventory size of player's current inventory - 1:
            if loop-number-2 is {_Selector1} or {_Selector2}:
                set slot loop-number-2 of player's current inventory to shiny light green stained glass pane named " "
            else:
                set slot loop-number-2 of player's current inventory to black stained glass pane named " "
            loop 5 times:
                set slot -5 + (9 * loop-number-3) of player's current inventory to {_item::%loop-number-3%}
        #This below is just sound. It plays it for the player.
        add 1 to {_sound}
        if {_sound} > 3:
            set {_sound} to 1
        if {_sound} = 1:
            play BLOCK_NOTE_PLING for player with volume 1 and pitch 4
        else if {_sound} = 2:
            play BLOCK_NOTE_PLING for player with volume 1 and pitch 3
        else if {_sound} = 3:
            play BLOCK_NOTE_PLING for player with volume 1 and pitch 1
        add 1 to {_speed}
        #This below causes the crate to slow down when it gets closer to the end of the animation. The greater the {_speed} test, the longer the tick delay will be.
        #Meaning it will slow down more of the speed every X number of updates.
        if {_speed} is 5:
            set {_speed} to 0
            add 1 to {_speedFinal}
        loop {_speedFinal} times:
            wait a tick
    #This is where you can give players or test for which item has won and give stuff based on that item.
    set {_wonItem} to slot 22 of player's current inventory
    message "You won %{_wonItem}%"
    give player {_wonItem}
#This is just a system so that they can't steal any of the items
on inventory click:
    if inventory name of player's current inventory is {@name}:
        cancel event
Lightning bolt crate
L3dEzUu.png
code_language.skript:
options:
    #This is the name of the crate
    name: "&6Crates System"
on rightclick on diamond block:
    player is not sneaking
    cancel event
    open chest with 5 rows named {@name} to player
    #Add your items below
    #If you want to adjust the percent of an item. Add more of the other items.
    #So if you want to make beacons rare. Add every item except beacon again. This raises the chance to get a different item than beacon.
    add stone, diamond, diamond sword, gold block, redstone, redstone block, beacon, name tag, emerald and gravel to {_roll::*}
    add dirt named "&6DIRT" to {_roll::*}
    #Speed option safety net, so running 0 ticks doesn't crash your server.
    #This is basically how fast the rolling starts (Should be higher than 0)
    set {_speedFinal} to 2
    #Selector settings (Where the selectors should be)
    set {_Selector1} to 13
    set {_Selector2} to 31
    set {_Selector3} to 21
    set {_Selector4} to 23
    #Main code below. This random integer is the time length of the crate opening, which is random.
    loop (random integer between 20 and 50) times:
        #If they close their inventory stop the system
        if inventory name of player's current inventory is not {@name}:
            stop
        #The {_sel} tells the script how many item slots there are, in order to save them.
        set {_sel} to 7
        loop {_sel} times:
            #This is the data saving for the scroll effect
            set {_sel2} to {_sel} - 1
            set {_item::%{_sel}%} to {_item::%{_sel2}%}
            subtract 1 from {_sel}
        #Grab a new item from the options
        set {_item::1} to a random element out of {_roll::*}
        #This below just updates the GUI
        loop integers between 0 and inventory size of player's current inventory - 1:
            if loop-number-2 is {_Selector1}, {_Selector2}, {_Selector3} or {_Selector4}:
                set slot loop-number-2 of player's current inventory to shiny light green stained glass pane named " "
            else:
                set slot loop-number-2 of player's current inventory to white stained glass pane named " "
            loop 9 times:
                if loop-number-3 = 1:
                    set slot 7 of player's current inventory to {_item::%loop-number-3%}
                else if loop-number-3 = 2:
                    set slot 15 of player's current inventory to {_item::%loop-number-3%}
                else if loop-number-3 = 3:
                    set slot 14 of player's current inventory to {_item::%loop-number-3%}
                else if loop-number-3 = 4:
                    set slot 22 of player's current inventory to {_item::%loop-number-3%}
                else if loop-number-3 = 5:
                    set slot 30 of player's current inventory to {_item::%loop-number-3%}
                else if loop-number-3 = 6:
                    set slot 29 of player's current inventory to {_item::%loop-number-3%}
                else if loop-number-3 = 7:
                    set slot 37 of player's current inventory to {_item::%loop-number-3%}
        #This below is just sound. It plays it for the player.
        add 1 to {_sound}
        if {_sound} > 3:
            set {_sound} to 1
        if {_sound} = 1:
            play BLOCK_NOTE_PLING for player with volume 1 and pitch 4
        else if {_sound} = 2:
            play BLOCK_NOTE_PLING for player with volume 1 and pitch 3
        else if {_sound} = 3:
            play BLOCK_NOTE_PLING for player with volume 1 and pitch 1
        add 1 to {_speed}
        #This below causes the crate to slow down when it gets closer to the end of the animation. The greater the {_speed} test, the longer the tick delay will be.
        #Meaning it will slow down more of the speed every X number of updates.
        if {_speed} is 6:
            set {_speed} to 0
            add 1 to {_speedFinal}
        loop {_speedFinal} times:
            wait a tick
    #This is where you can give players or test for which item has won and give stuff based on that item.
    set {_wonItem} to slot 22 of player's current inventory
    message "You won %{_wonItem}%"
    give player {_wonItem}
#This is just a system so that they can't steal any of the items
on inventory click:
    if inventory name of player's current inventory is {@name}:
        cancel event
 
Last edited:
Hey LimeGlass, Maybe you could try making a Casino type crate if possible?

It would be pretty awesome if they have to get the full row in order to collect the item.

Thanks :emoji_slight_smile:
 
  • Like
Reactions: Dylan The Beast
^ Private messaged this request
 
Last edited by a moderator:
Hello, can you add roullete type like this? I think it looks pretty cool.
27cf08e523645f30fee990a823aa36b651e70589
 
Hello, can you add roullete type like this? I think it looks pretty cool.
27cf08e523645f30fee990a823aa36b651e70589
https://gfycat.com/FreshDistantEider

code_language.skript:
function startThisShit(p: player):
  loop 12, 14, 30, 32, 13, 21, 23 and 31:
    set slot loop-value of {_p}'s current inventory to (check [loop-value is 13, 21, 23 or 31] ? light green glass : black glass)
  loop 100 times:
    loop 3, 4, 5, 15, 24, 33, 41, 40, 39, 29, 20 and 11:
      set slot loop-value-2 of {_p}'s current inventory to a random element out of {slotitems::*}
    set slot 22 of {_p}'s current inventory to glowing slot 4 of {_p}'s current inventory
    wait 1 tick
 
command /test:
  trigger:
    open chest with 5 rows named "Spinner Thing" to player
    loop numbers between 0 and (5*9)-1:
      set slot loop-value of player's current inventory to (check [loop-value is 12, 13, 14, 21, 22, 23, 30, 31 or 32] ? green glass : black glass)
 
on inventory click:
  if name of player's current inventory is "Spinner Thing":
    cancel the event
    if clicked slot is 12, 13, 14, 21, 22, 23, 30, 31 or 32:
      if clicked item is green glass:
        startThisShit(player)
      else if clicked slot is 22:
        give item amount of clicked item of type of clicked item to player
        close player's inventory
 
Last edited by a moderator:
https://gfycat.com/FreshDistantEider
code_language.skript:
function startThisShit(p: player):
  loop 12, 14, 30, 32, 13, 21, 23 and 31:
    set slot loop-value of {_p}'s current inventory to (check [loop-value is 13, 21, 23 or 31] ? light green glass : black glass)
  loop 100 times:
    loop 3, 4, 5, 15, 24, 33, 41, 40, 39, 29, 20 and 11:
      set slot loop-value-2 of {_p}'s current inventory to a random element out of {slotitems::*}
    set slot 22 of {_p}'s current inventory to glowing slot 4 of {_p}'s current inventory
    wait 1 tick

command /test:
  trigger:
    open chest with 5 rows named "Spinner Thing" to player
    loop invSize(player's current inventory):
      set slot loop-value of player's current inventory to (check [loop-value is 12, 13, 14, 21, 22, 23, 30, 31 or 32] ? green glass : black glass)

on inventory click:
  if name of player's current inventory is "Spinner Thing":
    cancel the event
    if clicked slot is 12, 13, 14, 21, 22, 23, 30, 31 or 32:
      if clicked item is green glass:
        startThisShit(player)
      else if clicked slot is 22:
        give item amount of clicked item of type of clicked item to player
        close player's inventory
Nice!

@MachisCZ If you would like me to make this still, please respond but Pika made a really good template above for you.

Also what's the invSize(player's current inventory) can you provide that so this works. Also Skellett has an expression to grab the inventory size and amount of rows.
 
Last edited by a moderator:
Damn Pika. That's sexy! Good work! @MachisCZ If you would like me to make this still, please respond but Pika made a really good template above for you.

Also what's the invSize(player's current inventory) can you provide that so this works. Also Skellett has an expression to grab the inventory size and amount of rows.
Huh, I thought I removed that before uploading. I edited it out now. You're right, it just gets the amount of rows and returns the numbers from 0 to (amount of slots - 1).
 
Pikachu's code not working for me: Error. I had no errors when reloading .sk file.
@LimeGlass can you do it by yourself? Thank you.
 
@Pikachu @MachisCZ The error above happened because
code_language.skript:
 set slot 22 of {_p}'s current inventory to glowing slot 4 of {_p}'s current inventory
slot 4 of {_p}'s current inventory returned null. Pika clearly tested on a server that you're not using. If you're using 1.8 it returns null I think. If you use 1.9+ it returns as air rather than null. I will fix this error from being in the console but it won't work even if I fix it. It's an issue in the script btw.
 
I am on 1.11 and using syntaxes from templates from this forum with no problems.
 
@Pikachu @MachisCZ The error above happened because
code_language.skript:
 set slot 22 of {_p}'s current inventory to glowing slot 4 of {_p}'s current inventory
slot 4 of {_p}'s current inventory returned null. Pika clearly tested on a server that you're not using. If you're using 1.8 it returns null I think. If you use 1.9+ it returns as air rather than null. I will fix this error from being in the console but it won't work even if I fix it. It's an issue in the script btw.
Nah, the issue is probably that he didn't put any items in the {slotitems::*} variable which resulted in the NPE because if he had the slot wouldn't be null since the code only runs after filling all the slots. @MachisCZ you have to put the items you want to have in the gui in the {slotitems::*} list
 
I have some (6) items in {slotitems::*} but still getting same error in console :/
Skript: 2.2 dev-25 Bensku
Error : https://hastebin.com/kifipuqese.vbs
code_language.skript:
command /machistest:
    permission: machis.test
    trigger:
        add apple to {slotitems::*}
        add stick to {slotitems::*}
        add diamond to {slotitems::*}
        add gold to {slotitems::*}
        add emerald to {slotitems::*}
        add coal to {slotitems::*}
        broadcast "%{slotitems::*}%"
        

function startThisShit(p: player):
  loop 12, 14, 30, 32, 13, 21, 23 and 31:
    set slot loop-value of {_p}'s current inventory to (check [loop-value is 13, 21, 23 or 31] ? light green glass : black glass)
  loop 100 times:
    loop 3, 4, 5, 15, 24, 33, 41, 40, 39, 29, 20 and 11:
      set slot loop-value-2 of {_p}'s current inventory to a random element out of {slotitems::*}
    set slot 22 of {_p}'s current inventory to glowing slot 4 of {_p}'s current inventory
    wait 1 tick
 
command /test:
  trigger:
    open chest with 5 rows named "Spinner Thing" to player
    loop numbers between 0 and (5*9)-1:
      set slot loop-value of player's current inventory to (check [loop-value is 12, 13, 14, 21, 22, 23, 30, 31 or 32] ? green glass : black glass)
 
on inventory click:
  if name of player's current inventory is "Spinner Thing":
    cancel the event
    if clicked slot is 12, 13, 14, 21, 22, 23, 30, 31 or 32:
      if clicked item is green glass:
        startThisShit(player)
      else if clicked slot is 22:
        give item amount of clicked item of type of clicked item to player
        close player's inventory
 
I have some (6) items in {slotitems::*} but still getting same error in console :/
Skript: 2.2 dev-25 Bensku
Error : https://hastebin.com/kifipuqese.vbs
code_language.skript:
command /machistest:
    permission: machis.test
    trigger:
        add apple to {slotitems::*}
        add stick to {slotitems::*}
        add diamond to {slotitems::*}
        add gold to {slotitems::*}
        add emerald to {slotitems::*}
        add coal to {slotitems::*}
        broadcast "%{slotitems::*}%"
       

function startThisShit(p: player):
  loop 12, 14, 30, 32, 13, 21, 23 and 31:
    set slot loop-value of {_p}'s current inventory to (check [loop-value is 13, 21, 23 or 31] ? light green glass : black glass)
  loop 100 times:
    loop 3, 4, 5, 15, 24, 33, 41, 40, 39, 29, 20 and 11:
      set slot loop-value-2 of {_p}'s current inventory to a random element out of {slotitems::*}
    set slot 22 of {_p}'s current inventory to glowing slot 4 of {_p}'s current inventory
    wait 1 tick
 
command /test:
  trigger:
    open chest with 5 rows named "Spinner Thing" to player
    loop numbers between 0 and (5*9)-1:
      set slot loop-value of player's current inventory to (check [loop-value is 12, 13, 14, 21, 22, 23, 30, 31 or 32] ? green glass : black glass)
 
on inventory click:
  if name of player's current inventory is "Spinner Thing":
    cancel the event
    if clicked slot is 12, 13, 14, 21, 22, 23, 30, 31 or 32:
      if clicked item is green glass:
        startThisShit(player)
      else if clicked slot is 22:
        give item amount of clicked item of type of clicked item to player
        close player's inventory
You can either check if the slot is set before that line or try removing the word glowing
 
Hey, are you still making theese type of crate templates?