Thread: Pitbull Text
View Single Post
12-27-15, 06:19 PM   #3
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
Originally Posted by Phanx View Post
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!
  Reply With Quote