Hi guys,
Since I'm not good in Lua and my friends that are more into programming can't help me with that, this forum is my last hope.
I want to create a Lua-Text in PitBull Unit Frames, so that it shows this:
Name | HP %
Name should be in classcolor and HP% in HPColor.
So I have to separate scripts for that running:
Name | (ClassColor)
Code:
local r,g,b = ClassColor(unit)
return '|cff%02x%02x%02x%s|r %s%s%s|',r,g,b,Name(unit),Angle(AFK(unit) or DND(unit))
HP % (HPColor)
Code:
local s = Status(unit)
if s then
return s
end
local cur,max = HP(unit),MaxHP(unit);
local hr,hg,hb=HPColor(cur,max);
return "|cff%02x%02x%02x%.0f|r" or "", hr,hg,hb,100*cur/max
I want to combine both scripts, so that I can display them in one lua-text. I need that, because otherwise I'm not able to center the text within the unitframe.
Can you help me with that?
Thanks!
edit:
We've tried that, but it isn't working:
Code:
local s = Status(unit)
if s then
return s
end
local cur,max = HP(unit),MaxHP(unit);
local hr,hg,hb=HPColor(cur,max);
local r,g,b = ClassColor(unit)
return '|cff%02x%02x%02x%s|r %s%s%s| |cff%02x%02x%02x%.0f|r',r,g,b,Name(unit),Angle(AFK(unit) or DND(unit)), hr,hg,hb,100*cur/max