WoW:API UnitClass

From AddOn Studio
Revision as of 03:39, 12 December 2004 by WoWWiki>WoWWiki-Octon (Returns the class (Mage, Warrior, etc) of the specified unit.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
UnitClass -Documentation by octon-

Returns the class (Mage, Warrior, etc) of the specified unit.


Arguments
(String unit)
arg1
The unit to query (e.g. "player")

Returns
class
class
The class of the specified unit as a string. e.g. Mage, Warrior, etc.

Example
local playerClass = UnitClass("player");
ChatFrame1:AddMessage('Your player is a : ' .. playerClass);
Result
Prints the player's class to the chat frame as

'Your player is a : Warrior'.  (Or whichever class the specified unit is)

Description
Returns the class (Mage, Warrior, etc) of the specified unit.

Template:WoW API