Ad blocker interference detected!
Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers
Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.
→ WoW API
Return whether the "unit" is controlled by a player or an NPC.
UnitIsPlayerControlled = UnitPlayerControlled("unit")
- String - The UnitId to select as a target. Using a unit's name as the unit ID only works if the unit is a member of your party.
- Boolean - Returns true if the "unit" is controlled by a player.
Returns false if the "unit" is an NPC.
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
- Valid Frame names:
ChatFrame1 - ChatFrame7