Entity.SetName

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:SetName( String targetname )
Description:
Sets the target name of an entity. NOTE: The entity's name is NOT the same as it's Class.
Returns: nil
In Object: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.SetName]Entity.SetName [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionNames every prop_physics 'Carl'.
Used onNewerServer.png
Code
 
for k,v in pairs( ents.FindByClass("prop_physics")) do
   v:SetName("Carl")
end
OutputNames every prop_physics 'Carl' .


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox