Jump to content

I need help with GUI skript


KKallas

Recommended Posts

So I am trying to do a GUI skript. I took some things from the tutorial, but I don't know how to make it  so when it closes it says Closed GUI
 

command /gui:
  aliases: /menu
  permission: gui.menu
  permission message: &7[&6Server&7] &cYou don't have permission to execute this command!
  trigger:
    broadcast "&7[&6Server&7] &7Opened GUI"
    open virtual chest with size 3 named "Menu" to player
    format gui slot 10 of player with water bucket named "&bMake it rain" to run:
      set weather to rainy
      broadcast "&7[&6Server&7] &bMAKE IT RAIN!!!!"
    format gui slot 12 of player with lava bucket named "&cMake it day" to run:
      set weather to sunny
      broadcast "&7[&6Server&7] &cMAKE IT DAY!!!!"
    format gui slot 26 of player with barrier named "&cClose" to close then run:
      broadcast "&7[&6Server&7] &7Closed GUI"

 

Link to comment
Share on other sites

You need to change the way yoyur menu is implemented,

6 hours ago, KKallas said:

open virtual chest with size 3 named "Menu" to player

You should use

create [a] [new] gui [[with id] %-string%] with %inventory% [and shape %-strings%]

inventory type is in your case: virtual chest

put a : after that and add 1 indent to all format code with format (below)

6 hours ago, KKallas said:

format gui slot 10 of player with water bucket named "&bMake it rain" to run:
    set weather to rainy broadcast "&7[&6Server&7] &bMAKE IT RAIN!!!!"
format gui slot 12 of player with lava bucket named "&cMake it day" to run:
    set weather to sunny broadcast "&7[&6Server&7] &cMAKE IT DAY!!!!"
format gui slot 26 of player with barrier named "&cClose" to close then run:
    broadcast "&7[&6Server&7] &7Closed GUI"

to open the menu, use

last[ly] [created] gui
open last gui to player

but I recommend giving a gui a id.You can: edit it before opening to the player, register the GUI in a on load event and call the menu from different events.
 

open gui %string% to player

 

Link to comment
Share on other sites

  • 5 months later...
  • 5 months later...

Please do not respond to topics that have been inactive for over a month

LOCKED

Discord - swirs#0069

In-game name - swiirs

---------------------------------------------------------

[VIP] - July 1st 2020

Support - 9/6/20 | 11/3/20

Helper  - 11/3/20 - 1/10/2021

Moderator - 1/10/2021 - 5/17/2021

Retired - 5/17/2021 - Present

Joined Minehut Mid-late 2015

---------------------------------------------------------

Link to comment
Share on other sites

  • swirs locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...