Help with loop all players

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

_ody77_

Member
Feb 26, 2026
3
0
1
Code:
command /glide:
    trigger:
        set {_glide_gui} to chest inventory with 1 row named "GlideGui"
        loop 9 times:
            set slot (loop-number - 1) of {_glide_gui} to gray stained glass pane named " "
        set slot 5 of {_glide_gui} to red concrete named "<red><bold>Cancel"
        set slot 3 of {_glide_gui} to lime concrete named "<lime><bold>Confirm"
        open {_glide_gui} to player

on inventory click:
    if name of event-inventory is "GlideGui":
        cancel event
        
        if clicked slot is 5:
            close player's inventory
        
        else if clicked slot is 3:
            send "glide on" to player
            close player's inventory
            set {_old::%name of player%} to chestplate of player
            set chestplate of player to elytra
            push player upwards with force 1.5
            set {_gliding::%name of player%} to 1

every 1 tick: #<- this part isnt working
    loop all players:
        if {_gliding::%name of loop-player%} = 1:
            if block under loop-player is not air:
                send "touch" to loop-player
                set chestplate of loop-player to {_old::%name of loop-player%}
                delete {_gliding::%name of loop-player%}

im trying to make a glide command and the part thats suppose to recover my old chesplate isnt working
the loop does work but i think one of the condition (or maybe both) arent correct and i have no idea how to fix it
 
can you come on discord.gg/skript?

(You are using local variable remove the _ from the variables)
 
Last edited: