Advertisement
Shoghi-Gaming

FastClimb

Apr 22nd, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var scriptName = "Demo Script"; // The name of your script
  2. var scriptVersion = 1.0; // The version of your script
  3. var scriptAuthor = "CCBlueX"; // The author of your script (eg. your username)
  4.  
  5. var exampleModule = new ExampleModule();
  6. var exampleModuleClient;
  7.  
  8. var Strafe = moduleManager.getModule("Strafe")
  9.  
  10. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  11.  // Converts from degrees to radians.
  12.  Math.radians = function(degrees) {
  13.     return degrees * Math.PI / 180;
  14.   };
  15.  
  16.   // Converts from radians to degrees.
  17.   Math.degrees = function(radians) {
  18.     return radians * 180 / Math.PI;
  19.   };
  20. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  21.  
  22. function vClip(offset) {
  23.     mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + offset, mc.thePlayer.posZ);
  24. }
  25.  
  26. function hClip(offset) {
  27.     var playerYaw = Math.radians(mc.thePlayer.rotationYaw);
  28.     mc.thePlayer.setPosition(mc.thePlayer.posX - (Math.sin(playerYaw) * offset), mc.thePlayer.posY, mc.thePlayer.posZ + (Math.cos(playerYaw) * offset));
  29. }
  30. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  31.  
  32. function hMotion(offset) {
  33.         mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)) * offset * Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)))
  34.         mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)) * offset * Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)))
  35. }
  36.  
  37. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  38.  
  39. function setMoveSpeed(movespeed) {
  40.     if (mc.thePlayer.movementInput.moveStrafe == 0 && mc.thePlayer.movementInput.moveForward != 0) {
  41.         mc.thePlayer.motionX = parseFloat(mc.thePlayer.movementInput.moveForward * movespeed * Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)) )
  42.         mc.thePlayer.motionZ = parseFloat(mc.thePlayer.movementInput.moveForward * movespeed * Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)) )
  43.     } else if (mc.thePlayer.movementInput.moveStrafe != 0 && mc.thePlayer.movementInput.moveForward != 0){
  44.         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)))
  45.         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)))
  46.     } else if (mc.thePlayer.movementInput.moveStrafe != 0 && mc.thePlayer.movementInput.moveForward == 0){
  47.         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)))
  48.         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)))
  49.     }
  50. }
  51. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  52.  
  53. function playerMoveSpeed(movespeed) {
  54.     if (mc.thePlayer.movementInput.moveStrafe == 0 && mc.thePlayer.movementInput.moveForward != 0) {
  55.         mc.thePlayer.motionX = parseFloat(mc.thePlayer.movementInput.moveForward * movespeed * Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)) )
  56.         mc.thePlayer.motionZ = parseFloat(mc.thePlayer.movementInput.moveForward * movespeed * Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)) )
  57.     } else if (mc.thePlayer.movementInput.moveStrafe != 0 && mc.thePlayer.movementInput.moveForward != 0){
  58.         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)))
  59.         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)))
  60.     } else if (mc.thePlayer.movementInput.moveStrafe != 0 && mc.thePlayer.movementInput.moveForward == 0){
  61.         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)))*/
  62.         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))))*/
  63.     }
  64. }
  65. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  66.  
  67.  
  68. function ExampleModule() {
  69.     var ladder = false;
  70.     this.getName = function() {
  71.         return "TestModule";
  72.     };
  73.  
  74.     this.getDescription = function() {
  75.         return "This module has been created using LiquidBounce's scripting API.";
  76.     };
  77.  
  78.     this.getCategory = function() {
  79.         return "Misc";
  80.     };
  81.  
  82.     this.onUpdate = function() {
  83.             if (mc.thePlayer.isOnLadder() && mc.thePlayer.isCollidedHorizontally && !mc.thePlayer.isSneaking()) {
  84.                 if (mc.thePlayer.ticksExisted % 15 == 0) {
  85.                   mc.thePlayer.motionY = -1;
  86.                 }else{
  87.               mc.thePlayer.motionY = 0.3;
  88.             }
  89.             }
  90.     }
  91. }
  92.  
  93. function onLoad() {
  94.     // Currently this event has to be in every script even if it is not directly needed.
  95. };
  96.  
  97. function onEnable() {
  98.     exampleModuleClient = moduleManager.registerModule(exampleModule);
  99. };
  100.  
  101. function onDisable() {
  102.     moduleManager.unregisterModule(exampleModuleClient);
  103. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement