open inventory with 3 rows - Skript would not work

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

Ilycool

Member
Feb 28, 2024
1
0
1
18
command /event [<text>] [<offlineplayer>]:
permission: op
trigger:
if arg 1 is not set:
send ""
send "&7Het &9&lBlok&f&lStad &7Event Panel is gemaakt door IlyCool"
send ""
send "&f&lCommands:"
send "&7/event <command:/event keyall>&ckeyall<reset>"
send ""
send "&c&lHey niks als je meer wil in deze command lijst en functies laat het dan weten gwn effe berichtje sturen"
if arg 1 is "keyall":
wait a tick
set {_gui} to chest inventory with 3 rows named "&8&lEvent &7| &9&lBlok&f&lStad"
set slot 0 of {_gui} to black stained glass pane named "&0"
set slot 1 of {_gui} to black stained glass pane named "&0"
set slot 2 of {_gui} to black stained glass pane named "&0"
set slot 3 of {_gui} to black stained glass pane named "&0"
set slot 4 of {_gui} to black stained glass pane named "&0"
set slot 5 of {_gui} to black stained glass pane named "&0"
set slot 6 of {_gui} to black stained glass pane named "&0"
set slot 7 of {_gui} to black stained glass pane named "&0"
set slot 8 of {_gui} to black stained glass pane named "&0"
set slot 9 of {_gui} to black stained glass pane named "&0"
set slot 10 of {_gui} to lime_concrete named "&aGrote Key all!"
set slot 11 of {_gui} to black stained glass pane named "&0"
set slot 12 of {_gui} to black stained glass pane named "&0"
set slot 13 of {_gui} to lime_concrete named "&aMiddel Key all!"
set slot 14 of {_gui} to black stained glass pane named "&0"
set slot 15 of {_gui} to black stained glass pane named "&0"
set slot 16 of {_gui} to lime_concrete named "&aKleine Key all!"
set slot 17 of {_gui} to black stained glass pane named "&0"
set slot 18 of {_gui} to black stained glass pane named "&0"
set slot 19 of {_gui} to black stained glass pane named "&0"
set slot 20 of {_gui} to black stained glass pane named "&0"
set slot 21 of {_gui} to black stained glass pane named "&0"
set slot 22 of {_gui} to red_concrete named "&cSluit"
set slot 23 of {_gui} to black stained glass pane named "&0"
set slot 24 of {_gui} to black stained glass pane named "&0"
set slot 25 of {_gui} to black stained glass pane named "&0"
set slot 26 of {_gui} to black stained glass pane named "&0"
open {_gui} to player

on inventory click:
if name of event-item is "&aKleine Key all!":
close player's inventory
broadcast "&c&lCalluna&f&lMT &8・ &fKleine key all!"
make console execute command "crate key all Wapens 1"
make console execute command "crate key all Fitheid 1"
make console execute command "crate key all Food 1"
make console execute command "crate key all Geld 1"
make console execute command "crate key all Kleding 1"
on inventory click:
if name of event-item is "&aMiddel Key all!":
close player's inventory
broadcast "&c&lCalluna&f&lMT &8・ &fMiddel key all!"
make console execute command "crate key all Wapens 1"
make console execute command "crate key all Fitheid 2"
make console execute command "crate key all Food 2"
make console execute command "crate key all Crimineel 1"
make console execute command "crate key all Geld 1"
make console execute command "crate key all Kleding 2"
on inventory click:
if name of event-item is "&aGrote Key all!":
close player's inventory
broadcast "&c&lCalluna&f&lMT &8・ &fGrote key all!"
make console execute command "crate key all Wapens 2"
make console execute command "crate key all Fitheid 2"
make console execute command "crate key all Food 2"
make console execute command "crate key all Crimineel 2"
make console execute command "crate key all Geld 1"
make console execute command "crate key all Rare 1"
make console execute command "crate key all Kleding 3"
 
It should work as i tested it.


Code:
command /event [<text>] [<offlineplayer>]:
    permission: op
    trigger:
        if arg 1 is not set:
            send ""
            send "&7Het &9&lBlok&f&lStad &7Event Panel is gemaakt door IlyCool"
            send ""
            send "&f&lCommands:"
            send "&7/event <command:/event keyall>&ckeyall<reset>"
            send ""
            send "&c&lHey niks als je meer wil in deze command lijst en functies laat het dan weten gwn effe berichtje sturen"
        if arg 1 is "keyall":
            wait a tick
            set {_gui} to chest inventory with 3 rows named "&8&lEvent &7| &9&lBlok&f&lStad"
            set slot 0 of {_gui} to black stained glass pane named "&0"
            set slot 1 of {_gui} to black stained glass pane named "&0"
            set slot 2 of {_gui} to black stained glass pane named "&0"
            set slot 3 of {_gui} to black stained glass pane named "&0"
            set slot 4 of {_gui} to black stained glass pane named "&0"
            set slot 5 of {_gui} to black stained glass pane named "&0"
            set slot 6 of {_gui} to black stained glass pane named "&0"
            set slot 7 of {_gui} to black stained glass pane named "&0"
            set slot 8 of {_gui} to black stained glass pane named "&0"
            set slot 9 of {_gui} to black stained glass pane named "&0"
            set slot 10 of {_gui} to lime concrete named "&aGrote Key all!"
            set slot 11 of {_gui} to black stained glass pane named "&0"
            set slot 12 of {_gui} to black stained glass pane named "&0"
            set slot 13 of {_gui} to lime concrete named "&aMiddel Key all!"
            set slot 14 of {_gui} to black stained glass pane named "&0"
            set slot 15 of {_gui} to black stained glass pane named "&0"
            set slot 16 of {_gui} to lime concrete named "&aKleine Key all!"
            set slot 17 of {_gui} to black stained glass pane named "&0"
            set slot 18 of {_gui} to black stained glass pane named "&0"
            set slot 19 of {_gui} to black stained glass pane named "&0"
            set slot 20 of {_gui} to black stained glass pane named "&0"
            set slot 21 of {_gui} to black stained glass pane named "&0"
            set slot 22 of {_gui} to red concrete named "&cSluit"
            set slot 23 of {_gui} to black stained glass pane named "&0"
            set slot 24 of {_gui} to black stained glass pane named "&0"
            set slot 25 of {_gui} to black stained glass pane named "&0"
            set slot 26 of {_gui} to black stained glass pane named "&0"
            open {_gui} to player

on inventory click:
    if name of event-inventory is "&8&lEvent &7| &9&lBlok&f&lStad":
        cancel event
        if name of event-item is "&aKleine Key all!":
            close player's inventory
            broadcast "&c&lCalluna&f&lMT &8・ &fKleine key all!"
            make console execute command "crate key all Wapens 1"
            make console execute command "crate key all Fitheid 1"
            make console execute command "crate key all Food 1"
            make console execute command "crate key all Geld 1"
            make console execute command "crate key all Kleding 1"
        if name of event-item is "&aMiddel Key all!":
            close player's inventory
            broadcast "&c&lCalluna&f&lMT &8・ &fMiddel key all!"
            make console execute command "crate key all Wapens 1"
            make console execute command "crate key all Fitheid 2"
            make console execute command "crate key all Food 2"
            make console execute command "crate key all Crimineel 1"
            make console execute command "crate key all Geld 1"
            make console execute command "crate key all Kleding 2"
        if name of event-item is "&aGrote Key all!":
            close player's inventory
            broadcast "&c&lCalluna&f&lMT &8・ &fGrote key all!"
            make console execute command "crate key all Wapens 2"
            make console execute command "crate key all Fitheid 2"
            make console execute command "crate key all Food 2"
            make console execute command "crate key all Crimineel 2"
            make console execute command "crate key all Geld 1"
            make console execute command "crate key all Rare 1"
            make console execute command "crate key all Kleding 3"
 
It should work as i tested it.


Code:
command /event [<text>] [<offlineplayer>]:
    permission: op
    trigger:
        if arg 1 is not set:
            send ""
            send "&7Het &9&lBlok&f&lStad &7Event Panel is gemaakt door IlyCool"
            send ""
            send "&f&lCommands:"
            send "&7/event <command:/event keyall>&ckeyall<reset>"
            send ""
            send "&c&lHey niks als je meer wil in deze command lijst en functies laat het dan weten gwn effe berichtje sturen"
        if arg 1 is "keyall":
            wait a tick
            set {_gui} to chest inventory with 3 rows named "&8&lEvent &7| &9&lBlok&f&lStad"
            set slot 0 of {_gui} to black stained glass pane named "&0"
            set slot 1 of {_gui} to black stained glass pane named "&0"
            set slot 2 of {_gui} to black stained glass pane named "&0"
            set slot 3 of {_gui} to black stained glass pane named "&0"
            set slot 4 of {_gui} to black stained glass pane named "&0"
            set slot 5 of {_gui} to black stained glass pane named "&0"
            set slot 6 of {_gui} to black stained glass pane named "&0"
            set slot 7 of {_gui} to black stained glass pane named "&0"
            set slot 8 of {_gui} to black stained glass pane named "&0"
            set slot 9 of {_gui} to black stained glass pane named "&0"
            set slot 10 of {_gui} to lime concrete named "&aGrote Key all!"
            set slot 11 of {_gui} to black stained glass pane named "&0"
            set slot 12 of {_gui} to black stained glass pane named "&0"
            set slot 13 of {_gui} to lime concrete named "&aMiddel Key all!"
            set slot 14 of {_gui} to black stained glass pane named "&0"
            set slot 15 of {_gui} to black stained glass pane named "&0"
            set slot 16 of {_gui} to lime concrete named "&aKleine Key all!"
            set slot 17 of {_gui} to black stained glass pane named "&0"
            set slot 18 of {_gui} to black stained glass pane named "&0"
            set slot 19 of {_gui} to black stained glass pane named "&0"
            set slot 20 of {_gui} to black stained glass pane named "&0"
            set slot 21 of {_gui} to black stained glass pane named "&0"
            set slot 22 of {_gui} to red concrete named "&cSluit"
            set slot 23 of {_gui} to black stained glass pane named "&0"
            set slot 24 of {_gui} to black stained glass pane named "&0"
            set slot 25 of {_gui} to black stained glass pane named "&0"
            set slot 26 of {_gui} to black stained glass pane named "&0"
            open {_gui} to player

on inventory click:
    if name of event-inventory is "&8&lEvent &7| &9&lBlok&f&lStad":
        cancel event
        if name of event-item is "&aKleine Key all!":
            close player's inventory
            broadcast "&c&lCalluna&f&lMT &8・ &fKleine key all!"
            make console execute command "crate key all Wapens 1"
            make console execute command "crate key all Fitheid 1"
            make console execute command "crate key all Food 1"
            make console execute command "crate key all Geld 1"
            make console execute command "crate key all Kleding 1"
        if name of event-item is "&aMiddel Key all!":
            close player's inventory
            broadcast "&c&lCalluna&f&lMT &8・ &fMiddel key all!"
            make console execute command "crate key all Wapens 1"
            make console execute command "crate key all Fitheid 2"
            make console execute command "crate key all Food 2"
            make console execute command "crate key all Crimineel 1"
            make console execute command "crate key all Geld 1"
            make console execute command "crate key all Kleding 2"
        if name of event-item is "&aGrote Key all!":
            close player's inventory
            broadcast "&c&lCalluna&f&lMT &8・ &fGrote key all!"
            make console execute command "crate key all Wapens 2"
            make console execute command "crate key all Fitheid 2"
            make console execute command "crate key all Food 2"
            make console execute command "crate key all Crimineel 2"
            make console execute command "crate key all Geld 1"
            make console execute command "crate key all Rare 1"
            make console execute command "crate key all Kleding 3"
Skquery guis suck…………
Here’s a example about how to do a regular one:
code_language.skript:
command /gui:
  trigger:
    open chest inventory with 3 rows named "&fExample GUI" to player
    wait 1 tick
    set slot 0 of player's current inventory to stone named "&7Stoney" with lore "&7Hi, My name is stoney!"

on inventory click:
  if name of event-inventory is "&fExample GUI":
    cancel event
    if name of event-item is "item":
      close player's current inventory
      send "."
This was not tested
 
Skquery guis suck…………
Here’s a example about how to do a regular one:
code_language.skript:
command /gui:
  trigger:
    open chest inventory with 3 rows named "&fExample GUI" to player
    wait 1 tick
    set slot 0 of player's current inventory to stone named "&7Stoney" with lore "&7Hi, My name is stoney!"

on inventory click:
  if name of event-inventory is "&fExample GUI":
    cancel event
    if name of event-item is "item":
      close player's current inventory
      send "."
This was not tested
I have never used SkQuery guis, nor have i seen any examples here on forums, and your "regular" gui code has error.
If you can, would you send me an example SkQuery GUI ?

Code:
command /gui:
  trigger:
    open chest inventory with 3 rows named "&fExample GUI" to player
    wait 1 tick
    set slot 0 of player's current inventory to stone named "item" with lore "&7Hi, My name is stoney!"

on inventory click:
  if name of event-inventory is "&fExample GUI":
    cancel event
    if name of event-item is "item":
      close player's inventory                                                                #you dont have to use CURRENT at this line
      send "."
 
I have never used SkQuery guis, nor have i seen any examples here on forums, and your "regular" gui code has error.
If you can, would you send me an example SkQuery GUI ?

Code:
command /gui:
  trigger:
    open chest inventory with 3 rows named "&fExample GUI" to player
    wait 1 tick
    set slot 0 of player's current inventory to stone named "item" with lore "&7Hi, My name is stoney!"

on inventory click:
  if name of event-inventory is "&fExample GUI":
    cancel event
    if name of event-item is "item":
      close player's inventory                                                                #you dont have to use CURRENT at this line
      send "."
I don’t use SkQuery and I find it a insult to human kind. The code you originally provided is skquery. And as I said, the code I gave was not tested and I’m sure it’s probably a indentation error that you can fix. If not send me the error so I can fix it
 
I don’t use SkQuery and I find it a insult to human kind. The code you originally provided is skquery. And as I said, the code I gave was not tested and I’m sure it’s probably a indentation error that you can fix. If not send me the error so I can fix it
I don't see the code being related anything to an addon SkQuery, I also don't use addons on my server nor the SkQuery so It's little impossible to assume It's SkQuery, now reason for that is If I don't have SkQuery and I tested it and It came out as 'No Error Found' then think, how would the code work If the person who tested it didn't had SkQuery installed.
 
Skquery guis suck…………
Here’s a example about how to do a regular one:
The code provided originally had nothing to do with skQuery. SkQuery GUIs work using the format inventory slot effect
The only difference between your code and the code originally provided, is that instead of setting a local var to an inventory, you don't do this, but much rather set it in the player's inventory directly. This basically just makes your code longer and more unreadable.

I have never used SkQuery guis, nor have i seen any examples here on forums, and your "regular" gui code has error.
If you can, would you send me an example SkQuery GUI ?
SkQuery GUIs as mentioned above, make use of the format inventory slot effect

It should work as i tested it.


Code:
command /event [<text>] [<offlineplayer>]:
    permission: op
    trigger:
        if arg 1 is not set:
            send ""
            send "&7Het &9&lBlok&f&lStad &7Event Panel is gemaakt door IlyCool"
            send ""
            send "&f&lCommands:"
            send "&7/event <command:/event keyall>&ckeyall<reset>"
            send ""
            send "&c&lHey niks als je meer wil in deze command lijst en functies laat het dan weten gwn effe berichtje sturen"
        if arg 1 is "keyall":
            wait a tick
            set {_gui} to chest inventory with 3 rows named "&8&lEvent &7| &9&lBlok&f&lStad"
            set slot 0 of {_gui} to black stained glass pane named "&0"
            set slot 1 of {_gui} to black stained glass pane named "&0"
            set slot 2 of {_gui} to black stained glass pane named "&0"
            set slot 3 of {_gui} to black stained glass pane named "&0"
            set slot 4 of {_gui} to black stained glass pane named "&0"
            set slot 5 of {_gui} to black stained glass pane named "&0"
            set slot 6 of {_gui} to black stained glass pane named "&0"
            set slot 7 of {_gui} to black stained glass pane named "&0"
            set slot 8 of {_gui} to black stained glass pane named "&0"
            set slot 9 of {_gui} to black stained glass pane named "&0"
            set slot 10 of {_gui} to lime concrete named "&aGrote Key all!"
            set slot 11 of {_gui} to black stained glass pane named "&0"
            set slot 12 of {_gui} to black stained glass pane named "&0"
            set slot 13 of {_gui} to lime concrete named "&aMiddel Key all!"
            set slot 14 of {_gui} to black stained glass pane named "&0"
            set slot 15 of {_gui} to black stained glass pane named "&0"
            set slot 16 of {_gui} to lime concrete named "&aKleine Key all!"
            set slot 17 of {_gui} to black stained glass pane named "&0"
            set slot 18 of {_gui} to black stained glass pane named "&0"
            set slot 19 of {_gui} to black stained glass pane named "&0"
            set slot 20 of {_gui} to black stained glass pane named "&0"
            set slot 21 of {_gui} to black stained glass pane named "&0"
            set slot 22 of {_gui} to red concrete named "&cSluit"
            set slot 23 of {_gui} to black stained glass pane named "&0"
            set slot 24 of {_gui} to black stained glass pane named "&0"
            set slot 25 of {_gui} to black stained glass pane named "&0"
            set slot 26 of {_gui} to black stained glass pane named "&0"
            open {_gui} to player

on inventory click:
    if name of event-inventory is "&8&lEvent &7| &9&lBlok&f&lStad":
        cancel event
        if name of event-item is "&aKleine Key all!":
            close player's inventory
            broadcast "&c&lCalluna&f&lMT &8・ &fKleine key all!"
            make console execute command "crate key all Wapens 1"
            make console execute command "crate key all Fitheid 1"
            make console execute command "crate key all Food 1"
            make console execute command "crate key all Geld 1"
            make console execute command "crate key all Kleding 1"
        if name of event-item is "&aMiddel Key all!":
            close player's inventory
            broadcast "&c&lCalluna&f&lMT &8・ &fMiddel key all!"
            make console execute command "crate key all Wapens 1"
            make console execute command "crate key all Fitheid 2"
            make console execute command "crate key all Food 2"
            make console execute command "crate key all Crimineel 1"
            make console execute command "crate key all Geld 1"
            make console execute command "crate key all Kleding 2"
        if name of event-item is "&aGrote Key all!":
            close player's inventory
            broadcast "&c&lCalluna&f&lMT &8・ &fGrote key all!"
            make console execute command "crate key all Wapens 2"
            make console execute command "crate key all Fitheid 2"
            make console execute command "crate key all Food 2"
            make console execute command "crate key all Crimineel 2"
            make console execute command "crate key all Geld 1"
            make console execute command "crate key all Rare 1"
            make console execute command "crate key all Kleding 3"
The code should usually work without issues, theres nothing wrong here. My suggestion tho is that you instead of setting each slot to the same item, is that you use the number expression from skript. This would shorten all the black glass item formatting down to just a single line.

Heres and example with your code:
Python:
set {_gui} to chest inventory with 3 rows named "&8&lEvent &7| &9&lBlok&f&lStad"

# Background items
set slot (integers from 0 to 26) of {_gui} to black stained glass pane named "&0"

# Clickable items overwrite the background items
set slot 10 of {_gui} to lime concrete named "&aGrote Key all!"
set slot 13 of {_gui} to lime concrete named "&aMiddel Key all!"
set slot 16 of {_gui} to lime concrete named "&aKleine Key all!"
set slot 22 of {_gui} to red concrete named "&cSluit"

# Open the GUI to the player
open {_gui} to player

If your Issue has been solved, please mark this thread as solved.
Regards
 
The code provided originally had nothing to do with skQuery. SkQuery GUIs work using the format inventory slot effect
The only difference between your code and the code originally provided, is that instead of setting a local var to an inventory, you don't do this, but much rather set it in the player's inventory directly. This basically just makes your code longer and more unreadable.


SkQuery GUIs as mentioned above, make use of the format inventory slot effect


The code should usually work without issues, theres nothing wrong here. My suggestion tho is that you instead of setting each slot to the same item, is that you use the number expression from skript. This would shorten all the black glass item formatting down to just a single line.

Heres and example with your code:
Python:
set {_gui} to chest inventory with 3 rows named "&8&lEvent &7| &9&lBlok&f&lStad"

# Background items
set slot (integers from 0 to 26) of {_gui} to black stained glass pane named "&0"

# Clickable items overwrite the background items
set slot 10 of {_gui} to lime concrete named "&aGrote Key all!"
set slot 13 of {_gui} to lime concrete named "&aMiddel Key all!"
set slot 16 of {_gui} to lime concrete named "&aKleine Key all!"
set slot 22 of {_gui} to red concrete named "&cSluit"

# Open the GUI to the player
open {_gui} to player

If your Issue has been solved, please mark this thread as solved.
Regards
I know, you can do similar thing with looping thr slots of thr inventory, it was just a minor fix and I didn't had time so I went with his code.