help skript 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 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!

elyexee

Member
Jul 16, 2023
30
0
6
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:

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
 
Something that could be a solution is changing "with {frame}" to "to {frame}" as that's how the other slots are laid out. Also a suggestion that's completely optional to make your code a little more compact would be to change the code for the frame to something like:
Code:
set slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17 and 18 to {frame}

This will remove the extra "and's" which make the line longer. You could also set a variable up to set multiple slots at the same time with something like:
Code:
set {_slots::*} to integers from 0 to 8

You could then set the slot itself to the variable which should set several slots in the GUI simultaneously. I hope this helps resolve your issue and if not; then at least give a helpful insight on how to improve your code a little!
 
it says this
1689594179444.png