1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

GUI for Spectate Players (and TP)

Discussion in 'Skript' started by Juan7030, Jan 5, 2019.

Thread Status:
Not open for further replies.
  1. Juan7030

    Juan7030 Member

    Joined:
    Mar 20, 2017
    Messages:
    13
    Likes Received:
    0
    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 (Text):
    1.  
    2. on right click with clock:
    3.     if name of event-item is "&9Spectate Players":
    4.         if size of {tnttag.playing.%{tnttag.myarena.%player%}%::*} is not 0:
    5.             set {tnttag.spectatingplayers} to 0
    6.             if {tnttag.players.%{tnttag.myarena.%player%}%} <= 8:
    7.                 open chest with 1 row named "&f&lTNT&c&lTAG" to player
    8.                 loop {tnttag.playing.%{tnttag.myarena.%player%}%::*}:
    9.                     set {_player.%loop-value%} to "%loop-value%" parsed as player
    10.                     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%}%"]
    11.                     add 1 to {tnttag.spectatingplayers}
    12.             else:
    13.                 if {tnttag.players.%{tnttag.myarena.%player%}%} <= 16:
    14.                     open chest with 2 row named "&f&lTNT&c&lTAG" to player
    15.                     loop {tnttag.playing.%{tnttag.myarena.%player%}%::*}:
    16.                         set {_player.%loop-value%} to "%loop-value%" parsed as player
    17.                         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%}%"]
    18.                         add 1 to {tnttag.spectatingplayers}      
    19.                 else:
    20.                     if {tnttag.players.%{tnttag.myarena.%player%}%} <= 24:
    21.                         open chest with 3 row named "&f&lTNT&c&lTAG" to player
    22.                         loop {tnttag.playing.%{tnttag.myarena.%player%}%::*}:
    23.                             set {_player.%loop-value%} to "%loop-value%" parsed as player
    24.                             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%}%"]
    25.                             add 1 to {tnttag.spectatingplayers}
    26.                     else:
    27.                         if {tnttag.players.%{tnttag.myarena.%player%}%} <= 32:
    28.                             open chest with 4 row named "&f&lTNT&c&lTAG" to player
    29.                             loop {tnttag.playing.%{tnttag.myarena.%player%}%::*}:
    30.                                 set {_player.%loop-value%} to "%loop-value%" parsed as player
    31.                                 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%}%"]
    32.                                 add 1 to {tnttag.spectatingplayers}
    33.                         else:
    34.                             send "&6&lTNT&c&lTAG&7 ERROR!"
    35.         else:
    36.             send "&6&lTNT&c&lTAG&7 No players for spect right now!"
    37.                
    38.                
    39. command /tagtp [<text>]:
    40.     trigger:
    41.         if arg 1 is set:
    42.             set {tagplayer} to arg-1 parsed as player
    43.             teleport player to {tagplayer}
    44.  
    45.  
    46.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...