local num = 0 for i, unit in GetDefenderCreatures() do if GetCreatureType(unit) == id then num = num + GetCreatureNumber(unit) end end