GetEntities
Every entity in the world, or every entity of one kind.
Syntax
Section titled “Syntax”GetEntities([kind])| Parameter | Type | |
|---|---|---|
kind |
number | ENTITY_HORSE, ENTITY_ITEM, ENTITY_NPC, ENTITY_PROP or ENTITY_DOG; without it, every kind (optional) |
Returns
Section titled “Returns”table - a list of entity ids
Example
Section titled “Example”-- horses nobody controls for ten minutes are removedfor _, id in ipairs(GetEntities(ENTITY_HORSE)) do if GetEntityController(id) == nil and GetEntityIdleTime(id) > 600 then DestroyEntity(id) endendSee also
Section titled “See also”GetEntityKind · GetNearestEntity · DestroyEntity · the World entities group of the index
