FANDOM


Gets the current level values of the primary class and secondary class from a given unit.

UnitLevel(UnitId)

Parameters Edit

Arguments Edit

UnitId
string - The UnitId to query.

Returns Edit

primaryClassLevel
number - Current level of the primary class from the given unit.
Returns nil if the specified unit does not exist (eg. "target" given but there is no target).
secondaryClassLevel
number - Current level of the secondary class from the given unit.
Returns nil if the specified unit does not exist.
Returns 0 if the specified unit does not have a secondary class.

Example Edit

-- Print your main level to the Say Channel.
local mainLevel, secLevel = UnitLevel("player")
SendChatMessage("My main level is "..mainLevel..".", "SAY")

Notes Edit


Related Functions Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.