I just want a text display my max and my current hp unfortunately I have no idea about lua. So plz help me :>
There is a health trigger (Status -> Unit Health), just use it with a progress bar display. ;D
Its as simple as that :D
If you want to see the MAX value, enter "%t" [for total] into either the left or right text box of the progress bar display
okay thats great. just %p / %t into the right text and it works.
Is there a way to turn this display into a percentage as opposed to the absolute values?
Use text "%c" and in the custom text code use:
local p = math.max(0, UnitHealth("UNITID")) / math.max(1, UnitHealthMax("UNITID")) * 100;
return p; -- Unformated
return string.format("Percent: %.2f", p); -- Formated
Replace "UNITID" with "target", "player", "focus", ect. and either remove the - - Formated or - - Unformated line. ;)
You must login to post a comment. Don't have an account? Register to get one!