WoW API: UnitHealth

From AddOn Studio
Jump to navigation Jump to search

WoW API < UnitHealth

Returns the current health of the specified unit. Returns the exact hitpoints for friendly players and pets in your raid/party, percentages otherwise.

local health = UnitHealth(unit);

Parameters

Arguments

unit
UnitId - the unit's health to query

Returns

health
Integer - current health of the specified unit.

Example

UnitHealth("target"); -- Note: we're assuming the target isn't a friendly player/pet in our group.

Result

Prints the player's and target's health to the chat frame.