Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
mNo edit summary
No edit summary
Line 28: Line 28:
 
'Your player is a : Tauren'. (Or whichever race the specified unit is)
 
'Your player is a : Tauren'. (Or whichever race the specified unit is)
   
  +
----
[[Category:API Functions|UnitRace]]
 
  +
{{WoW API}}
[[Category:API Unit Functions|UnitRace]]
 

Revision as of 05:36, 4 January 2006

UnitRace -Documentation by The_ED-

Returns the race (Tauren, Orc, etc) of the specified unit.

race, raceEn = UnitRace("unit");

Arguments
("unit")
unit
String - The UnitId to get information from.

Returns


race
The localized race of the specified unit as a string. e.g. Tauren, Orc etc.
raceEn
The race in english as a string. e.g Tauren, Orc etc.
(Note for undead: race returns "Undead" but raceEn returns "Scourge")

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

'Your player is a : Tauren'.  (Or whichever race the specified unit is)

Template:WoW API