Entity.GetName
From GMod Wiki
| Function | |
| Syntax | Entity:GetName( ) |
| Description: | |
| Returns the target name of an entity. NOTE: The entity's name is NOT the same as it's Class. | |
| Returns: | String |
| In Object: | Entity |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.GetName]Entity.GetName [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Finds every entity in the world and prints its name. |
|---|---|
| Used on | |
| Code | for k, v in pairs(ents.GetAll()) do print(v:GetName()) end |
| Output | Many lines of entity names. |
Additional Notes
- Don't confuse this with Player.GetName. Player.GetName returns Steam name of player, not the target name.