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!

API UnitInParty

From Wowpedia
Jump to: navigation, search

Returns 1 if the unit is a player in your party, nil otherwise.

inParty = UnitInParty("unit")

Arguments

unit 
String - unitId who should be checked

Returns

inParty 
Boolean - if the unit is in your party

Example

if UnitInParty("target") then
    print("Your target is in your party.")
else
    print("Your target is not in your party.")
end

Details

Pets are not considered to be part of your party (but see UnitPlayerOrPetInParty).
Battleground raid/party members are also not considered to be part of your party.
UnitInParty("player") returns nil when you are not in a party.
As of 2.0.3, UnitInParty("player") always returns 1, even when you are not in a party.
UnitInParty("player") should return nil. (since patch 1.11.2, always returned 1 before)
Use GetNumPartyMembers and GetNumRaidMembers to determine if you are in a party or raid.

See also