Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Returns the current XP of the unit; only works on the player.
xp = UnitXP(unit)
Arguments[]
- unit
- string : UnitId
Returns[]
- xp
- number - Returns the current XP points of the unit.
Details[]
- This does not work for hunter pets, use GetPetExperience() for that.
Related Events | PLAYER_XP_UPDATE |
Related API | UnitXPMax |
Example[]
local xp = UnitXP("player")
local nextXP = UnitXPMax("player")
print(string.format("Your XP is currently at %.1f%%", xp / nextXP * 100))