Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!
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");
- Boolean flag - 1 if otherunit is friendly to unit; nil otherwise.
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