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.

Solved Teleport to location with yaw and pitch

Discussion in 'Skript' started by Hibrocolomedio, Jun 23, 2018.

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

    Joined:
    Dec 14, 2017
    Messages:
    18
    Likes Received:
    0
    Hello!
    I am trying to figure out how to teleport an entity or a player to a location which has a yaw and a pitch set as well.

    Code (Skript):
    1.  
    2. command /spawn:
    3.    permission: spawn.spawn
    4.    permission message: &cNo permission.
    5.    trigger:
    6.        # Method 1
    7.        teleport player to location at (0, 64, 0) in world "world" with pitch 0 and yaw 0
    8.        # Method 2
    9.        set {_spawn} to location at (0, 64, 0) in world "world"
    10.        set pitch of {_spawn}'s pitch to 0
    11.        set yaw of {_spawn}'s yaw to 0
    12.        teleport player to {_spawn}
    13.  
    With Method 1 the following error is returned: "Can't understand this condition/effect: teleport player to location at (0, 64, 0) in world "world" with pitch 0 and yaw 0"

    With Method 2 no errors are returned, but when issuing the /spawn command it teleports me to the location without adjusting the yaw and pitch to 0.

    Skript Version: 2.2 by Bensku
    Minecraft Version: 1.12.2
    Have you tried searching the docs? Yes
    Have you tried searching the forums? Yes

     
  2. Best Answer:
    Post #3 by Hibrocolomedio, Jun 23, 2018
  3. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    102
    Medals:
    With the second method, try setings the yaw and pitch to 0.1 instead of 0
     
  4. Hibrocolomedio

    Joined:
    Dec 14, 2017
    Messages:
    18
    Likes Received:
    0
    0.1 does, work, but neither does 0.0 or 0 work. Looks like Skript uses 0 as null instead of the integer 0.
    --- Double Post Merged, Jun 23, 2018, Original Post Date: Jun 23, 2018 ---
    0.01 seems to do the trick. When teleporting to a location with pitch and yaw 0.01 in F3 it reports 0.0. No more OCD.

    Thank you.
     
    • Winner Winner x 1
  5. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    102
    Medals:
    I had the same problem some time ago, and didn't really know why at the time. This did fix it tho
     
    • Like Like x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...