[Solved] Items not showing up in GUI (skript)

Discussion in 'Spigot Plugin Help' started by Willemcross, Aug 14, 2018.

  1. Hey there,

    I'm having trouble setting up a /menu command for a Server selector.

    When a player joins they get a book in their inventory called Server Selector,

    This is the skript code i'm using. (below)


    on leftclick with book:
    make player execute command "/menu"

    on rightclick with book:
    make player execute command "/menu"


    Basically what happens is, when you left-click the book, it comes up with a GUI (chest) with 4 items.
    But when you right-click the book, it opens a GUI (chest) too, but there are no items inside it, while it uses the same command. Here are the GIF's of the right-clicking and left clicking on the book.:


    https://i.gyazo.com/3418e6a6446210e5edf466a3b0e462e8.gif (Left-click)
    https://i.gyazo.com/aa9cd9ccf4e6e3ef0a8e1d61f85bd52e.gif (Right-Click)


    The menu command exists of this code:

    command /menu:
    trigger:
    open chest with 3 rows named "&7Select a server" to player
    format slot 10 of player with 1 wooden sword named "&5&l1-Man (Solo)" to close then run [make player execute command "/join 2-man"]
    format slot 12 of player with 2 gold sword named "&5&l2-Man (Duo)" to close then run [make player execute command "/join 5-man"]
    format slot 14 of player with ender chest named "&5&lKit Map" to close then run [make player execute command "/join kitmap"]
    format slot 16 of player with bow named "&5&lPractice" to close then run [make player execute command "/join practice"]

    Please help me! Maybe I should update something?
    Here is a picture of my plugins folder if that can help:

    https://i.gyazo.com/d0ddcbbb29d0637e95a8a103dd86041a.png

    Please reply soon, thanks in advance!
    (I hope I posted this in the right section)




     
  2. Maybe another "on right click" bit of code exists from another plugin/script?
     
  3. Doesn't seem like it,
    on click:
    if player's tool is book:
    make player execute command "/menu"

    I tried this ^, still same result.
     
  4. I think that, the problem causes from:

    when, you write click with book, you also try to open the book. That's why, I think, you must cancel event first.

    Like this:

    Code (Text):
    on rightclick with book:
    cancel event
    make player execute command "/menu"
     
  5. I just tried your exact code on my test server. It seems to be working just fine either way. My guess is its a problem with your addons.
    Answer the following questions please without saying "latest"
    Which version of Mc are you using? (also, spigot/bukkit/paper?)
    Which version/author of skript are you using?
    Which version of SkQuery are you using?
    If you are unsure of the answer to any of these, use the version command... IE: /ver Skript, /ver skquery
     
  6. Fixed it, i'm not sure what the issue was exactly, basically what I did was add:

    wait 1 tick

    Which makes the command look like this:

    command /menu:
    trigger:
    open chest with 3 rows named "&7Select a server" to player
    wait 1 tick
    format slot 10 of player with 1 wooden sword named "&5&l1-Man (Solo)" to close then run [make player execute command "/join 1-man"]
    format slot 12 of player with 2 gold sword named "&5&l2-Man (Duo)" to close then run [make player execute command "/join 2-man"]
    format slot 14 of player with ender chest named "&5&lKit Map" to close then run [make player execute command "/join kitmap"]
    format slot 16 of player with bow named "&5&lPractice" to close then run [make player execute command "/join practice"]


    Anyways,
    The skript version I have is 2.2-Mineplex-Core-Patch and my SkQuery version is 3.21.4
    Am I behind on updates?

    Thanks though.
     
  7. OH RIGHT I totally forgot SkQuery has that problem with GUIs. I think that is one of the reasons everyone recommends to not use it.
     
    • Like Like x 1
  8. You could just ditch the entire thing and use BossShop it makes good Gui menus for anything
     
  9. It's more fun to do it by myself.
     
    • Like Like x 1
    • Agree Agree x 1