🎯TargetHud

:(

script:name("Testing")
script:devs({"ConeTin"})
script:desc("Mamu ebal errorok")

anim = animation.new()
prev = nil
thud = drag.new("TargetHud"):set_width(100):set_height(35):set_x(client:screen_width() / 2 - 50):set_y(client:screen_height() - 150)


events.render_2d:set(function(event)
    target = client:aura_target()
    
    anim:animate(target ~= nil and 1 or 0, 50)

    if target ~= nil then
        prev = target
    end
    if prev ~= nil then
        x = thud:x()
        y = thud:y()
        width = thud:width()
        height = thud:height()
        size = 25 - prev:hurt_time() / 5
        sizepadding = prev:hurt_time() / 10;
        
        
        render:rect(x * anim:get(),y,width,height,4,color.new(1,1,1, anim:get()))
        render:init_stencil()
        render:image("sword.png", x * anim:get() + 4 + sizepadding, y + 5 + sizepadding, size, size, render:alpha(client:client_colors()[1], anim:get()))
        render:read_stencil(1)
        gl11:pushMatrix()
        gl11:init()
        gl11:lineWidth(2.5)
        gl11:begin(3)

        for i = 1, 25 do
            gl11:color(render:alpha(client:client_color(i * 5), anim:get()))
            gl11:vertex2d(x * anim:get() + 4, y + 5 + i)
            gl11:vertex2d(x * anim:get() + 4 + 25, y + 5 + i)
        end

        gl11:glEnd()
        gl11:finish()
        gl11:popMatrix()
        render:finish_stencil()

        render:glow(x * anim:get() + 4 + sizepadding, y + 5 + sizepadding, size, size, 12, 8, render:alpha(client:client_colors()[1], anim:get()),render:alpha(client:client_colors()[2], anim:get()),render:alpha(client:client_colors()[2], anim:get()),render:alpha(client:client_colors()[1], anim:get()))

        health = color.new(0,1,0)
        if prev:health() < 15 then
            health = color.new(1,1,0)
        end

        if prev:health() < 10 then
            health = color.new(1,0.5,0)
        end
        
        if prev:health() < 5 then
            health = color.new(1,0,0)
        end

        render:text(prev:name(), x * anim:get() + 33, y + 6, color.new(0,0,0,anim:get()))
        render:text("Health: ", x * anim:get() + 33, y + 16, color.new(0,0,0,anim:get()))
        render:text(math:floor(prev:health()), x * anim:get() + 33 + render:text_width("Health: "), y + 16, render:alpha(health,anim:get()))
    end

end)

Last updated