Could somebody fix this script?
-
So How the title says i want to ask if somebody could fix this script
Script:
https://forums.ccbluex.net/topic/305/script-target-hud-1-2-5?_=1615208498256
(TargetHUD by chocopie)Issue:
https://forums.ccbluex.net/assets/uploads/files/1595733988519-screenshot_41.png
This is how it should lookThis is how it looks:
https://imgur.com/ZFs0fj8Also i fully reinstalled mc/LB, and i am using LB72, could somebody help me?
Or fix this script? -
@šlósa why are you using this target hud when there are much better ones
epic code
var script = registerScript( { name: "TargetHUD", version: "1.2.5", authors: ["Choco", "Scorpion3013", "Wu_dian", "6Sence"] }); var player = Java.type("net.minecraft.entity.player.EntityPlayer"); var mobs = Java.type("net.minecraft.entity.EntityCreature") var GlStateManager = Java.type("net.minecraft.client.renderer.GlStateManager") var RenderHelper = Java.type("net.minecraft.client.renderer.RenderHelper") var OpenGlHelper = Java.type("net.minecraft.client.renderer.OpenGlHelper") var Potion = Java.type("net.minecraft.potion.Potion"); var target var e1 var Fonts = Java.type("net.ccbluex.liquidbounce.ui.font.Fonts"); var GL11 = Java.type("org.lwjgl.opengl.GL11"); var StringSelection = Java.type("java.awt.datatransfer.StringSelection"); var ScaledResolution = Java.type("net.minecraft.client.gui.ScaledResolution"); var AntiBot = Java.type("net.ccbluex.liquidbounce.features.module.modules.misc.AntiBot"); var Color = Java.type("java.awt.Color"); script.registerModule( { name: "TargetHUD", category: "Fun", description: "idk", tag: "ok em", settings: { scale: Setting.float( { name: "Scale", min: 0, max: 2, default: 1 }), x: Setting.float( { name: "PosX", min: -100, max: 100, default: 1 }), y: Setting.float( { name: "PosY", min: -100, max: 100, default: 1 }), BGAlpha: Setting.integer( { name: "BackGroundAlpha", min: 0, max: 255, default: 150 }), onlyplayer: Setting.boolean( { name: "OnlyPlayer", default: true }), nobot: Setting.boolean( { name: "NoBot", default: true }), distance: Setting.float( { name: "DistanceToNotRender", min: 5, max: 50, default: 15 }), hbanimation: Setting.float( { name: "HealthBarAnimationSpeed", min: 1, max: 6, default: 5 }), } }, function (TargetHUD) { TargetHUD.on("enable", function () { target = null displayHealth = 0 }); TargetHUD.on("render2D", function (event) { var mcHeight = getScaledHeight(); var mcWidth = getScaledWidth(); if (target != null) { var partialTicks = 1 - event.getPartialTicks() var currenthealth = target.getHealth() .toFixed(0) var maxhealth = target.getMaxHealth() var hp = mc.thePlayer.getHealth() .toFixed(0); var playerInfo = mc.getNetHandler() .getPlayerInfo(target.getUniqueID()); var ping = playerInfo == null ? "0 ms" : playerInfo.getResponseTime() + " ms"; var BGColor = new Color(0, 0, 0, TargetHUD.settings.BGAlpha.get()) .getRGB(); GL11.glPushMatrix(); GL11.glScaled(TargetHUD.settings.scale.get(), TargetHUD.settings.scale.get(), TargetHUD.settings.scale.get()); GL11.glTranslated(TargetHUD.settings.x.get(), TargetHUD.settings.y.get(), 0); drawRect(mcWidth / 2 + 49, mcHeight / 2 + 2, mcWidth / 2 + 263.5 - 1, mcHeight / 2 + 72, BGColor); drawEntityOnScreen(mcWidth / 2 + 70, mcHeight / 2 + 65, 29.3, target.rotationYaw, target.rotationPitch, target) Fonts.font40.drawStringWithShadow(target.getName(), mcWidth / 2 + 96, mcHeight / 2 + 7, 0xFFFFFF); Fonts.font35.drawStringWithShadow(ping, mcWidth / 2 + 224, mcHeight / 2 + 7, 0xFFFFFF); Fonts.font35.drawStringWithShadow(' Distance: ' + target.getDistanceToEntity(mc.thePlayer) .toFixed(2) + ' | Sneaking: ' + target.isSneaking(), mcWidth / 2 + 91, mcHeight / 2 + 19, 0xFFFFFF); Fonts.font35.drawStringWithShadow(' Health: ' + currenthealth + '/' + maxhealth + ' | Hurt Time: ' + target.hurtTime, mcWidth / 2 + 91, mcHeight / 2 + 32, 0xFFFFFF); Fonts.font35.drawStringWithShadow("Regeneration: " + e1, mcWidth / 2 + 96, mcHeight / 2 + 45, 0xFFFFFF); if ((hp - currenthealth) > 0) { Fonts.font40.drawStringWithShadow(' You Will Win The Combat! ', mcWidth / 2 + 91, mcHeight / 2 + 57, new Color(45, 214, 45) .getRGB()); } if ((hp - currenthealth) < 0) { Fonts.font40.drawStringWithShadow(' You Will Lose The Combat! ', mcWidth / 2 + 91, mcHeight / 2 + 57, new Color(215, 20, 20) .getRGB()); } if ((hp - currenthealth) == 0) { Fonts.font40.drawStringWithShadow(' You Will Draw The Combat! ', mcWidth / 2 + 91, mcHeight / 2 + 57, new Color(200, 200, 30) .getRGB()); } if (toPercent(currenthealth, maxhealth) >= 80) { drawRect(mcWidth / 2 + 49, mcHeight / 2 + 69, mcWidth / 2 + (toPercent(currenthealth, maxhealth) * 2) + 62, mcHeight / 2 + 72.3, 0x8800FF00); } else if (toPercent(currenthealth, maxhealth) >= 60) { drawRect(mcWidth / 2 + 49, mcHeight / 2 + 69, mcWidth / 2 + (toPercent(currenthealth, maxhealth) * 2) + 62, mcHeight / 2 + 72.3, 0x88CCFF66); } else if (toPercent(currenthealth, maxhealth) >= 40) { drawRect(mcWidth / 2 + 49, mcHeight / 2 + 69, mcWidth / 2 + (toPercent(currenthealth, maxhealth) * 2) + 62, mcHeight / 2 + 72.3, 0x88FFFF00); } else if (toPercent(currenthealth, maxhealth) >= 20) { drawRect(mcWidth / 2 + 49, mcHeight / 2 + 69, mcWidth / 2 + (toPercent(currenthealth, maxhealth) * 2) + 62, mcHeight / 2 + 72.3, 0x88FF5500); } else if (toPercent(currenthealth, maxhealth) > 0) { drawRect(mcWidth / 2 + 48, mcHeight / 2 + 69, mcWidth / 2 + (toPercent(currenthealth, maxhealth) * 2) + 64, mcHeight / 2 + 72.3, 0x88FF0000); } GL11.glPopMatrix(); if (target.isDead || target.getDistanceToEntity(mc.thePlayer) > TargetHUD.settings.distance.get()) { target = null; } } }); TargetHUD.on("attack", function (event) { var entity = event.getTargetEntity(); if ((TargetHUD.settings.onlyplayer.get() == true && entity instanceof player) || (TargetHUD.settings.onlyplayer.get() == false)) { if ((AntiBot.isBot(entity) == false && TargetHUD.settings.nobot.get() == true) || (TargetHUD.settings.nobot.get() == false)) { target = entity } } }); TargetHUD.on("update", function () { if (target != null) { if (target.isPotionActive(Potion.regeneration)) { e1 = "Active" } if (!target.isPotionActive(Potion.regeneration)) { e1 = "Inactive" } } else { displayHealth = nullHealth } }) }); function drawEntityOnScreen(posX, posY, scale, mouseX, mouseY, ent) { GlStateManager.enableColorMaterial(); GlStateManager.pushMatrix(); GlStateManager.translate(posX, posY, 50.0); GlStateManager.scale((-scale), scale, scale); GlStateManager.rotate(180.0, 0.0, 0.0, 1.0); GlStateManager.rotate(135.0, 0.0, 1.0, 0.0); RenderHelper.enableStandardItemLighting(); GlStateManager.rotate(-135.0, 0.0, 1.0, 0.0); GlStateManager.translate(0.0, 0.0, 0.0); rendermanager = mc.getRenderManager(); rendermanager.setPlayerViewY(180.0); rendermanager.setRenderShadow(false); rendermanager.renderEntityWithPosYaw(ent, 0.0, 0.0, 0.0, 0.0, 1.0); rendermanager.setRenderShadow(true); GlStateManager.popMatrix(); RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); GlStateManager.disableTexture2D(); GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); } function toPercent(num, total) { return (Math.round(num / total * 10000) / 100); } function getScaledWidth() { var scaledWidth = new ScaledResolution(mc) .getScaledWidth(); return scaledWidth; } function getScaledHeight() { var scaledHeight = new ScaledResolution(mc) .getScaledHeight(); return scaledHeight; } function drawRect(paramXStart, paramYStart, paramXEnd, paramYEnd, color) { var alpha = (color >> 24 & 0xFF) / 255; var red = (color >> 16 & 0xFF) / 255; var green = (color >> 8 & 0xFF) / 255; var blue = (color & 0xFF) / 255; GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glPushMatrix(); GL11.glColor4f(red, green, blue, alpha); GL11.glBegin(GL11.GL_TRIANGLE_FAN); GL11.glVertex2d(paramXEnd, paramYStart); GL11.glVertex2d(paramXStart, paramYStart); GL11.glVertex2d(paramXStart, paramYEnd); GL11.glVertex2d(paramXEnd, paramYEnd); GL11.glEnd(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_LINE_SMOOTH); GL11.glColor4f(1, 1, 1, 1); }
-
I fixed months ago im just too lazy to release the new version
-
@skidma said in Could somebody fix this script?:
@šlósa why are you using this target hud when there are much better ones
epic code
var script = registerScript( { name: "TargetHUD", version: "1.2.5", authors: ["Choco", "Scorpion3013", "Wu_dian", "6Sence"] }); var player = Java.type("net.minecraft.entity.player.EntityPlayer"); var mobs = Java.type("net.minecraft.entity.EntityCreature") var GlStateManager = Java.type("net.minecraft.client.renderer.GlStateManager") var RenderHelper = Java.type("net.minecraft.client.renderer.RenderHelper") var OpenGlHelper = Java.type("net.minecraft.client.renderer.OpenGlHelper") var Potion = Java.type("net.minecraft.potion.Potion"); var target var e1 var Fonts = Java.type("net.ccbluex.liquidbounce.ui.font.Fonts"); var GL11 = Java.type("org.lwjgl.opengl.GL11"); var StringSelection = Java.type("java.awt.datatransfer.StringSelection"); var ScaledResolution = Java.type("net.minecraft.client.gui.ScaledResolution"); var AntiBot = Java.type("net.ccbluex.liquidbounce.features.module.modules.misc.AntiBot"); var Color = Java.type("java.awt.Color"); script.registerModule( { name: "TargetHUD", category: "Fun", description: "idk", tag: "ok em", settings: { scale: Setting.float( { name: "Scale", min: 0, max: 2, default: 1 }), x: Setting.float( { name: "PosX", min: -100, max: 100, default: 1 }), y: Setting.float( { name: "PosY", min: -100, max: 100, default: 1 }), BGAlpha: Setting.integer( { name: "BackGroundAlpha", min: 0, max: 255, default: 150 }), onlyplayer: Setting.boolean( { name: "OnlyPlayer", default: true }), nobot: Setting.boolean( { name: "NoBot", default: true }), distance: Setting.float( { name: "DistanceToNotRender", min: 5, max: 50, default: 15 }), hbanimation: Setting.float( { name: "HealthBarAnimationSpeed", min: 1, max: 6, default: 5 }), } }, function (TargetHUD) { TargetHUD.on("enable", function () { target = null displayHealth = 0 }); TargetHUD.on("render2D", function (event) { var mcHeight = getScaledHeight(); var mcWidth = getScaledWidth(); if (target != null) { var partialTicks = 1 - event.getPartialTicks() var currenthealth = target.getHealth() .toFixed(0) var maxhealth = target.getMaxHealth() var hp = mc.thePlayer.getHealth() .toFixed(0); var playerInfo = mc.getNetHandler() .getPlayerInfo(target.getUniqueID()); var ping = playerInfo == null ? "0 ms" : playerInfo.getResponseTime() + " ms"; var BGColor = new Color(0, 0, 0, TargetHUD.settings.BGAlpha.get()) .getRGB(); GL11.glPushMatrix(); GL11.glScaled(TargetHUD.settings.scale.get(), TargetHUD.settings.scale.get(), TargetHUD.settings.scale.get()); GL11.glTranslated(TargetHUD.settings.x.get(), TargetHUD.settings.y.get(), 0); drawRect(mcWidth / 2 + 49, mcHeight / 2 + 2, mcWidth / 2 + 263.5 - 1, mcHeight / 2 + 72, BGColor); drawEntityOnScreen(mcWidth / 2 + 70, mcHeight / 2 + 65, 29.3, target.rotationYaw, target.rotationPitch, target) Fonts.font40.drawStringWithShadow(target.getName(), mcWidth / 2 + 96, mcHeight / 2 + 7, 0xFFFFFF); Fonts.font35.drawStringWithShadow(ping, mcWidth / 2 + 224, mcHeight / 2 + 7, 0xFFFFFF); Fonts.font35.drawStringWithShadow(' Distance: ' + target.getDistanceToEntity(mc.thePlayer) .toFixed(2) + ' | Sneaking: ' + target.isSneaking(), mcWidth / 2 + 91, mcHeight / 2 + 19, 0xFFFFFF); Fonts.font35.drawStringWithShadow(' Health: ' + currenthealth + '/' + maxhealth + ' | Hurt Time: ' + target.hurtTime, mcWidth / 2 + 91, mcHeight / 2 + 32, 0xFFFFFF); Fonts.font35.drawStringWithShadow("Regeneration: " + e1, mcWidth / 2 + 96, mcHeight / 2 + 45, 0xFFFFFF); if ((hp - currenthealth) > 0) { Fonts.font40.drawStringWithShadow(' You Will Win The Combat! ', mcWidth / 2 + 91, mcHeight / 2 + 57, new Color(45, 214, 45) .getRGB()); } if ((hp - currenthealth) < 0) { Fonts.font40.drawStringWithShadow(' You Will Lose The Combat! ', mcWidth / 2 + 91, mcHeight / 2 + 57, new Color(215, 20, 20) .getRGB()); } if ((hp - currenthealth) == 0) { Fonts.font40.drawStringWithShadow(' You Will Draw The Combat! ', mcWidth / 2 + 91, mcHeight / 2 + 57, new Color(200, 200, 30) .getRGB()); } if (toPercent(currenthealth, maxhealth) >= 80) { drawRect(mcWidth / 2 + 49, mcHeight / 2 + 69, mcWidth / 2 + (toPercent(currenthealth, maxhealth) * 2) + 62, mcHeight / 2 + 72.3, 0x8800FF00); } else if (toPercent(currenthealth, maxhealth) >= 60) { drawRect(mcWidth / 2 + 49, mcHeight / 2 + 69, mcWidth / 2 + (toPercent(currenthealth, maxhealth) * 2) + 62, mcHeight / 2 + 72.3, 0x88CCFF66); } else if (toPercent(currenthealth, maxhealth) >= 40) { drawRect(mcWidth / 2 + 49, mcHeight / 2 + 69, mcWidth / 2 + (toPercent(currenthealth, maxhealth) * 2) + 62, mcHeight / 2 + 72.3, 0x88FFFF00); } else if (toPercent(currenthealth, maxhealth) >= 20) { drawRect(mcWidth / 2 + 49, mcHeight / 2 + 69, mcWidth / 2 + (toPercent(currenthealth, maxhealth) * 2) + 62, mcHeight / 2 + 72.3, 0x88FF5500); } else if (toPercent(currenthealth, maxhealth) > 0) { drawRect(mcWidth / 2 + 48, mcHeight / 2 + 69, mcWidth / 2 + (toPercent(currenthealth, maxhealth) * 2) + 64, mcHeight / 2 + 72.3, 0x88FF0000); } GL11.glPopMatrix(); if (target.isDead || target.getDistanceToEntity(mc.thePlayer) > TargetHUD.settings.distance.get()) { target = null; } } }); TargetHUD.on("attack", function (event) { var entity = event.getTargetEntity(); if ((TargetHUD.settings.onlyplayer.get() == true && entity instanceof player) || (TargetHUD.settings.onlyplayer.get() == false)) { if ((AntiBot.isBot(entity) == false && TargetHUD.settings.nobot.get() == true) || (TargetHUD.settings.nobot.get() == false)) { target = entity } } }); TargetHUD.on("update", function () { if (target != null) { if (target.isPotionActive(Potion.regeneration)) { e1 = "Active" } if (!target.isPotionActive(Potion.regeneration)) { e1 = "Inactive" } } else { displayHealth = nullHealth } }) }); function drawEntityOnScreen(posX, posY, scale, mouseX, mouseY, ent) { GlStateManager.enableColorMaterial(); GlStateManager.pushMatrix(); GlStateManager.translate(posX, posY, 50.0); GlStateManager.scale((-scale), scale, scale); GlStateManager.rotate(180.0, 0.0, 0.0, 1.0); GlStateManager.rotate(135.0, 0.0, 1.0, 0.0); RenderHelper.enableStandardItemLighting(); GlStateManager.rotate(-135.0, 0.0, 1.0, 0.0); GlStateManager.translate(0.0, 0.0, 0.0); rendermanager = mc.getRenderManager(); rendermanager.setPlayerViewY(180.0); rendermanager.setRenderShadow(false); rendermanager.renderEntityWithPosYaw(ent, 0.0, 0.0, 0.0, 0.0, 1.0); rendermanager.setRenderShadow(true); GlStateManager.popMatrix(); RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); GlStateManager.disableTexture2D(); GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); } function toPercent(num, total) { return (Math.round(num / total * 10000) / 100); } function getScaledWidth() { var scaledWidth = new ScaledResolution(mc) .getScaledWidth(); return scaledWidth; } function getScaledHeight() { var scaledHeight = new ScaledResolution(mc) .getScaledHeight(); return scaledHeight; } function drawRect(paramXStart, paramYStart, paramXEnd, paramYEnd, color) { var alpha = (color >> 24 & 0xFF) / 255; var red = (color >> 16 & 0xFF) / 255; var green = (color >> 8 & 0xFF) / 255; var blue = (color & 0xFF) / 255; GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glPushMatrix(); GL11.glColor4f(red, green, blue, alpha); GL11.glBegin(GL11.GL_TRIANGLE_FAN); GL11.glVertex2d(paramXEnd, paramYStart); GL11.glVertex2d(paramXStart, paramYStart); GL11.glVertex2d(paramXStart, paramYEnd); GL11.glVertex2d(paramXEnd, paramYEnd); GL11.glEnd(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_LINE_SMOOTH); GL11.glColor4f(1, 1, 1, 1); }
the design isn't really bad but the codes are horrible af
-
if if if if if if if if if if if if if if if if if if if if if if if if if if if if if if if if if if if if
else
else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if else if -
@sigma-allah release it...
-
@skidma said in Could somebody fix this script?:
you using this target hud when there are much bet
becouse i like the design, could sommebody fix it please?
-
@skidma thanks you so much, i am grateful