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.
Garry's Mod
Rust
Steamworks
Wiki Help