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()))
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() + 5, y + 6, color.new(0,0,0,anim:get()))
render:text("Health: ", x * anim:get() + 5, y + 16, color.new(0,0,0,anim:get()))
render:text(math:floor(prev:health()), x * anim:get() + 5 + render:text_width("Health: "), y + 16, render:alpha(health,anim:get()))
end
end)
Last updated
Was this helpful?