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

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

PheonBest

Member
Jun 8, 2017
31
1
0
22
Hi !

I need to make these effects work:
code_language.skript:
change yaw of vehicle of player to yaw of player
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 ?
 
code_language.skript:
set {_x} to x-coordinate of player
set {_y} to y-coordinate of player
set {_z} to z-coordinate of player
set {_world} to world of player
set {_yaw} to yaw of player
set {_pitch} to pitch of player
set {_location} to location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch}
teleport vehicle of player to {_location}

This will however unmount the player. It is not possible to change to teleport a vehicle without unmounting the rider.
 
code_language.skript:
set {_x} to x-coordinate of player
set {_y} to y-coordinate of player
set {_z} to z-coordinate of player
set {_world} to world of player
set {_yaw} to yaw of player
set {_pitch} to pitch of player
set {_location} to location({_x}, {_y}, {_z}, {_world}, {_yaw}, {_pitch}
teleport vehicle of player to {_location}

This will however unmount the player. It is not possible to change to teleport a vehicle without unmounting the rider.

Ok thanks you anyway :emoji_slight_smile:
[doublepost=1497370920,1497369294][/doublepost]Found it ! Thanks to WolvSk :emoji_slight_smile:

code_language.skript:
on vehicle steer left:
    push vehicle of player horizontally westwards at speed 0.2
on vehicle steer right:
    push vehicle of player horizontally eastwards at speed 0.2
on vehicle steer forward:
    vehicle of player is on ground
    push vehicle of player horizontally forward at speed 1
on vehicle steer backward:
    vehicle of player is on ground
    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 ^^
 
Status
Not open for further replies.