Entity.Activate

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:Activate( )
Description:
Activates the entity. This needs to be used on some entities (like constraints) after being spawned.
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.Activate]Entity.Activate [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSpawns a SENT and activates it and all.
Used onNewerServer.png
Code
function ENT:SpawnFunction( ply, tr )
    if ( !tr.Hit ) then return end
     local SpawnPos = tr.HitPos + tr.HitNormal * 16
     local ent = ents.Create( "sent_ball" )
    ent:SetPos( SpawnPos ) 
    ent:Spawn()
    ent:Activate()
end
OutputSpawns sent_ball at the position the player is looking at.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox