FANDOM


Get the current percentage health of a unit.

UnitHealth("unit")

Parameter Edit

unit
String - the UnitID (e.g. "target", "party1", "raid1", etc..)

Returns Edit

health
Integer - current health of the specified unit in health points. Returns nil if the specified unit does not exist (eg. "target" given but there is no target).

Examples Edit

Print your health to the Say channel.

SendChatMessage("My health is " .. UnitHealth("player"),"SAY")

Snipped for health in your addon

local unitId = "player";
local maxHP  = UnitMaxHealth(unitId);
local curHP  = UnitHealth(unitId);

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.