Fandom

WoWWiki

API UnitCanAssist

104,632pages on
this wiki
Add New Page
Talk0 Share

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.

WoW API < UnitCanAssist

Indicates whether the first unit can assist the second unit.

canAssist = UnitCanAssist(unitToAssist, unitToBeAssisted);

ParametersEdit

ArgumentsEdit

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

ReturnsEdit

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

ExampleEdit

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

ResultEdit

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

Also on Fandom

Random Wiki