I want to know how to open GUI from GUI

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

DEVILHARRT

Member
Dec 2, 2023
2
0
1
26
In creating a GUI shop with a page, I tried to create a second new GUI from the first GUI, but I wrote the code because I wanted to open a third new GUI from the second GUI, but it goes from the first GUI to the third GUI. I want to know the reason.
Code:
command /foodshop:
    trigger:
        open chest with 6 row named "&1&lfoodshop" to player
        set {_slot} to 0
        loop 54 times:
            set slot {_slot} of current inventory of player to black stained glass pane
            add 1 to {_slot}

on inventory click:
    if name of player's current inventory contains "&1&lfoodshop":
        if clicked raw slot is 50:
            open chest with 6 row named "&1&lfoodshop2" to player
            set {_slot} to 0
            loop 54 times:
                set slot {_slot} of current inventory of player to black stained glass pane
                add 1 to {_slot}

on inventory click:
    if name of player's current inventory contains "&1&lfoodshop2":
        if clicked raw slot is 50:
            open chest with 6 row named "&1&lfoodshop3" to player
            set {_slot} to 0
            loop 54 times:
                set slot {_slot} of current inventory of player to black stained glass pane
                add 1 to {_slot}
 
In creating a GUI shop with a page, I tried to create a second new GUI from the first GUI, but I wrote the code because I wanted to open a third new GUI from the second GUI, but it goes from the first GUI to the third GUI. I want to know the reason.
Code:
command /foodshop:
    trigger:
        open chest with 6 row named "&1&lfoodshop" to player
        set {_slot} to 0
        loop 54 times:
            set slot {_slot} of current inventory of player to black stained glass pane
            add 1 to {_slot}

on inventory click:
    if name of player's current inventory contains "&1&lfoodshop":
        if clicked raw slot is 50:
            open chest with 6 row named "&1&lfoodshop2" to player
            set {_slot} to 0
            loop 54 times:
                set slot {_slot} of current inventory of player to black stained glass pane
                add 1 to {_slot}

on inventory click:
    if name of player's current inventory contains "&1&lfoodshop2":
        if clicked raw slot is 50:
            open chest with 6 row named "&1&lfoodshop3" to player
            set {_slot} to 0
            loop 54 times:
                set slot {_slot} of current inventory of player to black stained glass pane
                add 1 to {_slot}
It could be easier to use a function for your GUIs to manage them better. I always do that and in my opinion, it makes it much easier to code GUIs with multiple pages/menus. It may be faster too than the alternative.
 
It could be easier to use a function for your GUIs to manage them better. I always do that and in my opinion, it makes it much easier to code GUIs with multiple pages/menus. It may be faster too than the alternative.
luke stop reacting to my messages