ents.FindByClass
From GMod Wiki
| Function | |
| Syntax |
ents.FindByClass( String class name ) Where is this used? |
| Description: | |
| Find entities of a specified type. | |
| Returns: | Table : Entity |
| Part of Library: | Ents |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Ents.FindByClass]Ents.FindByClass [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
| Description | This example finds all of the prop_physics in the map |
|---|---|
| Used on | |
| Code | local props = ents.FindByClass("prop_physics") |
| Output | N/A |
| Description | This example finds all of the npcs in the map |
|---|---|
| Used on | |
| Code | local npcs = ents.FindByClass("npc_*") |
| Output | N/A |
Additional Notes
- You can use wildcards in order to find all of a certain type. (IE. "npc_headcrab*" will return every type of headcrab on the map)