Gamemode.OnEntityCreated

From GMod Wiki

Revision as of 13:13, 2 October 2009 by Unrealomega (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameOnEntityCreated
SyntaxGM:OnEntityCreated( Entity entity )
DescriptionCalled right after the Entity has been made visible to Lua.
ReturnsNil
Lua StateNewerShared.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.OnEntityCreated]Gamemode.OnEntityCreated [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Example

DescriptionIgnites any prop spawned
Used onNewerServer.png
Code
function GM:OnEntityCreated( prop )
     if ( prop:GetClass() == "prop_physics" ) then --If it's a prop then...
          prop:Ignite( 60 ) --Ignite it for 60 seconds
     end
end
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox