Wikia

WoWWiki

Changes: API UnitRace

Edit

Back to page

m (changed {{WoW API }} to {{wowapi}})
(Sign removed)
 
Line 1: Line 1:
 
{{wowapi}}
 
{{wowapi}}
 
<center>'''UnitRace''' ''-Documentation by [[User:The_ED|The_ED]]- ''</center>
 
   
 
Returns the race (Tauren, Orc, etc) of the specified unit.
 
Returns the race (Tauren, Orc, etc) of the specified unit.

Latest revision as of 08:45, April 19, 2007

WoW API < UnitRace

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)

Around Wikia's network

Random Wiki