Solved Spectator 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!

Status
Not open for further replies.

Uzumaki

Well-Known Member
Feb 20, 2017
310
10
18
code_language.skript:
command /spec:
    trigger:
        loop all players:
            if {spec::%loop-player%} is true:
                add 1 to {_players}
        set {_rows} to {_players}/9
        {_rows} is less than 1:
            set {_rows} to 1
        {_rows} is more than 6:
            set {_rows} to 6
        open chest with {_rows} rows named "&8&lPLAYERS ALIVE" to player
        wait 1 tick
        set {_slot} to -1
        loop all players:
            if {spec::%loop-player%} is true:
                add 1 to {_slot}
                if loop-player don't have 1 compass:
                    format slot {_slot} of player with loop-player's skull named "&e● &c&l%loop-player% &e●" with lore "||&e&l&m-----------------||||&9➤ &c&lClick to Teleport ||||&e&l&m-----------------||||" to close then run [run player command "tp %loop-player%" as op]



on join:
    set {spec::%player%} to true
on quit:
    delete {spec::%player%}



The problem is when i click on skull is teleporting to miself or wrong person
upload_2017-7-23_15-46-33.png
 
That's because of a bug with format slot and loops, you should use TuSKe's GUI Manager or set slot + inventory click in this case. There are better ways to achieve what you're doing that I might explain later.
 
Status
Not open for further replies.