Wikia

WoWWiki

API UnitPlayerControlled

Talk1
101,385pages on
this wiki
Revision as of 16:45, December 4, 2007 by Pcj (Talk | contribs)

WoW API < UnitPlayerControlled

Return whether the "unit" is controlled by a player or an NPC.

UnitIsPlayerControlled = UnitPlayerControlled("unit")

Parameters

Arguments

("unit")
unit 
String - The UnitId to select as a target.

Returns

UnitIsPlayerControlled
UnitIsPlayerControlled 
Boolean - Returns true if the "unit" is controlled by a player.
Returns false if the "unit" is an NPC.

Example

if (UnitPlayerControlled("target")) then
  DEFAULT_CHAT_FRAME:AddMessage("Your selected target is a player.",1,1,0)
else
  DEFAULT_CHAT_FRAME:AddMessage("Your selected target is an NPC.",1,1,0)
end

Info

DEFAULT_CHAT_FRAME:AddMessage("text",r,g,b)

ScrollingMessageFrame:AddMessage("text",r,g,b,id) 
Valid Frame names:
DEFAULT_CHAT_FRAME
ChatFrame1 - ChatFrame7

Around Wikia's network

Random Wiki