Hello i have a code here wich i want some attention to:
local cur, max = HP(unit), MaxHP(unit)
local PerHP = cur/max
local hr, hg, hb
if (PerHP < 0.5) then
hr = 255
hg = 255 * PerHP * 2
hb = 0
else
hr = 255 * (1 - ((PerHP - 0.5) * 2))
hg = 255
hb = 0
end
return "|cff%02x%02x%02x%s",hr,hg,hb,Short(cur,true)
|
at the moment it displays my health as (409k)
but i want it to display my health as (409200)
also i want this only on "players"
on otther units such as mobs, npcs i want it to display as (409k)
With Health set to
Green at 100% health,
Orange at 75% health and
Red at 35% health