Thread Tools Display Modes
05-27-11, 05:33 PM   #1
Ashram35
A Murloc Raider
Join Date: Jul 2010
Posts: 4
Stuf perchp lua help

I found a post similar to what i need help with but it was a little older and wasn't 100% what i wanted. Mainly I'm looking to have the text for perchp be colored depending on what it's at. This is what I found code wise:

function(unit, cache, textframe)
if UnitExists(unit) then
local perchp = 100 * UnitHealth(unit)/UnitHealthMax(unit)
return "%.1f%%",perchp
else
local perchp = 100 * UnitHealth("player")/UnitHealthMax("player")
return "%.1f%%",perchp
end
end

Now i don't need the % sign or the decimals and i can remove that just fine but I'm not sure how to add the color to the text part. Any help would be greatly appreciated.
  Reply With Quote
05-29-11, 09:21 AM   #2
Ashram35
A Murloc Raider
Join Date: Jul 2010
Posts: 4
Don't worry about it i'm just an idiot and missed the hpthreashold colortag. Sorry about wasting a forum post on this.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Stuf perchp lua help


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off