![]() |
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Returns the basic attributes for a unit (strength, agility, stamina, intellect).
stat, effectiveStat, posBuff, negBuff = UnitStat(unit, statID)
Arguments
- unit
- string : UnitId - Only works for
"player"and"pet". Will work on"target"as long as it is equal to"player") - statID
- number - An internal id corresponding to one of the stats.
- Strength
- Agility
- Stamina
- Intellect
- Spirit (not anymore available in 9.0.5)
Return
- stat
- number - The unit's stat. Seems to always return the same as effectiveStat, regardless of values of pos/negBuff.
- effectiveStat
- number - The unit's current stat, as displayed in the paper doll frame.
- posBuff
- number - Any positive buffs applied to the stat. Including gear.
- negBuff
- number - Any negative buffs applied to the stat.
Example
local stat, effectiveStat, posBuff, negBuff = UnitStat("player",1);
DEFAULT_CHAT_FRAME:AddMessage("Your current Strength is ".. stat);
Result
A chat message stating your current strength is displayed
