Originally Posted by Phanx
Code:
local hp = HP(unit)
local perc = hp / MaxHP(unit)
return "|cff%s%s",
perc <= 0.35 and "ff0000"
or perc <= 0.75 and "ffa500"
or "00ff00",
UnitIsPlayer(unit) and hp or Short(hp, true)
I'm not sure if you're allowed to use actual API functions in LuaTexts; if not, you'll have to figure out what the LuaTexts equivalent of UnitIsPlayer is and substitute that.
|
Check out
PitBull Unit Frames 4.0 - Lua Texts . That's if you don't know already. I don't know if it say's anything about "
UnitIsPlayer" though.
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?
Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!