Wikia

WoWWiki

Watchlist Recent changes

API UnitIsFriend

Main Menue



This function will determine whether two units are friendly to each other (i.e. able to help each other in combat).

isFriend = UnitIsFriend("unit","otherunit");

Arguments Edit

unit
String - A valid unit.
otherunit
String - A valid unit.

Returns Edit

IsFriend
Boolean flag - 1 if otherunit is friendly to unit; nil otherwise.

Example Edit

The following snippet outputs a message when the player has a hostile target.

if UnitExists("target") and not UnitIsFriend("player", "target") then
 print(UnitName("target") .. " is evil! Run!");
end

Pages on WoWWiki

94,213pages on
this wiki
Advertisement | Your ad here

Latest Photos

Add a Photo
55,641photos on this wiki
See more >

Recent Wiki Activity

See more >

Recent Questions

Around Wikia's network

Random Wiki