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 out 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.

Solved Need help with GUI

Discussion in 'Skript' started by Velinquish, Jan 6, 2018.

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

    Velinquish Member

    Joined:
    Jan 6, 2018
    Messages:
    1
    Likes Received:
    0
    Skript Version: 2.1.2 (Apparently the latest stable version). I was also using SkQuery.
    Minecraft Version: The server is running Spigot 1.8.8. When I tested it, I was on 1.12 (I was able to join because of ViaVersion).


    I'm trying to make a GUI appear after a command and change to another GUI after clicking an item in it. I managed to make the first GUI with the item and set it so that clicking the item closes the GUI and opens the second GUI. However, when I tried it, clicking the item only closed the first GUI. I tried out my command for the second GUI to make sure it's working and it seems to work fine. I originally thought Skript couldn't close and open GUIs at the same time so I added delays but it still didn't work. There are no errors on reload. Here is my code:

    Code (Text):
    1. options:
    2.     sellgun: slot 11 of player with gold ingot named "&6&lSell Guns" with lore "&7Click to sell guns" to close then run "gunsell"
    3.     ammoshop: slot 13 of player with rose red named "&4&lAmmo Shop" with lore "&7Click to buy/sell ammo" to close then run "shopammo"
    4.     buygun: slot 15 of player with iron ingot named "&3&lBuy Guns" with lore "&7Click to buy guns" to close then run "gunbuy"
    5.  
    6.     back: slot 45 of player with arrow named "&a&lBack" with lore "&7Click to go back" to close then run "gunstore"
    7.  
    8. command /gunstore:
    9.     permission: skript.gunstore
    10.     trigger:
    11.         wait 5 tick
    12.         open chest with 3 rows named "&2&lGun Store" to player
    13.         wait 2 tick
    14.         format {@sellgun}
    15.         format {@ammoshop}
    16.         format {@buygun}
    17.      
    18. command /gunsell:
    19.     permission: skript.gunsell
    20.     trigger:
    21.         wait 5 tick
    22.         open chest with 6 rows named "&6&lSell Guns" to player
    23.         wait 2 tick
    24.         format {@back}
    Help would be greatly appreciated!

     
    #1 Velinquish, Jan 6, 2018
    Last edited: Jan 6, 2018
  2. Best Answer:
    Post #3 by JTNCrafter, Jan 7, 2018
  3. Syst3ms

    Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    191
    Likes Received:
    22
    Velinquish likes this.
  4. JTNCrafter

    JTNCrafter Member

    Joined:
    Jan 6, 2018
    Messages:
    21
    Likes Received:
    1
    Code (Skript):
    1. options:
    2.     sellgun: slot 11 of player with gold ingot named "&6&lSell Guns" with lore "&7Click to sell guns" to close then run "gunsell %player%"
    3.     ammoshop: slot 13 of player with rose red named "&4&lAmmo Shop" with lore "&7Click to buy/sell ammo" to close then run "shopammo %player%"
    4.     buygun: slot 15 of player with iron ingot named "&3&lBuy Guns" with lore "&7Click to buy guns" to close then run "gunbuy %player%"
    5.  
    6.     back: slot 45 of player with arrow named "&a&lBack" with lore "&7Click to go back" to close then run "gunstore"
    7.  
    8. command /gunstore:
    9.     permission: skript.gunstore
    10.     trigger:
    11.         wait 5 tick
    12.         open chest with 3 rows named "&2&lGun Store" to player
    13.         wait 2 tick
    14.         format {@sellgun}
    15.         format {@ammoshop}
    16.         format {@buygun}
    17.    
    18. command /gunsell <player>:
    19.     permission: skript.gunsell
    20.     trigger:
    21.         wait 5 tick
    22.         open chest with 6 rows named "&6&lSell Guns" to arg 1
    23.         wait 2 tick
    24.         format {@back}
    Instead of doing player, SkQuery acts as a execute console command, not a make player run. So in this case, I made a part where you need the player's name. If they open the gun store, it will run /gunsell <player name>! This might need a little fixing in the code, but you need to set anything for gunsel, shopammo, and buy gun to arg 1.

    For example:
    Instead of...
    sellgun: slot 11 of player with gold ingot named "&6&lSell Guns" with lore "&7Click to sell guns" to close then run "gunsell"

    It is...
    sellgun: slot 11 of player with gold ingot named "&6&lSell Guns" with lore "&7Click to sell guns" to close then run "gunsell %player%"
     
    #3 JTNCrafter, Jan 7, 2018
    Last edited: Jan 7, 2018
    Velinquish likes this.
Thread Status:
Not open for further replies.

Share This Page

Loading...