Returns whether one unit can attack another


See also Unit functions.

Signature:

canAttack = UnitCanAttack("unit", "unit")

Arguments:

  • unit - A unit (string, unitID)
  • unit - Another unit (string, unitID)

Returns:

  • canAttack - 1 if the first unit can attack the second unit; otherwise nil (1nil)