FANDOM


Determines if a unit can be attacked by another unit

canAttack = UnitCanAttack(attacker, attackTarget);

Parameters Edit

Arguments Edit

attacker
UnitId - the unit who is attacking
attackTarget
UnitId - the unit who will possibly be attacked

Returns Edit

canAttack
Boolean value. true if attack is possible, false otherwise


Example Edit

if ( UnitCanAttack("player", "target") ) then
  SendChatMessage("Start running " .. UnitName("target") .. " 'cause you're about to DIE!", "SAY" );
end

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.