Fandom

WoWWiki

API UnitIsUnit

104,828pages on
this wiki
Add New Page
Talk0 Share
WoW API < UnitIsUnit

Returns true if the two specified units are the same, false otherwise.

isSame = UnitIsUnit(unit1, unit2);

ParametersEdit

ArgumentsEdit

unit1 
UnitId - The first unit to query (e.g. "party1", "pet", "player")
unit2 
UnitId - The second unit to compare it to (e.g. "target")

ReturnsEdit

isSame 
Boolean - 1 if the two units are the same entity, nil otherwise.

ExampleEdit

if ( UnitIsUnit("targettarget", "player") ) then
 message("Look at me, I have aggro from " .. UnitName("target") .. "!");
end;

ResultEdit

Displays a message if your target is targetting you.

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.