m
Move page script moved page API UnitHealthMax to WoW:API UnitHealthMax without leaving a redirect
(Clarified when a percentage is returned and when real health points are returned) |
m (Move page script moved page API UnitHealthMax to WoW:API UnitHealthMax without leaving a redirect) |
||
| (8 intermediate revisions by 8 users not shown) | |||
| Line 1: | Line 1: | ||
{{wowapi}} __NOTOC__ | |||
Returns the maximum health of the specified unit. | |||
Returns the | |||
local max_health = UnitHealthMax(unit); | local max_health = UnitHealthMax(unit); | ||
==Parameters== | |||
; | :;unit : [[UnitId]] - the unit whose max health to query. | ||
: | ==Returns== | ||
:;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) | |||
==Example== | |||
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"); | |||