Crate Inventory / GUI Issues

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

  • 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.
Hey sorry for not responding for a while,
Could you possibly give a little example of what you mean by that? If not that's okay, I just figured I would ask
As I said in the past I'm not too familiar with the different types of variables and how they work, so you might need to be a little more erm... explanatory? With what you mean. I apologize for asking for all this help but it's super close to done and hopefully after it's finished I can take some of the knowledge I've gained from this thread and your help and maybe put it into some of any future project I do ^^

I feel bad though asking if you could show me an example of what you mean, I don't mean to sound like I want you to spoon feed me the code or anything :C I'm just better at learning by seeing, rather than explaining, if that makes sense.
With the first part I mean something like this:
Code:
set {_i} to 1
loop {_l::*}:
    # code, use {_i} as the iteration
    add 1 to {_i}
And for the second part:
Code:
set {_item} to slot {slot::%player%::%event-slot%} of current inventory of player
# {_item} is the variable with the correct item here
 
So would it look more something like this or-?
I think I understand what you mean by the 2nd part now, the 1st part is still a little cloudy for me
Trying to follow with you as much as I plausibly can I'm having a bit of troubles though.
code_language.skript:
    set {_item} to slot {slot::%player%::%event-slot%} of current inventory of player
        loop all items in player's current inventory:
        set {_i} to 0
            loop {_l::*}:
                add 1 to {_i}
                slot {_i} of player's current inventory is not ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
                    name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
                       set slot 49 of player's current inventory to glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!"
                       stop
Also I read up on this about the different types of variables and I understand them a liiiiiittle better?
Here's the link if anyone wants it http://en.njol.ch/projects/skript/doc/variables
[doublepost=1558874901,1558874406][/doublepost]I realize now that the numbers in "slot (numbers) of player's current inventory is ender chest name..." should probably have been changed to {_i}, edited above ^^ correct me if I'm wrong
 
So would it look more something like this or-?
I think I understand what you mean by the 2nd part now, the 1st part is still a little cloudy for me
Trying to follow with you as much as I plausibly can I'm having a bit of troubles though.
code_language.skript:
    set {_item} to slot {slot::%player%::%event-slot%} of current inventory of player
        loop all items in player's current inventory:
        set {_i} to 0
            loop {_l::*}:
                add 1 to {_i}
                slot {_i} of player's current inventory is not ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
                    name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
                       set slot 49 of player's current inventory to glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!"
                       stop
Also I read up on this about the different types of variables and I understand them a liiiiiittle better?
Here's the link if anyone wants it http://en.njol.ch/projects/skript/doc/variables
[doublepost=1558874901,1558874406][/doublepost]I realize now that the numbers in "slot (numbers) of player's current inventory is ender chest name..." should probably have been changed to {_i}, edited above ^^ correct me if I'm wrong
I think I understood you wrong, sorry for that. You should use contains (or in your case, does not contain) for the condition if none of the slots is an enderchest.
 
I think I understood you wrong, sorry for that. You should use contains (or in your case, does not contain) for the condition if none of the slots is an enderchest.

Oooh, no problem! Thanks I've give it a shot and let you know if something happens :emoji_slight_smile:
[doublepost=1558876031,1558875661][/doublepost]
code_language.skript:
set {_i} to 0
    loop {_l::*}:
       add 1 to {_i}
       slot {_i} of player's current inventory does not contain ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
           name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
                set slot 49 of player's current inventory to glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!"
                stop
So like this?
If so it gives an error:

Can't understand condition for "slot {_i} of player's current inventory does not contain ender chest..."
"slot 32, 31, 30, 23, 22, 21, 14, 13 and 12 of player's current inventory does not contain ender chest..." also didn't work with & w/o the {_i} and {_l::*} variables, gives same error

EDIT: ah wait nevermind I assume you mean
code_language.skript:
loop all items in player's current inventory:
    player's current inventory does not contain ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
        name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
            set slot 49 of player's current inventory to glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!"
            stop
Not the other one I sent
 
Last edited:
Oooh, no problem! Thanks I've give it a shot and let you know if something happens :emoji_slight_smile:
[doublepost=1558876031,1558875661][/doublepost]
code_language.skript:
set {_i} to 0
    loop {_l::*}:
       add 1 to {_i}
       slot {_i} of player's current inventory does not contain ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
           name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
                set slot 49 of player's current inventory to glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!"
                stop
So like this?
If so it gives an error:

Can't understand condition for "slot {_i} of player's current inventory does not contain ender chest..."
"slot 32, 31, 30, 23, 22, 21, 14, 13 and 12 of player's current inventory does not contain ender chest..." also didn't work with & w/o the {_i} and {_l::*} variables, gives same error

EDIT: ah wait nevermind I assume I mean
code_language.skript:
loop all items in player's current inventory:
    player's current inventory does not contain ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
        name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
            set slot 49 of player's current inventory to glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!"
            stop
Not the other one I sent
Yea that's what I meant
 
Yea that's what I meant

Right that worked! Awesome! That issues taken care of now the last thing is the stuff I wrote for giving the items to the players isn't actually giving it to them, any issues you see here?
code_language.skript:
set {_item} to slot {slot::%player%::%event-slot%} of current inventory of player

code_language.skript:
on inventory close:
    name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
        loop all items in player's current inventory:
            slot 32, 31, 30, 23, 22, 21, 14, 13 and 12 of player's current inventory is ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
                wait 1 tick
                give 1 ender chest named "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-" with lore "&7A mysterious box found in the depths of", "&7the Irothai Caverns, there may be more", "&7down there, but this is the first of it's", "&7kind to see the light of day...", "&k", "&f&lNORMAL REWARDS:", "&7 - x32 Diamond Blocks", "&7 - x256 Bottles of Enchanting", "&7 - x2 Beacons", "&7 - x1 Irothian Pickaxe", "&7 - x64 Golden Apples", "&k", "&5&lEPIC REWARDS:", "&7 - &5x1 Reward Loot Crate &7(Tier 1 - 3)", "&7 - &5x2 Enchanted Golden Apples", "&7 - &5x1 Shulker Box", "&7 - &5x1 Mending Enchanted Book", "&7 - &5x3 Random Custom Enchants", "&k", "&6&lLEGENDARY REWARDS:", "&7 - &ex3 Random Loot Crates &7(Tier 2 - 4)", "&7 - &ex1 Experience Booster &7(4 Hours)", "&7 - &ex1 Command Access: &7/sethome, /home", "&7 - &ex5 Random Custom Enchants", "&7 - &ex1 Dragon Egg", "&7 - &ex1 Elytra", "&k", "&4&lDIVINE REWARDS:", "&7 - &cx1 &k::&7&l Irothian Knight VKit Access &c&k::", "&7 - &cx1 &k::&7&l Irothai Caverns Key &c&k::", "&7 - &cx1 Potion of Unlimited Buffs &7(3 Uses)", "&7 - &cx2 Totems of Undying", "&7 - &cx1 Random Divine Custom Enchant" and "&7 - &cx1 Admin Item" to player
                stop
            slot 49 of player's current inventory is red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!":
                wait 1 tick
                open event-inventory to player
                stop
            slot 49 of player's current inventory is not red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!":
                slot 49 of player's current inventory is glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!":
                    wait 1 tick
                    open event-inventory to player
                    stop


            slot 49 of player's current inventory is not red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!":
                slot 49 of player's current inventory is not glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!":
                    {_item}
                    stop

(I separated the part of the code that I wrote in this 2nd code block that is supposed to give the items to the player.)
(Gives no items, not even 1. No errors)
 
Right that worked! Awesome! That issues taken care of now the last thing is the stuff I wrote for giving the items to the players isn't actually giving it to them, any issues you see here?
code_language.skript:
set {_item} to slot {slot::%player%::%event-slot%} of current inventory of player

code_language.skript:
on inventory close:
    name of player's current inventory is "&lIROTHAI CAVERNS LOOTBOX":
        loop all items in player's current inventory:
            slot 32, 31, 30, 23, 22, 21, 14, 13 and 12 of player's current inventory is ender chest named "&6&l???" with lore "&7Click to redeem a random item" and "&7from the Irothai Caverns&7 Lootbox!":
                wait 1 tick
                give 1 ender chest named "&4&l-=+> &c&k::&7 Irothai Caverns Lootbox &c&k::&4&l <+=-" with lore "&7A mysterious box found in the depths of", "&7the Irothai Caverns, there may be more", "&7down there, but this is the first of it's", "&7kind to see the light of day...", "&k", "&f&lNORMAL REWARDS:", "&7 - x32 Diamond Blocks", "&7 - x256 Bottles of Enchanting", "&7 - x2 Beacons", "&7 - x1 Irothian Pickaxe", "&7 - x64 Golden Apples", "&k", "&5&lEPIC REWARDS:", "&7 - &5x1 Reward Loot Crate &7(Tier 1 - 3)", "&7 - &5x2 Enchanted Golden Apples", "&7 - &5x1 Shulker Box", "&7 - &5x1 Mending Enchanted Book", "&7 - &5x3 Random Custom Enchants", "&k", "&6&lLEGENDARY REWARDS:", "&7 - &ex3 Random Loot Crates &7(Tier 2 - 4)", "&7 - &ex1 Experience Booster &7(4 Hours)", "&7 - &ex1 Command Access: &7/sethome, /home", "&7 - &ex5 Random Custom Enchants", "&7 - &ex1 Dragon Egg", "&7 - &ex1 Elytra", "&k", "&4&lDIVINE REWARDS:", "&7 - &cx1 &k::&7&l Irothian Knight VKit Access &c&k::", "&7 - &cx1 &k::&7&l Irothai Caverns Key &c&k::", "&7 - &cx1 Potion of Unlimited Buffs &7(3 Uses)", "&7 - &cx2 Totems of Undying", "&7 - &cx1 Random Divine Custom Enchant" and "&7 - &cx1 Admin Item" to player
                stop
            slot 49 of player's current inventory is red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!":
                wait 1 tick
                open event-inventory to player
                stop
            slot 49 of player's current inventory is not red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!":
                slot 49 of player's current inventory is glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!":
                    wait 1 tick
                    open event-inventory to player
                    stop


            slot 49 of player's current inventory is not red stained glass pane named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!", "&k", "&4You must open your main rewards before" and "&4you can open your &nDIVINE&4 reward!":
                slot 49 of player's current inventory is not glowing chorus flower named "&4&lDIVINE REWARD" with lore "&7Click to receive a guaranteed", "&6&lLEGENDARY&7 tier reward or higher!", "&k" and "&6Legendary&e and &4Divine&e reward", "&echances are increased!":
                    {_item}
                    stop

(I separated the part of the code that I wrote in this 2nd code block that is supposed to give the items to the player.)
(Gives no items, not even 1. No errors)
Well I don't see a give effect anywhere or the set item line
 
I set "{_item}" to
code_language.skript:
give {_item} to player
and that didn't work

Also the set event is above the thing that checks if all 9 ender chests don't exist, didn't add it to the code block when I sent that, sorry for that
code_language.skript:
set {_item} to slot {slot::%player%::%event-slot%} of current inventory of player
That's what I set it to ^^

EDIT: Currently working on the code from scratch with TPGamesNL and AsuDev (Revelationage) via Discord and will post the finished result on the thread so people can see how it looks and what I changed to resolve the issues on this thread, might take a little but if possible don't kill the thread until I post that update, thanks~
 
Last edited:
What do you meaning with `roll`?


You can try to re-open the menu on inventory close (do wait a tick). You can re-open it with `open event-inventory to player`

I think this is the best solution of what you want.
If it still don't works, tell us maybe we can help again.
:emoji_wink:
 
Status
Not open for further replies.