Garry's Mod Wiki

ents.GetEdictCount

  number ents.GetEdictCount()

Description

Returns the amount of networked entities, which is limited to 8192.

ents.Create will fail somewhere between 8064 and 8176 - this can vary based on the amount of player slots on the server and other entities.

See also MAX_EDICT_BITS global variable.

Returns

1 number
Number of networked entities.