1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Chest gui loop

Discussion in 'Skript' started by Fridious, Jun 30, 2017.

Thread Status:
Not open for further replies.
  1. Fridious

    Fridious Active Member

    Joined:
    Jun 23, 2017
    Messages:
    33
    Likes Received:
    0
    Code (Skript):
    1.  
    2. command /hatstest:
    3.     trigger:
    4.         open chest with 6 rows named "&fTest" to player
    5.         wait 3 ticks
    6.         loop integers between 0 and inventory size of chest named "&fTest" - 1:
    7.             set slot loop-number of chest named "&fTest" to light green stained glass pane named " "
    8.  
    What is wrong?
    I want to set the light green stained glass pane on the first empty slot?

    Can anyone help me?

    Thank you :emoji_slight_smile:
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,106
    Likes Received:
    150
    Based off your code, you are trying to fill an empty chest menu GUI with light green stained glass pane. While your logic is pretty alright, your syntax is all over the place.

    Here's basically the same code with syntax I found in the docs:

    Code (Skript):
    1. command /hatstest:
    2.     trigger:
    3.         open chest with 6 rows named "&fTest" to player
    4.         wait 3 ticks
    5.         loop integers between 0 and menu size of player's current inventory - 1:
    6.             set slot loop-number of player's current inventory to light green stained glass pane named " "
    The skUnity docs is a great resource for errors like these: when you believe your logic is right, but you're getting an error anyways. Most of the time it can just be the case of having to reword a few things.
     
Thread Status:
Not open for further replies.
Loading...