Skript help with gui

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

elyexee

Member
Jul 16, 2023
30
0
6
36
so i made a gui to teleport players close and etc but i cant put the gray stained glass pane in the slots this is the code and dont change the setcratespawn:

command /setcratesspawn:
trigger:
set {_pitch} to player's pitch
set {_yaw} to player's yaw
set {cratesteleport} to location at player
set {cratesteleport}'s pitch to {_pitch}
set {cratesteleport}'s yaw to {_yaw}
send "&4&lSpawn has been set to %{cratesteleport}% to player"

variables:
{frame} = gray stained glass pane

command /menu:
trigger:
set metadata tag "gui" of player to chest inventory with 3 rows named "&4&lMenu"
set slot 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 17 and 18 and 19 and 20 and 21 and 23 and 24 and 25 and 26 and 27 of player with {frame} named "&6"
set slot 11 of metadata tag "gui" of player to Shulker Box named "&2&lCrates" with lore "&4&lClick on me to teleport to the &2&lCrates"
set slot 22 of metadata tag "gui" of player to barrier named "&4&lClose"
open (metadata tag "gui" of player) to player
on inventory click:
if event-inventory = (metadata tag "gui" of player):
cancel event
if index of event-slot is 11:
teleport player to {cratesteleport}
on inventory click:
if event-inventory = (metadata tag "gui" of player):
cancel event
if index of event-slot is 22:
close inventory
 

Attachments

  • command setcratesspawn.txt
    1.2 KB · Views: 45
ok here it is
Code:
command /setcratesspawn:
trigger:
set {_pitch} to player's pitch
set {_yaw} to player's yaw
set {cratesteleport} to location at player
set {cratesteleport}'s pitch to {_pitch}
set {cratesteleport}'s yaw to {_yaw}
send "&4&lSpawn has been set to %{cratesteleport}% to player"

variables:
{frame} = gray stained glass pane

command /menu:
trigger:
set metadata tag "gui" of player to chest inventory with 3 rows named "&4&lMenu"
set slot 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 17 and 18 and 19 and 20 and 21 and 23 and 24 and 25 and 26 and 27 of player with {frame} named "&6"
set slot 11 of metadata tag "gui" of player to Shulker Box named "&2&lCrates" with lore "&4&lClick on me to teleport to the &2&lCrates"
set slot 22 of metadata tag "gui" of player to barrier named "&4&lClose"
open (metadata tag "gui" of player) to player
on inventory click:
if event-inventory = (metadata tag "gui" of player):
cancel event
if index of event-slot is 11:
teleport player to {cratesteleport}
on inventory click:
if event-inventory = (metadata tag "gui" of player):
cancel event
if index of event-slot is 22:
close inventory
 
code_language.skript:
command /setcratesspawn:
    trigger:
        set {cratesteleport} to location of player
        send "&4&lSpawn has been set to %{cratesteleport}% to player"

on load:
    set {-frame} to gray stained glass pane named "&a"

command /menu [<string>]:
    trigger:
        set (metadata tag "gui" of player) to chest inventory with 3 rows named "&4&lMenu"
        set slot (integers from 0 to 9) and (integers from 17 to 21) and (integers from 23 to 27) of (metadata tag "gui" of player) to {-frame}
        set slot 11 of (metadata tag "gui" of player) to shulker box named "&2&lCrates" with lore "&4&lClick on me to teleport to the &2&lCrates"
        set slot 22 of (metadata tag "gui" of player) to barrier named "&4&lClose"
        open (metadata tag "gui" of player) to player


on inventory click:
    event-inventory = (metadata tag "gui" of player)
    cancel event
    if index of event-slot is 11:
        teleport player to {cratesteleport} 
    else if index of event-slot is 22:
        close player's inventory
Use this, you don't have to set each coords of the crateteleport variable, you can just use a type.location
 
i did it it worked fine but im trying to do teleport gui and added a new slot with a player head and did the "else if index" but it shows more errors can u help me?

Code:
command /setcratesspawn:
    trigger:
        set {cratesteleport} to location of player
        send "&4&lSpawn has been set to %{cratesteleport}% to player"
        
command /setafkspawn:
    trigger:
        set {afkteleport} to location of player
        send "&4&lSpawn has been set to %{cratesteleport}% to player"


on load:
    set {-frame} to gray stained glass pane named "&a"


command /menu [<string>]:
    trigger:
        set (metadata tag "gui" of player) to chest inventory with 3 rows named "&4&lMenu"
        set slot (integers from 0 to 9) and (integers from 17 to 21) and (integers from 23 to 27) of (metadata tag "gui" of player) to {-frame}
        set slot 11 of (metadata tag "gui" of player) to shulker box named "&2&lCrates" with lore "&4&lClick on me to teleport to the &2&lCrates"
        set slot 13 of (metadata tag "gui" of player) to skull named "&4&lAFK Pool" with lore "&4&lClick on me to teleport to the &4&lAfk Pool"
        set slot 22 of (metadata tag "gui" of player) to barrier named "&4&lClose"
        open (metadata tag "gui" of player) to player




on inventory click:
    event-inventory = (metadata tag "gui" of player)
    cancel event
    if index of event-slot is 11:
        teleport player to {cratesteleport}
    else if index of event-slot is 13:
        teleport player to {afkteleport}
    else if index of event-slot is 22:
        close player's inventory
 
it shows this now
1689607194376.png
 
For the first error use "skull of player" as item.
For the other two you just need to select the space before the code and make sure it's either all spaces or tabs
 
thx but i think ima just delete it i think that its better not to put a gui because i found the warps thingy and it can help so srry for being annoying and u losing time but if u wanna talk in vc im always on i really need to talk with u slushtie because of errors and see if u can help me in skript
 
Most of your errors will probably be fixed if you correct your indentation. If you don’t know how you can just lookup indentation in programming on google and you will know what I mean. You can still add me on discord: sluhtie