Skip to content

CountEntities

How many entities of a class the level holds.

CountEntities(cls)
Parameter Type
cls string an entity class name ("NPC", "Horse", "AnimDoor", "Stash" …)

number - 0 when none or the class is unknown

print("doors: " .. CountEntities("AnimDoor"))

GetEntityCensus · the The player, the level and the frame group of the index