WoW:API UnitHealth: Difference between revisions

no edit summary
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, in points, of the specified unit.
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: 90'.
  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, in points, of the specified unit.
: Returns the current health of the specified unit, in percentage, for:
 
*target
*mouseover
 
Otherwise in points.


----
----
{{Template:WoW API}}
{{Template:WoW API}}
Anonymous user