Solved Need help with 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!

Status
Not open for further replies.

Velinquish

Member
Jan 6, 2018
1
0
0
24
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:
options:
    sellgun: slot 11 of player with gold ingot named "&6&lSell Guns" with lore "&7Click to sell guns" to close then run "gunsell"
    ammoshop: slot 13 of player with rose red named "&4&lAmmo Shop" with lore "&7Click to buy/sell ammo" to close then run "shopammo"
    buygun: slot 15 of player with iron ingot named "&3&lBuy Guns" with lore "&7Click to buy guns" to close then run "gunbuy"
  
    back: slot 45 of player with arrow named "&a&lBack" with lore "&7Click to go back" to close then run "gunstore"

command /gunstore:
    permission: skript.gunstore
    trigger:
        wait 5 tick
        open chest with 3 rows named "&2&lGun Store" to player
        wait 2 tick
        format {@sellgun}
        format {@ammoshop}
        format {@buygun}
      
command /gunsell:
    permission: skript.gunsell
    trigger:
        wait 5 tick
        open chest with 6 rows named "&6&lSell Guns" to player
        wait 2 tick
        format {@back}

Help would be greatly appreciated!
 
Last edited:
code_language.skript:
options:
    sellgun: slot 11 of player with gold ingot named "&6&lSell Guns" with lore "&7Click to sell guns" to close then run "gunsell %player%"
    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%"
    buygun: slot 15 of player with iron ingot named "&3&lBuy Guns" with lore "&7Click to buy guns" to close then run "gunbuy %player%"
 
    back: slot 45 of player with arrow named "&a&lBack" with lore "&7Click to go back" to close then run "gunstore"
 
command /gunstore:
    permission: skript.gunstore
    trigger:
        wait 5 tick
        open chest with 3 rows named "&2&lGun Store" to player
        wait 2 tick
        format {@sellgun}
        format {@ammoshop}
        format {@buygun}
   
command /gunsell <player>:
    permission: skript.gunsell
    trigger:
        wait 5 tick
        open chest with 6 rows named "&6&lSell Guns" to arg 1
        wait 2 tick
        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%"
 
Last edited:
  • Like
Reactions: Velinquish
Status
Not open for further replies.