Entity.Spawn

From GMod Wiki

Revision as of 17:15, 24 October 2010 by Cube334 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax Entity:Spawn( )
Description:
Spawns an entity that has not been spawned yet. This is usually the last command used when creating entities. Commands run between ents.Create and Entity:Spawn are usually used to prepare the entity to be spawned. Spawn will make the entity enter the world so to speak.
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.Spawn]Entity.Spawn [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreate a barrel.
Used onNewerServer.png
Code
barrel=ents.Create("prop_physics")
barrel:SetModel("models/props_c17/oildrum001.mdl")
barrel:SetPos(Vector(0,0,0))
barrel:Spawn()
OutputA barrel is created at 0,0,0


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox