Flickering19966@legacy41540688 (talk | contribs) m (Fixed result.) |
Muert39620@legacy41559547 (talk | contribs) No edit summary |
||
Line 29: | Line 29: | ||
== Details == |
== Details == |
||
: UnitName("player") (or any other unit) will return "Unknown Entity" (Actually the value of the UNKNOWNOBJECT global) if called before the unit in question has been fully loaded into the world. |
: UnitName("player") (or any other unit) will return "Unknown Entity" (Actually the value of the UNKNOWNOBJECT global) if called before the unit in question has been fully loaded into the world. |
||
+ | |||
---- |
---- |
||
⚫ | |||
− | __NOTOC__ |
||
⚫ | |||
− | [[Category:API Unit Functions|UnitName]] |
Revision as of 05:35, 4 January 2006
Synopsis
Returns the name of the specified unit.
name = UnitName("unit")
Arguments
- ("unit")
- unit
- String - The UnitId to query (e.g. "player", "party2", "pet", "target" etc.)
Returns
- name
- name
- String - The name of the specified unit.
Example
local playerName = UnitName("player"); ChatFrame1:AddMessage('Hi my name is: ' .. playerName);
Result
- Prints the player's name to the chat frame. e.g.
Hi my name is: Octon
Details
- UnitName("player") (or any other unit) will return "Unknown Entity" (Actually the value of the UNKNOWNOBJECT global) if called before the unit in question has been fully loaded into the world.
Template:WoW API