How to make longjump yaw same as my yaw?

@WaterFlex said in How to make longjump yaw same as my yaw?:
How to make longjump yaw same as my yaw?
Elaborate.

var playerYaw = Math.radians(mc.thePlayer.rotationYaw); mc.thePlayer.motionX = longJumpMotion * Math.sin(playerYaw); mc.thePlayer.motionZ = longJumpMotion * Math.cos(playerYaw);

@FaaatPotato thx

@WaterFlex np

@FaaatPotato it didn't work
what am i doing wrong
/// api_version=2
var script = registerScript({
name: "Longjump2",
version: "1.0.0",
authors: ["idk"]
});script.registerModule({
name: "Longjump2",
category: "Movement",
description: "idk."
}, function (module) {
module.on("enable", function() {
var playerYaw = Math.radians(mc.thePlayer.rotationYaw);
mc.thePlayer.motionX = 0.5 * Math.sin(playerYaw);
mc.thePlayer.motionZ = 0.5 * Math.cos(playerYaw);
});
}); 
@WaterFlex if someone gonna have same issue just put
Math.radians = function(degrees) {
return degrees * Math.PI / 180;
}
at start of script