Skip to content

friends_in_party_or_raid

The friends_in_party_or_raid function retrieves the number of friendly units that are in the player's party or raid group. This function is useful for identifying and counting friendly units in the player's group.

Parameters

This function does not take any parameters.

Returns

  • count (number): The number of friendly units in the player's party or raid group.
  • valid_objects (table): A table containing the identifiers of the friendly units in the player's party or raid group.

Example Usage in Lua

Here is an example of how to use the friends_in_party_or_raid function in Lua:

local api = ...

-- Function to print the number of friendly units in the player's party or raid group
function PrintFriendsInPartyOrRaid()
    local count, valid_objects = api.friends_in_party_or_raid()
    print("Number of friends in party or raid: " .. count)
    for _, friend in ipairs(valid_objects) do
        print(friend)
    end
end

-- Example usage: Print the number of friendly units in the player's party or raid group
PrintFriendsInPartyOrRaid()