Garry's Mod Wiki

Entity:GetName

  string Entity:GetName()

Description

Returns the map/hammer targetname of this entity.

Returns

1 string
The name of the Entity

Example

Prints the name of an entity in console.

function PrintEntityName( ent ) print( ent:GetName() ) end