- 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 eventafter checking if the inventory is "Random Teleport". That way it cancels clicking in the entire gui and not just specific slots.
#Need help with a gui
1 messages · Page 1 of 1 (latest)
^
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
But vanilla >
I agree
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.
- !format
- 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.