Wowpedia

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

READ MORE

Wowpedia
m (Robot: converting/fixing HTML)
No edit summary
Line 4: Line 4:
 
UnitIsPlayer(UnitId)
 
UnitIsPlayer(UnitId)
   
  +
Determines if the unit is a player. It is important to note that it returns nil rather than false, nil is treated like false for most operations but it is *not* a proper boolean.
Determines if the unit is a player.
 
 
----
 
----
 
;''Arguments''
 
;''Arguments''
Line 13: Line 13:
 
;''Returns''
 
;''Returns''
   
:''True/False''
+
:''True/nil''
   
 
----
 
----

Revision as of 16:58, 9 January 2008

UnitIsPlayer(UnitId)

Determines if the unit is a player. It is important to note that it returns nil rather than false, nil is treated like false for most operations but it is *not* a proper boolean.


Arguments
UnitId

Returns
True/nil

Example
if (UnitIsPlayer(UnitId)) then
   --Do something here
elseif (UnitIsPlayer(UnitId) ~= nil) then
   --Do something here
end