#Need help with a gui

1 messages · Page 1 of 1 (latest)

still barn
#
  • Instead of using multiple "on inventory click:" events, you can use one and then use else if statements for each item.
  • I recommend checking the name of the gui item (ex: if item's name contains "Nether":) instead of the index number. That way you can change the gui slot without worrying about updating the index number.
  • In the on inventory click event, I recommend adding cancel event after checking if the inventory is "Random Teleport". That way it cancels clicking in the entire gui and not just specific slots.
covert jacinth
#

^

#

And use code blocks

#

Also you have an indentation error under if index = 11

lusty wren
#

Idk why people choose skript gui Iver vanilla guis

#

Just a general statement

covert jacinth
#

De about it

#

Dw

#

Dw about it, they both work and if you are new theres better things to focus on

#

If you want you could find a tutorial on the internet

lusty wren
#

But vanilla >

covert jacinth
#

I agree

still barn
#

yeah skripts can be in the same file

#

the reason you separate skripts into different files is so that you dont have files with thousands of lines that take a long time to reload. but you could put all the skripts into one file if you wanted.

foggy hollow
#
  1. !format
  2. indent
command /gui:
    trigger:
        set {_gui} to a new chest inventory with 3 row with name "Random Teleport"
        set slot 11 of {_gui} to grass block named "&aOverworld"
        set slot 13 of {_gui} to netherrack named "&cNether"
        set slot 15 of {_gui} to end stone named "&eEnd"
        open {_gui} to player
 
on inventory click:
    if name of event-inventory is "Random Teleport":
        if index of event-slot = 11:
            cancel event
            send "Successfully Rtped !"
            set player's gamemode to creative

on inventory click:
    if name of event-inventory is "Random Teleport":
        if index of event-slot = 13:
            cancel event
            send "Successfully Rtped !"
            set player's gamemode to creative
``` For the netherrack i dont actually know? spelt wrong mabyeidk.