Entity.SetEntity

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:SetEntity( String key, Entity entity )
Description:
Sets a key value to point to a specific entity instead of a targetname.
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.SetEntity]Entity.SetEntity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSet the target of a rope to a specific entity, instead of using SetKeyValue.
Used onNewerServer.png
Code
 
rope:SetEntity("endentity", ents.FindByClass("keyframe_rope")[1])
 
OutputSets the rope's end point to the first keyframe_rope entity in the server.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox