GUI for Spectate Players (and TP)

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

Status
Not open for further replies.

Juan7030

Member
Mar 20, 2017
13
0
0
30
Hello good, you see I have the error that when you click on the head of the player, it does not teleport to where it should, but it teleports to a player that is not but that is within that variable, but I I want to see another person but I get the person that I did not want to see, I do not know if I explain, I hope you help me, thanks.

My Full Code:

Code:
on right click with clock:
    if name of event-item is "&9Spectate Players":
        if size of {tnttag.playing.%{tnttag.myarena.%player%}%::*} is not 0:
            set {tnttag.spectatingplayers} to 0
            if {tnttag.players.%{tnttag.myarena.%player%}%} <= 8:
                open chest with 1 row named "&f&lTNT&c&lTAG" to player
                loop {tnttag.playing.%{tnttag.myarena.%player%}%::*}:
                    set {_player.%loop-value%} to "%loop-value%" parsed as player
                    format slot {tnttag.spectatingplayers} of player with ("%loop-value%" parsed as offline player)'s skull named "&9%loop-value%" with lore "||&eClick here for Spectate!" to close then run [make player execute command "/tagtp %{_player.%loop-value%}%"]
                    add 1 to {tnttag.spectatingplayers}
            else:
                if {tnttag.players.%{tnttag.myarena.%player%}%} <= 16:
                    open chest with 2 row named "&f&lTNT&c&lTAG" to player
                    loop {tnttag.playing.%{tnttag.myarena.%player%}%::*}:
                        set {_player.%loop-value%} to "%loop-value%" parsed as player
                        format slot {tnttag.spectatingplayers} of player with ("%loop-value%" parsed as offline player)'s skull named "&9%loop-value%" with lore "||&eClick here for Spectate!" to close then run [make player execute command "/tagtp %{_player.%loop-value%}%"]
                        add 1 to {tnttag.spectatingplayers}       
                else:
                    if {tnttag.players.%{tnttag.myarena.%player%}%} <= 24:
                        open chest with 3 row named "&f&lTNT&c&lTAG" to player
                        loop {tnttag.playing.%{tnttag.myarena.%player%}%::*}:
                            set {_player.%loop-value%} to "%loop-value%" parsed as player
                            format slot {tnttag.spectatingplayers} of player with ("%loop-value%" parsed as offline player)'s skull named "&9%loop-value%" with lore "||&eClick here for Spectate!" to close then run [make player execute command "/tagtp %{_player.%loop-value%}%"]
                            add 1 to {tnttag.spectatingplayers}
                    else:
                        if {tnttag.players.%{tnttag.myarena.%player%}%} <= 32:
                            open chest with 4 row named "&f&lTNT&c&lTAG" to player
                            loop {tnttag.playing.%{tnttag.myarena.%player%}%::*}:
                                set {_player.%loop-value%} to "%loop-value%" parsed as player
                                format slot {tnttag.spectatingplayers} of player with ("%loop-value%" parsed as offline player)'s skull named "&9%loop-value%" with lore "||&eClick here for Spectate!" to close then run [make player execute command "/tagtp %{_player.%loop-value%}%"]
                                add 1 to {tnttag.spectatingplayers}
                        else:
                            send "&6&lTNT&c&lTAG&7 ERROR!"
        else:
            send "&6&lTNT&c&lTAG&7 No players for spect right now!"
               
               
command /tagtp [<text>]:
    trigger:
        if arg 1 is set:
            set {tagplayer} to arg-1 parsed as player
            teleport player to {tagplayer}
 
Status
Not open for further replies.