CCBlueX Forum

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

    How to code script autowalk with sprint

    Scripts
    5
    8
    130
    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.
    • Никитыч Китыч
      Никитыч Китыч last edited by

      pls help

      Plumer Man kawaiinekololis 2 Replies Last reply Reply Quote 0
      • Plumer Man
        Plumer Man @Никитыч Китыч last edited by

        mc.thePlayer.setSprinting(true);
        mc.gameSettings.keyBindForward = true;

        Никитыч Китыч FaaatPotato 2 Replies Last reply Reply Quote 0
        • Никитыч Китыч
          Никитыч Китыч @Plumer Man last edited by

          @Plumer-Man not work

          1 Reply Last reply Reply Quote 0
          • FaaatPotato
            FaaatPotato @Plumer Man last edited by

            mc.gameSettings.keyBindForward.pressed = true

            Plumer Man 1 Reply Last reply Reply Quote 0
            • Plumer Man
              Plumer Man @FaaatPotato last edited by

              @FaaatPotato with sprint remember

              pepeshki 1 Reply Last reply Reply Quote 1
              • pepeshki
                pepeshki @Plumer Man last edited by

                @Plumer-Man .t sprint

                Никитыч Китыч 1 Reply Last reply Reply Quote 0
                • kawaiinekololis
                  kawaiinekololis Admin @Никитыч Китыч last edited by kawaiinekololis

                  ChatGPT knows how to use ScriptAPI v2 better than most of the people here.

                  2378f9bf-656f-4eda-a126-26b60e9aaf3e-grafik.png

                  /// api_version=2
                  var script = registerScript({
                      name: "AutoWalk",
                      version: "1.0.0",
                      authors: ["Your Name"]
                  });
                  
                  script.registerModule({
                      name: "AutoWalk2",
                      category: "Movement",
                      description: "Makes the player move forward continuously and sprint.",
                  }, function(module) {
                      var isSprinting = false;
                  
                      module.on("enable", function() {
                          isSprinting = mc.thePlayer.isSprinting();
                      });
                  
                      module.on("disable", function() {
                          if (isSprinting) {
                              mc.gameSettings.keyBindSprint.pressed = false;
                              isSprinting = false;
                          }
                  
                          mc.gameSettings.keyBindForward.pressed = false;
                      });
                  
                      module.on("update", function() {
                          mc.gameSettings.keyBindForward.pressed = true;
                  
                          if (!isSprinting) {
                              mc.gameSettings.keyBindSprint.pressed = true;
                              isSprinting = true;
                          }
                      });
                  });
                  
                  

                  *This module listens for the enable event and saves the player's sprinting state. Then, it listens for the disable event and releases the forward key and the sprint key if it was pressed. Finally, it listens for the update event and keeps the forward key pressed while continuously checking if the sprint key is pressed, and if not, it presses the sprint key to keep the player sprinting.

                  Note: Please make sure to test this script in a safe environment before using it in the game. Also, keep in mind that some servers may have rules against the use of automation scripts, so use it at your own risk.*

                  1 Reply Last reply Reply Quote 0
                  • Никитыч Китыч
                    Никитыч Китыч @pepeshki last edited by

                    @pepeshki thanks

                    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