From Garry's Mod
Gets the unique entity index of an entity.
Entity indices are marked as unused after deletion, and can be reused by newly-created entities
The index of the entity.
-1 for clientside-only or serverside-only entities.
Demonstrates the use of this function.
print( player.GetAll():EntIndex() )