Garry's Mod Wiki

Revision Difference

Entity:EntIndex#515711

<function name="EntIndex" parent="Entity" type="classfunc">⤶ <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</note>⤶ </description>⤶ <realm>Shared</realm>⤶ <rets>⤶ <ret name="" type="number">The index of the entity.&amp;lt;br /&amp;gt;⤶ &amp;lt;br /&amp;gt;-1 for clientside-only or serverside-only entities.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Demonstrates the use of this function.</description>⤶ <code>print( player.GetAll()[1]:EntIndex() )</code>⤶ <output>1</output>⤶ ⤶ </example>