Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. ScriptAPI
  3. Help With Fixing Code

Help With Fixing Code

Scheduled Pinned Locked Moved Unsolved ScriptAPI
11 Posts 5 Posters 554 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • IgniteTNTI Offline
    IgniteTNTI Offline
    IgniteTNT
    wrote on last edited by
    #1

    Can Somebody Help Me To Get The Code Down Below To Work? I Am Slightly Confused On This Scripting API.

    const script = registerScript({
        name: "AntiVulcanLimit",
        version: "1.0.0",
        authors: ["IgniteTNT"]
    });
    
    var sneakCooldown = 200; // Cooldown in milliseconds 
    
    script.registerModule({
        name: "VulcanLimit",
        category: "Misc", // Movement, Combat, Renderr, ...
        description: "Bypass Vulcan's Limit Check When Scaffolding"
    }, (mod) => {
        mod.on("enable", () => {
            Client.displayChatMessage("§aEnabled AntiVulcanLimit :)");
            mc.gameSettings.keyBindSneak.pressed = true;
            setTimeout(function() {
                mc.gameSettings.keyBindSneak.pressed = false;
            }, sneakCooldown);
        });
    
        mod.on("disable", () => {
            Client.displayChatMessage("§aDisabled AntiVulcanLimit :(");
        });
        
        this.onGround = function(event) {
            mc.gameSettings.keyBindSneak.pressed = true;
            setTimeout(function() {
                mc.gameSettings.keyBindSneak.pressed = false;
            }, sneakCooldown);
        }
    });
    
    
    
    V 1 Reply Last reply
    1
    • EclipsesDevE Offline
      EclipsesDevE Offline
      EclipsesDev Moderator
      wrote on last edited by
      #2

      LEGACY: https://liquidbounce.net/docs/ScriptAPI (legacy)

      NEXTGEN: https://liquidbounce.net/docs/ScriptAPI (nextgen)

      1 Reply Last reply
      0
      • V Offline
        V Offline
        V3r.SaceX
        wrote on last edited by
        #3
        const script = registerScript({
            name: "AntiVulcanLimit",
            version: "1.0.0",
            authors: ["IgniteTNT"]
        });
        
        var sneakCooldown = 200; // Cooldown in milliseconds 
        
        script.registerModule({
            name: "VulcanLimit",
            category: "Misc", // Movement, Combat, Renderr, ...
            description: "Bypass Vulcan's Limit Check When Scaffolding"
        }, (mod) => {
            mod.on("enable", () => {
                Client.displayChatMessage("§aEnabled AntiVulcanLimit :)");
                mc.gameSettings.keyBindSneak.pressed = true;
                setTimeout(function() {
                    mc.gameSettings.keyBindSneak.pressed = false;
                }, sneakCooldown);
            });
        
            mod.on("disable", () => {
                Client.displayChatMessage("§aDisabled AntiVulcanLimit :(");
            });
            
            mod.on("ground", function(event) {
                mc.gameSettings.keyBindSneak.pressed = true;
                setTimeout(function() {
                    mc.gameSettings.keyBindSneak.pressed = false;
                }, sneakCooldown);
            });
        });
        
        

        In this corrected version, I replaced this.onGround with mod.on("ground", ...), which correctly registers the event handler function.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          V3r.SaceX
          replied to IgniteTNT on last edited by
          #4

          @IgniteTNT In this corrected version, I replaced this.onGround with mod.on("ground", ...), which correctly registers the event handler function.

          const script = registerScript({
              name: "AntiVulcanLimit",
              version: "1.0.0",
              authors: ["IgniteTNT"]
          });
          
          var sneakCooldown = 200; // Cooldown in milliseconds 
          
          script.registerModule({
              name: "VulcanLimit",
              category: "Misc", // Movement, Combat, Renderr, ...
              description: "Bypass Vulcan's Limit Check When Scaffolding"
          }, (mod) => {
              mod.on("enable", () => {
                  Client.displayChatMessage("§aEnabled AntiVulcanLimit :)");
                  mc.gameSettings.keyBindSneak.pressed = true;
                  setTimeout(function() {
                      mc.gameSettings.keyBindSneak.pressed = false;
                  }, sneakCooldown);
              });
          
              mod.on("disable", () => {
                  Client.displayChatMessage("§aDisabled AntiVulcanLimit :(");
              });
              
              mod.on("ground", function(event) {
                  mc.gameSettings.keyBindSneak.pressed = true;
                  setTimeout(function() {
                      mc.gameSettings.keyBindSneak.pressed = false;
                  }, sneakCooldown);
              });
          });
          
          
          1 Reply Last reply
          0
          • V Offline
            V Offline
            V3r.SaceX
            wrote on last edited by
            #5

            i fixed it

            1 Reply Last reply
            0
            • IgniteTNTI Offline
              IgniteTNTI Offline
              IgniteTNT
              wrote on last edited by
              #6

              Thank you!

              1 Reply Last reply
              0
              • IgniteTNTI Offline
                IgniteTNTI Offline
                IgniteTNT
                wrote on last edited by
                #7

                Still doesn't work, thank you for attempting it though!

                1 Reply Last reply
                0
                • kawaiinekololisK Offline
                  kawaiinekololisK Offline
                  kawaiinekololis Admin
                  wrote on last edited by
                  #8

                  There is no event called on ground. You should use one of the tick events...

                  1 Reply Last reply
                  0
                  • IgniteTNTI Offline
                    IgniteTNTI Offline
                    IgniteTNT
                    wrote on last edited by
                    #9

                    What is the syntax for tick events?

                    Riceuser2R 1 Reply Last reply
                    0
                    • Riceuser2R Offline
                      Riceuser2R Offline
                      Riceuser2
                      replied to IgniteTNT on last edited by Riceuser2
                      #10

                      @IgniteTNT U can try this:

                      let ticks = 0;
                      //....
                      
                      mod.on("update", () => {
                          ticks++;
                      
                          if (ticks === 10) { // put it as your opinion
                              mc.gameSettings.keyBindSneak.pressed = true;
                          } else {
                              mc.gameSettings.keyBindSneak.pressed = false;
                              ticks = 0;
                          }
                      }
                      
                      1 Reply Last reply
                      0
                      • IgniteTNTI Offline
                        IgniteTNTI Offline
                        IgniteTNT
                        wrote on last edited by
                        #11

                        It doesn't seem to like mc.gameSettings.keyBindSneak.pressed works, weird.

                        1 Reply Last reply
                        0

                        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
                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups