Solved open chest inventory

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

flummyy

Member
Mar 8, 2024
4
1
3
19
Hello, i've got a little problem with my skript. I try to open a chest inventory after i closed one but it just won't open! Can somebody help me?
I put the code under this text but i think the important part where it says "on inventory click"

Code:
command /shopgui_main:
     permission: op
     permission message: &cGehe zum Enchanter um diesen befehl auzuführen!
     trigger:
          set {_player} to player
     # Main menue--------------------------------------------------------------------------------------------
          set {_main_Enchanter} to a new chest inventory with 6 row with name "&bEnchanter"
          set slot 0 of {_main_Enchanter} to green stained glass pane named " "
          set slot 1 of {_main_Enchanter} to green stained glass pane named " "
          set slot 9 of {_main_Enchanter} to green stained glass pane named " "
          set slot 7 of {_main_Enchanter} to green stained glass pane named " "
          set slot 8 of {_main_Enchanter} to green stained glass pane named " "
          set slot 17 of {_main_Enchanter} to green stained glass pane named " "
          set slot 44 of {_main_Enchanter} to green stained glass pane named " "
          set slot 53 of {_main_Enchanter} to green stained glass pane named " "
          set slot 52 of {_main_Enchanter} to green stained glass pane named " "
          set slot 45 of {_main_Enchanter} to green stained glass pane named " "
          set slot 46 of {_main_Enchanter} to green stained glass pane named " "
          set slot 36 of {_main_Enchanter} to green stained glass pane named " "
#until here
#close button
          set slot 13 of {_main_Enchanter} to Block of Redstone named "&cSchließen"

          set slot 29 of {_main_Enchanter} to enchanted book named "&bReichweite"
          set slot 30 of {_main_Enchanter} to enchanted book named "&bGlück"
          set slot 31 of {_main_Enchanter} to enchanted book named "&bAutomatisches Sammeln"
          set slot 32 of {_main_Enchanter} to enchanted book named "&bGrüner Daumen"
          set slot 33 of {_main_Enchanter} to enchanted book named "&bBOOM""
#------------------------------------------------------------------------------------------------------------------------------
          set {_Reichweite_Enchanter} to a new chest inventory with 6 row with name "&bReichweite"
          set slot 0 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 1 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 9 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 7 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 8 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 17 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 44 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 53 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 52 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 45 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 46 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 36 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          
          
          open {_main_Enchanter} to player
          
          
on inventory click:
    if name of event-inventory is "&bEnchanter":
        cancel event
        if index of event-slot is 29:
            close player's inventory
            send "hi"
            open {_Reichweite_Enchanter} to player
 
  • Like
Reactions: HeliumBoi
I think its because you use these "_" to space out words in variables. You're supposed to use periods like "{_Reichweite.Enchanter} the underscore at the beginning makes the variable local to the skript btw.
 
  • Angry
Reactions: HeliumBoi
Hello, i've got a little problem with my skript. I try to open a chest inventory after i closed one but it just won't open! Can somebody help me?
I put the code under this text but i think the important part where it says "on inventory click"

Code:
command /shopgui_main:
     permission: op
     permission message: &cGehe zum Enchanter um diesen befehl auzuführen!
     trigger:
          set {_player} to player
     # Main menue--------------------------------------------------------------------------------------------
          set {_main_Enchanter} to a new chest inventory with 6 row with name "&bEnchanter"
          set slot 0 of {_main_Enchanter} to green stained glass pane named " "
          set slot 1 of {_main_Enchanter} to green stained glass pane named " "
          set slot 9 of {_main_Enchanter} to green stained glass pane named " "
          set slot 7 of {_main_Enchanter} to green stained glass pane named " "
          set slot 8 of {_main_Enchanter} to green stained glass pane named " "
          set slot 17 of {_main_Enchanter} to green stained glass pane named " "
          set slot 44 of {_main_Enchanter} to green stained glass pane named " "
          set slot 53 of {_main_Enchanter} to green stained glass pane named " "
          set slot 52 of {_main_Enchanter} to green stained glass pane named " "
          set slot 45 of {_main_Enchanter} to green stained glass pane named " "
          set slot 46 of {_main_Enchanter} to green stained glass pane named " "
          set slot 36 of {_main_Enchanter} to green stained glass pane named " "
#until here
#close button
          set slot 13 of {_main_Enchanter} to Block of Redstone named "&cSchließen"

          set slot 29 of {_main_Enchanter} to enchanted book named "&bReichweite"
          set slot 30 of {_main_Enchanter} to enchanted book named "&bGlück"
          set slot 31 of {_main_Enchanter} to enchanted book named "&bAutomatisches Sammeln"
          set slot 32 of {_main_Enchanter} to enchanted book named "&bGrüner Daumen"
          set slot 33 of {_main_Enchanter} to enchanted book named "&bBOOM""
#------------------------------------------------------------------------------------------------------------------------------
          set {_Reichweite_Enchanter} to a new chest inventory with 6 row with name "&bReichweite"
          set slot 0 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 1 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 9 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 7 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 8 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 17 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 44 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 53 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 52 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 45 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 46 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
          set slot 36 of {_Reichweite_Enchanter} to light blue stained glass pane named " "
     
     
          open {_main_Enchanter} to player
     
     
on inventory click:
    if name of event-inventory is "&bEnchanter":
        cancel event
        if index of event-slot is 29:
            close player's inventory
            send "hi"
            open {_Reichweite_Enchanter} to player
I think this is what you wanted to do?


Code:
command /shopgui_main:
     permission: op
     permission message: &cGehe zum Enchanter um diesen befehl auzuführen!
     trigger:
          set {_player} to player
          set {_main_Enchanter} to a new chest inventory with 6 row with name "&bEnchanter"
          set slot 0, 1, 9, 7, 8, 17, 44, 53, 52, 45, 46 and 36 of {_main_Enchanter} to green stained glass pane named "&7"

          set slot 13 of {_main_Enchanter} to Block of Redstone named "&cSchließen"

          set slot 29 of {_main_Enchanter} to enchanted book named "&bReichweite"
          set slot 30 of {_main_Enchanter} to enchanted book named "&bGlück"
          set slot 31 of {_main_Enchanter} to enchanted book named "&bAutomatisches Sammeln"
          set slot 32 of {_main_Enchanter} to enchanted book named "&bGrüner Daumen"
          set slot 33 of {_main_Enchanter} to enchanted book named "&bBOOM"
          open {_main_Enchanter} to player
      
on inventory click:
    if name of event-inventory is "&bEnchanter" or "&bReichweite":
        cancel event
        if index of event-slot is 29:
            close player's inventory
            send "hi"
            set {_Reichweite_Enchanter} to a new chest inventory with 6 row with name "&bReichweite"
            set slot 0, 1, 9, 7, 8, 17, 44, 53, 52, 45, 46 and 36 of {_Reichweite_Enchanter} to light blue stained glass pane named "&7"
            open {_Reichweite_Enchanter} to player
 
Last edited: