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.

Set/get Facing (yaw and pitch) of an entity

Discussion in 'Skript' started by PheonBest, Jun 13, 2017.

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

    PheonBest Member

    Joined:
    Jun 8, 2017
    Messages:
    31
    Likes Received:
    1
    Hi !

    I need to make these effects work:
    Code (Skript):
    1. change yaw of vehicle of player to yaw of player
    2. change pitch of vehicle of player to pitch of player
    Is there a way to do that without SkRandom or is there a version of SkRandom which works in 1.12 ?
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,172
    Likes Received:
    215
    Code (Skript):
    1.  
    2. set {_x} to x-coordinate of player
    3. set {_y} to y-coordinate of player
    4. set {_z} to z-coordinate of player
    5. set {_world} to world of player
    6. set {_yaw} to yaw of player
    7. set {_pitch} to pitch of player
    8. set {_location} to location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch}
    9. teleport vehicle of player to {_location}
    10.  
    This will however unmount the player. It is not possible to change to teleport a vehicle without unmounting the rider.
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,172
    Likes Received:
    215
    Ok thanks you anyway :emoji_slight_smile:
    --- Double Post Merged, Jun 13, 2017, Original Post Date: Jun 13, 2017 ---
    Found it ! Thanks to WolvSk :emoji_slight_smile:

    Code (Skript):
    1. on vehicle steer left:
    2.     push vehicle of player horizontally westwards at speed 0.2
    3. on vehicle steer right:
    4.     push vehicle of player horizontally eastwards at speed 0.2
    5. on vehicle steer forward:
    6.     vehicle of player is on ground
    7.     push vehicle of player horizontally forward at speed 1
    8. on vehicle steer backward:
    9.     vehicle of player is on ground
    10.     push vehicle of player horizontally backwards at speed 0.2
    This + a while which push the vehicle in the direction of the player until the vehicle is the player's vehicle.
    i've not already test it ^^
     
Thread Status:
Not open for further replies.

Share This Page

Loading...