WoW:API UnitHealth: Difference between revisions
Jump to navigation
Jump to search
UnitHealth -Documentation by danboo-
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<center>'''UnitHealth''' ''-Documentation by [[User:Danboo|danboo]]-''</center> | <center>'''UnitHealth''' ''-Documentation by [[User:Danboo|danboo]]-''</center> | ||
Returns the current health | Returns the current health of the specified unit, in percentage, for: | ||
*target | |||
*mouseover | |||
Otherwise in points. | |||
local health = UnitHealth(unit); | local health = UnitHealth(unit); | ||
| Line 21: | Line 26: | ||
;''Example'' | ;''Example'' | ||
local health = UnitHealth("player"); | local health = UnitHealth("player"); | ||
local health2 = UnitHealth("target"); | |||
ChatFrame1:AddMessage('player health: ' .. health); | ChatFrame1:AddMessage('player health: ' .. health); | ||
ChatFrame1:AddMessage('target health: ' .. health .. "%"); | |||
;''Result'' | ;''Result'' | ||
Prints the player's health to the chat frame as 'player health: | Prints the player's and target's health to the chat frame as | ||
'player health: 900' and 'target health: 80%'. | |||
---- | ---- | ||
;''Description'' | ;''Description'' | ||
: Returns the current health | : Returns the current health of the specified unit, in percentage, for: | ||
*target | |||
*mouseover | |||
Otherwise in points. | |||
---- | ---- | ||
{{Template:WoW API}} | {{Template:WoW API}} | ||
Revision as of 17:53, 7 December 2004
Returns the current health of the specified unit, in percentage, for:
- target
- mouseover
Otherwise in points.
local health = UnitHealth(unit);
- Arguments
- (String unit)
- arg1
- the unit's health to query
- Returns
- health
- health
- the current health of the specified unit
- Example
local health = UnitHealth("player");
local health2 = UnitHealth("target");
ChatFrame1:AddMessage('player health: ' .. health);
ChatFrame1:AddMessage('target health: ' .. health .. "%");
- Result
Prints the player's and target's health to the chat frame as 'player health: 900' and 'target health: 80%'.
- Description
- Returns the current health of the specified unit, in percentage, for:
- target
- mouseover
Otherwise in points.