Entity/EntIndex

From Garry's Mod
Jump to: navigation, search
 Entity:EntIndex( )

Contents

Description

Gets the unique entity index of an entity.

NOTE

Entity indices are marked as unused after deletion, and can be reused by newly-created entities

Returns

number

The index of the entity.


-1 for clientside-only or serverside-only entities.

Examples

Example

Demonstrates the use of this function.

print( player.GetAll()[1]:EntIndex() )

Output:

1
Personal tools
Navigation