WoW API < UnitIsUnit

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

isSame = UnitIsUnit(unit1, unit2);

Parameters[edit | edit source]

Arguments[edit | edit source]

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

Returns[edit | edit source]

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

Example[edit | edit source]

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

Result[edit | edit source]

Displays a message if your target is targetting you.

Community content is available under CC-BY-SA unless otherwise noted.