Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Math.radians = function(degrees) {
- return degrees * Math.PI / 180;
- };
- function setMoveSpeed(movespeed) {
- if (mc.thePlayer.movementInput.moveStrafe == 0 && mc.thePlayer.movementInput.moveForward != 0) {
- mc.thePlayer.motionX = parseFloat(mc.thePlayer.movementInput.moveForward * movespeed * Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)) )
- mc.thePlayer.motionZ = parseFloat(mc.thePlayer.movementInput.moveForward * movespeed * Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)) )
- } else if (mc.thePlayer.movementInput.moveStrafe != 0 && mc.thePlayer.movementInput.moveForward != 0){
- mc.thePlayer.motionX = parseFloat((mc.thePlayer.movementInput.moveForward / 1.4142135623730950488016887242097) * movespeed * Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)) + (mc.thePlayer.movementInput.moveStrafe / 1.4142135623730950488016887242097) * movespeed * Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)))
- mc.thePlayer.motionZ = parseFloat((mc.thePlayer.movementInput.moveForward / 1.4142135623730950488016887242097) * movespeed * Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)) - (mc.thePlayer.movementInput.moveStrafe / 1.4142135623730950488016887242097) * movespeed * Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)))
- } else if (mc.thePlayer.movementInput.moveStrafe != 0 && mc.thePlayer.movementInput.moveForward == 0){
- mc.thePlayer.motionX = parseFloat((mc.thePlayer.movementInput.moveForward / 1) * movespeed * Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)) + (mc.thePlayer.movementInput.moveStrafe / 1) * movespeed * Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)))
- mc.thePlayer.motionZ = parseFloat((mc.thePlayer.movementInput.moveForward / 1) * movespeed * Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)) -(mc.thePlayer.movementInput.moveStrafe / 1) * movespeed * Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment