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. Scripts
  3. Give me script autodisable fly pls :(

Give me script autodisable fly pls :(

Scheduled Pinned Locked Moved Scripts
3 Posts 3 Posters 245 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.
  • nam nguyenN Offline
    nam nguyenN Offline
    nam nguyen
    wrote on last edited by
    #1

    Re: AutoDisable

    G 1 Reply Last reply
    0
    • G Offline
      G Offline
      Gabriel
      replied to nam nguyen on last edited by Gabriel
      #2

      @nam-nguyen

      var fadeTimer = 0;
      var reasons = ['Fly disabled due to server change.', 'Fly disabled due to you dying.'];
      var S06PacketUpdateHealth = Java.type('net.minecraft.network.play.server.S06PacketUpdateHealth');
      var ScaledResolution = Java.type('net.minecraft.client.gui.ScaledResolution');
      var Fly = moduleManager.getModule('Fly');
      function getScaledWidth() {
          var scaledWidth = new ScaledResolution(mc).getScaledWidth();
          return scaledWidth;
      }
      function getScaledHeight() {
          var scaledHeight = new ScaledResolution(mc).getScaledHeight();
          return scaledHeight;
      }
      var script = registerScript({
          name: 'AutoDisable',
          version: '0.0.0',
          authors: ['Shurpe']
      });
      script.registerModule({
          name: 'AutoDisable',
          description: 'Turns off the Fly module when needed',
          category: 'Fun'
      
      }, function (module) {
      	module.on('packet', function (e) {
      		var packet = e.getPacket();
              if (packet instanceof S06PacketUpdateHealth && packet.getHealth() <= 0 && Fly.getState()) {
                  Fly.setState(false); reason = reasons[1]; disabled = true;
              }
          });
      	module.on('update', function () {
              mcWidth = getScaledWidth(); mcHeight = getScaledHeight();
              disabled ? fadeTimer++ : fadeTimer = 0;
              if (fadeTimer >= 50) {
                  disabled = false;
              }
          });
          module.on('render2D', function () {
              if (disabled) {
                  mc.fontRendererObj.drawStringWithShadow(reason, mcWidth / 2 - mc.fontRendererObj.getStringWidth(reason) / 2, 15, 0xFFFFFF);
                  mc.fontRendererObj.drawStringWithShadow('§cWarning!', mcWidth / 2 - mc.fontRendererObj.getStringWidth('Warning!') / 2, 5, 0xFFFFFF);
              }
          });
          module.on('world', function () {
              if (Fly.getState()) {
                  reason = reasons[0]; Fly.setState(false); disabled = true;
              }
          });
      });
      
      1 Reply Last reply
      0
      • A Offline
        A Offline
        Aftery
        wrote on last edited by
        #3

        ltg.jpg

        1 Reply Last reply
        0
        • G Gabriel referenced this topic on

        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