Wikia

WoWWiki

Watchlist Recent changes

API UnitHealthMax

Main Menue



Returns the maximum health of the specified unit.

local max_health = UnitHealthMax(unit);

ParametersEdit

unit 
UnitId - the unit whose max health to query.

ReturnsEdit

max_health 
Integer - the maximum health of the specified unit, returns 0 if the specified unit does not exist (eg. "target" given but there is no target)

ExampleEdit

Print the maximum health of player and target units to the chat window:

ChatFrame1:AddMessage('Player max health: ' .. UnitHealthMax("player") .. " HP");
ChatFrame1:AddMessage('Target max health: ' .. UnitHealthMax("target") .. " HP");

Pages on WoWWiki

94,195pages on
this wiki
Advertisement | Your ad here

Latest Photos

Add a Photo
55,627photos on this wiki
See more >

Recent Wiki Activity

See more >

Recent Questions

Around Wikia's network

Random Wiki