WoW API: GetNumCompanions

Revision as of 04:46, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API GetNumCompanions to API GetNumCompanions without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

WoW API < GetNumCompanions

Returns the number of companions you have. New in Patch 3.0

count = GetNumCompanions("type")

ArgumentsEdit

type
String (companionType) - Type of companions to count ("CRITTER", or "MOUNT")

ReturnsEdit

count
Number - The number of companions of a specific type.

ExampleEdit

The following snippet prints how many mini-pets the player has collected.

local count = GetNumCompanions("CRITTER");
print('Hello, I have collected a total of ' .. count .. ' pets.');