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.

GUI not "exiting"

Discussion in 'Skript' started by nKn0wn, Mar 8, 2022.

Tags:
Thread Status:
Not open for further replies.
  1. nKn0wn

    nKn0wn Member

    Joined:
    Jan 9, 2022
    Messages:
    2
    Likes Received:
    0
    I'm using vanilla skript, latest version apparently (idk how to check). When I make a gui it works and all, but when I exit using ESC, it kinda stays in the gui menu. I click anywhere in my inventory and it just instantly throws me in the gui. I cant click or whatnot, idk how to fix.

    Heres the code: its just a weird money generator I was testing around with.

    variables:
    {balance::%player%} = 0

    command /money:
    trigger:
    set metadata tag "Money" of player to chest inventory with 3 rows named "&8&lMoney Generator"
    set slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 of metadata tag "Money" of player to black stained glass pane named "&0"
    set slot 10 of metadata tag "Money" of player to green concrete powder named "&2&l+1"
    set slot 11 of metadata tag "Money" of player to green concrete named "&2&l+5"
    set slot 15 of metadata tag "Money" of player to red concrete powder named "&4&l-1"
    set slot 16 of metadata tag "Money" of player to red concrete named "&4&l-5"
    set slot 13 of metadata tag "Money" of player to player's skull named "&6&l%{balance::%player%}% Coins" with lore "&8This is your current balance."
    open (metadata tag "Money" of player) to player

    on inventory click:
    if event-inventory = (metadata tag "Money" of player):
    cancel event
    if index of event-slot is 10:
    add 1 to {balance::%player%}
    set metadata tag "Money" of player to chest inventory with 3 rows named "&8&lMoney Generator"
    set slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 of metadata tag "Money" of player to black stained glass pane named "&0"
    set slot 10 of metadata tag "Money" of player to green concrete powder named "&2&l+1"
    set slot 11 of metadata tag "Money" of player to green concrete named "&2&l+5"
    set slot 15 of metadata tag "Money" of player to red concrete powder named "&4&l-1"
    set slot 16 of metadata tag "Money" of player to red concrete named "&4&l-5"
    set slot 13 of metadata tag "Money" of player to player's skull named "&6&l%{balance::%player%}% Coins" with lore "&8This is your current balance."
    open (metadata tag "Money" of player) to player
    on inventory click:
    if event-inventory = (metadata tag "Money" of player):
    cancel event
    if index of event-slot is 11:
    add 5 to {balance::%player%}
    set metadata tag "Money" of player to chest inventory with 3 rows named "&8&lMoney Generator"
    set slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 of metadata tag "Money" of player to black stained glass pane named "&0"
    set slot 10 of metadata tag "Money" of player to green concrete powder named "&2&l+1"
    set slot 11 of metadata tag "Money" of player to green concrete named "&2&l+5"
    set slot 15 of metadata tag "Money" of player to red concrete powder named "&4&l-1"
    set slot 16 of metadata tag "Money" of player to red concrete named "&4&l-5"
    set slot 13 of metadata tag "Money" of player to player's skull named "&6&l%{balance::%player%}% Coins" with lore "&8This is your current balance."
    open (metadata tag "Money" of player) to player


    on inventory click:
    if event-inventory = (metadata tag "Money" of player):
    cancel event
    if index of event-slot is 15:
    remove 1 from {balance::%player%}
    set metadata tag "Money" of player to chest inventory with 3 rows named "&8&lMoney Generator"
    set slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 of metadata tag "Money" of player to black stained glass pane named "&0"
    set slot 10 of metadata tag "Money" of player to green concrete powder named "&2&l+1"
    set slot 11 of metadata tag "Money" of player to green concrete named "&2&l+5"
    set slot 15 of metadata tag "Money" of player to red concrete powder named "&4&l-1"
    set slot 16 of metadata tag "Money" of player to red concrete named "&4&l-5"
    set slot 13 of metadata tag "Money" of player to player's skull named "&6&l%{balance::%player%}% Coins" with lore "&8This is your current balance."
    open (metadata tag "Money" of player) to player
    on inventory click:
    if event-inventory = (metadata tag "Money" of player):
    cancel event
    if index of event-slot is 16:
    remove 5 from {balance::%player%}
    set metadata tag "Money" of player to chest inventory with 3 rows named "&8&lMoney Generator"
    set slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 of metadata tag "Money" of player to black stained glass pane named "&0"
    set slot 10 of metadata tag "Money" of player to green concrete powder named "&2&l+1"
    set slot 11 of metadata tag "Money" of player to green concrete named "&2&l+5"
    set slot 15 of metadata tag "Money" of player to red concrete powder named "&4&l-1"
    set slot 16 of metadata tag "Money" of player to red concrete named "&4&l-5"
    set slot 13 of metadata tag "Money" of player to player's skull named "&6&l%{balance::%player%}% Coins" with lore "&8This is your current balance."
    open (metadata tag "Money" of player) to player
     
    #1 nKn0wn, Mar 8, 2022
    Last edited: Mar 8, 2022
  2. MrNygus

    MrNygus Active Member

    Joined:
    Jan 28, 2017
    Messages:
    115
    Likes Received:
    2
    Please use pastebin or [.code] code [./code] without dot
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...