UnitIsTappedByPlayer

From Warcraft Wiki
Jump to navigation Jump to search
Links
Info
Added in 1.0.0

Returns whether a unit is tappe by the player.

isTapped = UnitIsTappedByPlayer("unit")

Arguments

unit
String (unitId) - unit to query, e.g. "target"

Returns

isTapped
Flag - 1 if the unit is tapped by current player, nil otherwise.

Example

You can use this function in conjunction with UnitIsTapped and UnitIsTappedByAllThreatList in order to check whether the player will receive any benefit from killing the unit:

if UnitIsTapped("target") and not (UnitIsTappedByPlayer("target") or UnitIsTappedByAllThreatList("target")) then
 -- You'll get no quest credit/loot if you kill this unit
end

Patch changes