API UnitRace

From Wowpedia
Jump to: navigation, search

Returns the race of the specified unit.

raceName, raceFile, raceID = UnitRace("unit");

Arguments

unit 
String - unit to query, e.g. "player"

Returns

raceName
String - Localized race name, suitable for use in user interfaces.
raceFile
String - Localization-independent race name, suitable for use as table keys.
raceID 
Number - Numeric localization-independent raceID.

Example

The following command prints your character's name and race to chat:

/run print(UnitName("player").." is a "..UnitRace("player"))

Patch changes

See also