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.

Teleport player to another player's coordinates

Discussion in 'Skript' started by Blep, Dec 10, 2020.

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

    Blep New Member

    Joined:
    Jun 23, 2020
    Messages:
    9
    Likes Received:
    0
    I can't find a solution to this but I know I'm not the first person to run into this issue, so sorry if this has already been answered, but how do I teleport a player to another player's coordinates. Sounds confusing, but I'm not trying to teleport a player to another player, but rather their coordinates. Maybe you'll understand if you see my code


    Code (Text):
    1. command /spectate [<player>]:
    2.     aliases: /spec, /spectator
    3.     trigger:
    4.         if arg-1 is set:
    5.             set player's gamemode to spectator
    6.             set {_player} to "%arg-1%"
    7.             broadcast "%{_player}%"
    8.             set {_coords} to the location of {_player}
    9.             teleport player to {_coords} in world ul_Ocean
    Sorry if that was confusing. Heres the skript error
    upload_2020-12-9_20-16-26.png
     

    Attached Files:

  2. AC_AKB

    AC_AKB New Member

    Joined:
    Dec 4, 2020
    Messages:
    7
    Likes Received:
    0
    Have you tried this?

    Code (Text):
    1. command /spectate [<player>]:
    2.     aliases: /spec, /spectator
    3.     trigger:
    4.         if arg-1 is set:
    5.             set player's gamemode to spectator
    6.             set {_player} to "%arg-1%"
    7.             broadcast "%{_player}%"
    8.             teleport player to arg-1
    Just teleport the player to the other player (arg-1). Instead of coordinates.
     
  3. Purple Pixel

    Purple Pixel Member

    Joined:
    Sep 23, 2020
    Messages:
    40
    Likes Received:
    3
    If you want to know why your code was wrong, it is because you said "location of player" in stead of something like "player's location"
     
  4. Blep

    Blep New Member

    Joined:
    Jun 23, 2020
    Messages:
    9
    Likes Received:
    0
    Thanks, yea that worked. I overcomplicate things ._.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...