#all player menu gui error

1 messages · Page 1 of 1 (latest)

tiny beacon
#

how do I fix this error: You cant make a GUI slot outside of a GUI creation or editing section.
my code:

    trigger:
        wait 1 tick
        create a gui with virtual chest inventory with 6 rows named "&cBan Online Players":
        wait 3 ticks
        set {_slot} to 0
        loop players in player's world:
            make gui slot {_slot} with skull of loop-player:
                name: "&2&l%loop-player%"
            add 1 to {_slot}
            if {_slot} >= 36:
                stop
        open the last gui for the player
jagged rose
#

Lines 5 to 12 need an extra indent
Also when your slot number reaches 36, your code will just stop. The code stop literally stops the rest of the code from running, so you need exit loop on your second-to-last line instead of stop, otherwise your gui will never open

tiny beacon
#

when i add the indentations you said i get alot of indentation errors whereas if i leave it i dont

#

and i changed the stop to exit loop and i get this

balmy coral
#

send your updated code

tiny beacon
#
    trigger:
        wait 1 tick
        create a gui with virtual chest inventory with 6 rows named "&cBan Online Players":
        set {_slot} to 0
        loop players in player's world:
            make gui slot {_slot} with skull of loop-player:
                name: "&2&l%loop-player%"
            add 1 to {_slot}
            if {_slot} >= 36:
                exit loop
        open the last gui for the player
balmy coral
#

u dont need that check? wont it just stop?

tiny beacon
#

what check?

balmy coral
#
                exit loop```
tiny beacon
#

thats not the source of the issue

balmy coral
#

remove skull of loop-player and put lava bucket for example

#

see if the problem is iniatiating from that

tiny beacon
#

still get the same error

balmy coral
#

is this using skript gui?

tiny beacon
#

yes

balmy coral
#

idk then

#

i know how to do this using vanilla gui

#

also while are u only checking in the player's world

#

why not all players?

tiny beacon
#

idk imma change that

#

how do i go about using vanilla gui

lapis yachtBOT
#

doorclub suggests that you read this embed @tiny beacon

GUIs
What are GUIs?

GUIs are custom inventories that you can use from all sorts of purposes including shops and server selectors. There are two main ways to create them, using normal Skript and using the addon skript-gui

Vanilla GUIs

You won't need to download any extra addons to start making vanilla GUIs! Click Here to get started

skript-gui

Before you start making GUIs with skript-gui, you will have to download the addon here
Once you are ready to begin, Click Here to get started!
This addon simplifies some of the steps of making GUIs such as listening for clicks

Tuske

Tuske is an old addon used for creating GUIs. It has become very outdated and will break all of your code. If you still have this addon installed please switch to skript-gui

balmy coral
tiny beacon
balmy coral
tiny beacon
#

the vanilla link doesnt work

balmy coral
#

websites down

tiny beacon
#

what code do i use for it

#

how do i write it

#

since its down

tiny beacon
#

how do I fix this error: You cant make a GUI slot outside of a GUI creation or editing section.
my code:

    trigger:
        wait 1 tick
        create a gui with virtual chest inventory with 6 rows named "&cBan Online Players":
        set {_slot} to 0
        loop players in player's world:
            make gui slot {_slot} with skull of loop-player:
                name: "&2&l%loop-player%"
            add 1 to {_slot}
            if {_slot} >= 36:
                exit loop
        open the last gui for the player
balmy coral
#

Just use vanilla gui

#

There is an old yt vid on it that works I believe

#

I think the problem may be the colon at the end of the line

tiny beacon
tiny beacon
jagged rose
tiny beacon
jagged rose
#

Let me guess: you used tabs instead of spaces (or vice-versa)

#

You can use one or the other creating the scripts, but each code section needs to have the same one and same style: command test: trigger: # Two spaces send "hello" # Four spaces

command test2:
    trigger: # One TAB
        send "hello" # Two TAB```
These both work, but you cannot mix tabs and spaces in the same section (in this case, the same command)
tiny beacon
#

ok

#

i made sure it was all spaces

#

and there are 9 indentation errorssaying stuff like this do i change it to 4 spaces becuase it says expected 4 spaces

tiny beacon
#
    trigger:
    wait 1 tick
        create a gui with virtual chest inventory with 6 rows named "&cBan Online Players":
            set {_slot} to 0
            loop all players:
                make gui slot {_slot} with skull of loop-player:
                    name: "&2&l%loop-player%"
                add 1 to {_slot}
                if {_slot} >= 36:
                    exit loop
        open the last gui for the player
#

this is with the indentations that you said

jagged rose
#

So, try again, you are almost there

tiny beacon
#

i did do that

tiny beacon
#

and i still get the errors

dark jackal
#
    trigger:
        wait 1 tick
        create a gui with virtual chest inventory with 6 rows named "&cBan Online Players":
            set {_slot} to 0
            loop all players:
                make gui slot {_slot} with skull of loop-player:
                    name: "&2&l%loop-player%"
                add 1 to {_slot}
                if {_slot} >= 36:
                    exit loop
        open the last gui for the player
tiny beacon
#

nothing has changed

dark jackal
#

I fixed the indentation

#

test it

tiny beacon
#

now i get this

#

i just removed that line and its working

tiny beacon
#

thanks for the assistance

tiny beacon
#

should i be using spaces or tabs

#

for indentation

balmy coral
#

whatever u like

#

i use tabs

tiny beacon
#

I want to have it so when i click on the player in that players menu it opens another gui with ban options
This is my code but im not sure if its correct becuase it doesnt open the gui

on inventory click:
    if name of player's current inventory is "&cBan Online Players":
        if clicked slot is %loop-player%:
            close players inventory
            create a gui with virtual chest inventory with 4 rows named "&cBan Options" with shape "xxxxxxxxx", "xxxxxxxxx", and "xxxxxxxxx":
            make gui slot "x" with gray stained glass pane named " "
            open the last gui for the player

It could be from this error i get but im not sure how to fix it