Solved Gui is closing when new gui get open buy command execute

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

MomoHD

Member
Nov 23, 2019
18
0
1
26
Hello, I have the problem with my Gui script that when I open the gui as a player and click on what executes a command that executes a 2ts GUI. Just the Gui is closed. when he runs the second GUI over the commnand in the chat. Open it normally.

Here the Code:

Code:
command /menu:
    permission: ulx.menu
    trigger:
        if player has permission "ulx.menu.owner":   
            open chest with 1 row named "&b&lULX Menu" to player
            wait 5 tick
            format slot 0 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 1 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 2 of player with item frame named "&bChat"
            with lore "&3Serverchat" to close then run [make player execute command "chatmenu"]
            format slot 3 of player with fishing rod named "&bFun" with lore "&3Trolling Party" to close then run [make player execute command "funmenu"]
            format slot 4 of player with compass named "&bTeleport" with lore "&3Radar - Teleporter" to close then run [make player execute command "teleportmenu"]
            format slot 5 of player with glowing diamond axe named "&bUtility" with lore "&4&lBanhammer" to close then run [make player execute command "Utilitymenu"]
            format slot 6 of player with paper named "&bVoting" with lore "&3Survey note" to close then run [make player execute command "votingmenu"]
            format slot 7 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 8 of player with glowing blue stained glass pane named "&8Line" with lore "" to close

        if player has permission "ulx.menu.default":
            open chest with 1 row named "&b&lULX Menu" to player
            wait 5 tick
            format slot 0 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 1 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 2 of player with item frame named "&bChat" with lore "&3Serverchat" to close then run [make player execute command "chatmenu"]
            format slot 3 of player with fishing rod named "&bFun" with lore "&3Trolling Party" to close then run [make player execute command "funmenu"]
            format slot 4 of player with compass named "&bTeleport" with lore "&3Radar - Teleporter" to close then run [make player execute command "teleportmenu"]
            format slot 5 of player with glowing diamond axe named "&bUtility" with lore "&4&lBanhammer" to close then run [make player execute command "Utilitymenu"]
            format slot 6 of player with paper named "&bVoting" with lore "&3Survey note" to close then run [make player execute command "votingmenu"]
            format slot 7 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 8 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            
command /chatmenu:
    permission: ulx.chatmenu
    trigger:
        if player has permission "ulx.chatmenu.owner":   
            open chest with 1 row named "&b&lULX Menu &r&3- &f&lChat" to player
            wait 5 tick
            format slot 0 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 1 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 2 of player with red dye named "&c&lback" with lore "&cGo back to the Menu" to close then run [make player execute command "menu"]
            format slot 3 of player with redstone named "&fasay" with lore "&7Send a message to currently connected admins" to close then run [make player execute command "asay"]
            format slot 4 of player with barrier named "&fpsay" with lore "&7Send a private message to target" to close then run [make player execute command "psay"]
            format slot 5 of player with clock named "&fthetime" with lore "&7Shows you the server time" to close then run [make player execute command "thetime"]
            format slot 6 of player with lime dye named "&a&lNext Page" with lore "&aOpen the Utility Page" to close then run [make player execute command "utilitymenu"]
            format slot 7 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 8 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            remove glowing blue stained glass pane named "&8Line" from the player's tool
            remove glowing blue stained glass pane named "&8Line" from the player's tool
            remove glowing blue stained glass pane named "&8Line" from the player's tool
            remove glowing blue stained glass pane named "&8Line" from the player's tool
            remove glowing blue stained glass pane named "&8Line" from the player's tool
            remove glowing blue stained glass pane named "&8Line" from the player's tool
            
            if player has permission "ulx.chatmenu.default":
            open chest with 1 row named "&b&lULX Menu &r&3- &f&lChat" to player
            wait 5 tick
            format slot 0 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 1 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 2 of player with red dye named "&c&lback" with lore "&cGo back to the Menu" to close then run [make player execute command "menu"]
            format slot 3 of player with redstone named "&fasay" with lore "&7Send a message to currently connected admins" to close then run [make player execute command "asay"]
            format slot 4 of player with barrier named "&fpsay" with lore "&7Send a private message to target" to close then run [make player execute command "psay"]
            format slot 5 of player with clock named "&fthetime" with lore "&7Shows you the server time" to close then run [make player execute command "thetime"]
            format slot 6 of player with lime dye named "&a&lNext Page" with lore "&aOpen the Utility Page" to close then run [make player execute command "utilitymenu"]
            format slot 7 of player with glowing blue stained glass pane named "&8Line" with lore "" to close
            format slot 8 of player with glowing blue stained glass pane named "&8Line" with lore "" to close

The normal player rank have all Gui Permission i added.
 
I think it's because owner have the 2 permission

Because first it's open the guy with the owner permission and because the owner have also the default permission i'ts open the gui with ulx.chatmenu.default perm

so you must check if he have the default permission and not the owner permission

Code:
        if player has permission "ulx.chatmenu.default":
            if player has not permission "ulx.chatmenu.owner":
 
I still have to test it. My computer went dead
[doublepost=1578237916,1578237201][/doublepost]But I believe you
 
Status
Not open for further replies.