CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How to use LiquidBounce's rotations utils in a script?

    ScriptAPI
    2
    3
    348
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • yorik100
      yorik100 last edited by

      Please tell me, thank you!

      1 Reply Last reply Reply Quote 0
      • CzechHek
        CzechHek last edited by CzechHek

        I don't know what isn't clear to you.

        Here is an example:

                if (e.getEventState() == "PRE") {
                    entity = getNearestTarget(EntityZombie);
                    diffX = entity.posX - mc.thePlayer.posX;
                    diffY = entity.posY - mc.thePlayer.posY;
                    diffZ = entity.posZ - mc.thePlayer.posZ;
        
                    rotation = new Rotation((Math.atan2(diffZ, diffX) * 180 / Math.PI) - 90, -(Math.atan2(diffY, Math.sqrt(diffX * diffX + diffZ * diffZ)) * 180 / Math.PI));
        
                    limitedRotation = RotationUtils.limitAngleChange(RotationUtils.serverRotation, rotation, 20);
        
                    RotationUtils.setTargetRotation(limitedRotation);
                    //limitedRotation.toPlayer(mc.thePlayer);
                }
        
        yorik100 1 Reply Last reply Reply Quote 0
        • yorik100
          yorik100 @CzechHek last edited by

          @CzechHek said in How to use LiquidBounce's rotations utils in a script?:

          I don't know what isn't clear to you.

          Here is an example:

                  if (e.getEventState() == "PRE") {
                      entity = getNearestTarget(EntityZombie);
                      diffX = entity.posX - mc.thePlayer.posX;
                      diffY = entity.posY - mc.thePlayer.posY;
                      diffZ = entity.posZ - mc.thePlayer.posZ;
          
                      rotation = new Rotation((Math.atan2(diffZ, diffX) * 180 / Math.PI) - 90, -(Math.atan2(diffY, Math.sqrt(diffX * diffX + diffZ * diffZ)) * 180 / Math.PI));
          
                      limitedRotation = RotationUtils.limitAngleChange(RotationUtils.serverRotation, rotation, 20);
          
                      RotationUtils.setTargetRotation(limitedRotation);
                      //limitedRotation.toPlayer(mc.thePlayer);
                  }
          

          If I understood properly, it should rotate at the closest zombie with a rotation speed of 20 max

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          About
          • Terms of Service
          • Privacy Policy
          • Status
          • Contact Us
          Downloads
          • Releases
          • Source code
          • License
          Docs
          • Tutorials
          • CustomHUD
          • AutoSettings
          • ScriptAPI
          Community
          • Forum
          • Guilded
          • YouTube
          • Twitter
          • D.Tube