target_hud
Target HUD to show the draggables, rendering, player and some logic impls. Designed inspired by legit client
pro_hud.lualualocal health_animation = types.animation.new(250, enums.easings.ease_out_quint)local font = types.font.new("nunito", enums.font_weight.bold)-- unused but very good to make animationslocal stopwatch = types.stopwatch.new()local targetlocal previous_target-- to use with health_animationlocal old_health = 0modules.register("Pro HUD", "Mode", {on_render_2d = function(event)if target == nil thenreturnendlocal name = target.get_name().get_string()local pos_x = draggables.get_x("Pro HUD")local pos_y = draggables.get_y("Pro HUD")local texturelocal pl = target.to_player();texture = pl.get_skin_texture()local width = font.get_width(name, 9) + 45local height = 40local health = target.get_health()local max_health = target.get_max_health()local max_health_width = font.get_width(name, 9)local health_width = max_health_width * (health / max_health)if old_health ~= health thenlocal previous_health_width = max_health_width * (old_health / max_health)health_animation.start(previous_health_width, health_width)endif not health_animation.is_finished() thenhealth_width = health_animation.get_value()endlocal color1 = client.get_color(0)local color2 = client.get_color(width)draggables.set_width("Pro HUD", width)draggables.set_height("Pro HUD", height)render.rounded_rect(pos_x, pos_y, width, height, 5).color(0x141414).build()render.rounded_rect(pos_x + 37.5, pos_y + 25, max_health_width, 6, 3).color(0x282828).build()render.rounded_rect(pos_x + 37.5, pos_y + 25, health_width, 6, 3).horizontal_gradient(color1, color2).build()render.text(name, pos_x + 37.5, pos_y + 9).font(font, 9).build()render.texture(pos_x + 7.5, pos_y + 7.5, 25, 25, texture).radius(5).crop(8 / 64, 8 / 64, 16 / 64, 16 / 64).build()render.render()old_health = healthend,on_motion = function(event)local screen_name = client.get_screen_name()local new_target = client.get_target()-- if client is on screen, make it show with target the player, so we can visualize and drag itif screen_name ~= nil and screen_name == "Chat screen" thentarget = playerstopwatch.reset()elseif target == nil or new_target ~= previous_target thentarget = client.get_target()stopwatch.reset()endprevious_target = targetend})draggables.register("Pro HUD")