Garry's Mod Wiki

Garry's Mod Wiki

  Entity:Spawn()

Description

Initializes the entity and starts its networking. If called on a player, it will respawn them.

This calls ENTITY:Initialize on Lua-defined entities.

Example

Server sided script for spawning entities

local ent = ents.Create("Enter Entity Class") -- Sets the position of the entity ent:SetPos(Vector(0.0, 100, 0.0)) -- Sets the angle of the entity ent:SetAngles(Angle(0.0, 90.0, 0.0)) -- Spawns the entity on all clients ent:Spawn()
Output: Spawns entity on position(0.0, 100.0, 0.0) facing (0.0, 90.0, 0.0) for all clients connects to the server

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...