Garry's Mod Wiki

ents.FindByModel

  table ents.FindByModel( string model )

Description

Gets all entities with the given model, supports wildcards.

This works internally by iterating over ents.GetAll.

Arguments

1 string model
The model of the entities to find.

Returns

1 table
A table of all found entities.

Example

Print all entities with a female citizen model.

for k, v in ipairs(ents.FindByModel("models/player/Group01/female_*")) do print(v) end
Output:
1 = Player [1][Luiggi33] 2 = Entity [90][prop_ragdoll]