WoW:API UnitCanAssist: Difference between revisions
Jump to navigation
Jump to search
(New material) |
m (→Example) |
||
Line 12: | Line 12: | ||
==Example== | ==Example== | ||
if (UnitCanAssist("player", "target")) then | if (UnitCanAssist("player", "target")) then | ||
DEFAULT_CHAT_FRAME:AddMessage("You can assist the target.") | DEFAULT_CHAT_FRAME:AddMessage("You can assist the target.") |
Revision as of 18:17, 7 December 2007
← WoW API < UnitCanAssist
Indicates whether the first unit can assist the second unit.
canAssist = UnitCanAttack(unitToAssist, unitToBeAssisted);
Parameters
Arguments
Returns
- canAssist
- Bool - 1 if the unitToAssist can assist the unitToBeAssisted, nil otherwise.
Example
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
Result
A message indicating whether the player can assist the current target is displayed in the default chat frame.