Garry's Mod Wiki


  number ents.GetCount( boolean IncludeKillMe = false )


Gives you the amount of currently existing entities.

Similar to #ents.GetAll() but with better performance since the entity table doesn't have to be generated. If ents.GetAll is already being called for iteration, than using the # operator on the table will be faster than calling this function since it is JITted.


1 boolean IncludeKillMe = false
Include entities with the FL_KILLME flag. This will skip an internal loop, and the function will be more efficient as a byproduct.


1 number
Number of entities