GUI script

  • 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 community!

    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!

xWires

Member
Aug 15, 2023
41
4
8
I made this script (SkEditor+ generated the GUI part) but when I run /ranks nothing happens, can someone please explain to me what I did wrong here?

Code:
command /ranks:
    permission: wirednetwork.ranks
    permission message: No permission.
    executable by: player
    trigger:
        set {_gui} to chest inventory with 1 rows named "&6&lWired&r&3Gens &rRanks"

        set slot (numbers between 0 and 9) of {_gui} to gray stained glass pane
        set slot 0 of {_gui} to coal named "&rCoal Rank ($10000)"
        open {_gui} to {_p}

on inventory click:
    name of event-inventory is "&6&lWired&r&3Gens &rRanks"
    cancel event
    event-inventory is not player's inventory
    if clicked slot is 0:
        if player's balance >= 10000:
            remove 10000 from player's balance
            execute console command "/lp user %player% parent set coal"
        else:
            send "&cYou don't have enough money!"
 
I made this script (SkEditor+ generated the GUI part) but when I run /ranks nothing happens, can someone please explain to me what I did wrong here?

Code:
command /ranks:
    permission: wirednetwork.ranks
    permission message: No permission.
    executable by: player
    trigger:
        set {_gui} to chest inventory with 1 rows named "&6&lWired&r&3Gens &rRanks"

        set slot (numbers between 0 and 9) of {_gui} to gray stained glass pane
        set slot 0 of {_gui} to coal named "&rCoal Rank ($10000)"
        open {_gui} to {_p}

on inventory click:
    name of event-inventory is "&6&lWired&r&3Gens &rRanks"
    cancel event
    event-inventory is not player's inventory
    if clicked slot is 0:
        if player's balance >= 10000:
            remove 10000 from player's balance
            execute console command "/lp user %player% parent set coal"
        else:
            send "&cYou don't have enough money!"
I don’t see any {_p} here bud
 
  • Like
Reactions: Luke_Sky_Walker
- Don't use AI to generate code. It almost never works. Just learn how to write the code yourself from tutorials or documentation.
- You're opening the GUI to {_p}, which does not exist since you haven't set it to anything.
- (numbers between 0 and 9) include decimal places. Use integers instead.
 
  • Like
Reactions: xWires
- Don't use AI to generate code. It almost never works. Just learn how to write the code yourself from tutorials or documentation.
- You're opening the GUI to {_p}, which does not exist since you haven't set it to anything.
- (numbers between 0 and 9) include decimal places. Use integers instead.

It isn't an AI. It's a generator that creates 100% working codes, because you only put items, info about GUI etc.

The numbers thing is pretty interesting, and I can't find if it's true. If yes, I'll fix it.

// On skUnity's Discord server, I was informed that numbers works fine, although integers would be more readable.
 
Last edited:
  • Like
Reactions: xWires
- Don't use AI to generate code. It almost never works. Just learn how to write the code yourself from tutorials or documentation.
- You're opening the GUI to {_p}, which does not exist since you haven't set it to anything.
- (numbers between 0 and 9) include decimal places. Use integers instead.
Thank you! I just needed to change {_p} to player. Leaving the numbers how they are works fine though.
 
  • Like
Reactions: eyzk