WoW API < UnitCanAssist

Indicates whether the first unit can assist the second unit.

canAssist = UnitCanAssist(unitToAssist, unitToBeAssisted);

Parameters[edit | edit source]

Arguments[edit | edit source]

UnitId - the unit that would assist (e.g., "player" or "target")
UnitId - the unit that would be assisted (e.g., "player" or "target")

Returns[edit | edit source]

Bool - 1 if the unitToAssist can assist the unitToBeAssisted, nil otherwise.

Example[edit | edit source]

  if (UnitCanAssist("player", "target")) then 
     DEFAULT_CHAT_FRAME:AddMessage("You can assist the target.")
     DEFAULT_CHAT_FRAME:AddMessage("You cannot assist the target.")

Result[edit | edit source]

A message indicating whether the player can assist the current target is displayed in the default chat frame.

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