Give me script autodisable fly pls :(
-
Re: AutoDisable
-
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; } }); });
-