Garry's Mod Wiki

Entity:SetSpawnEffect

  Entity:SetSpawnEffect( boolean spawnEffect )

Description

Sets whether the entity should use a spawn effect when it is created on the client.

See Entity:GetSpawnEffect for more information on how the effect is applied.

This function will only have an effect when the entity spawns. After that it will do nothing even is set to true.

Arguments

1 boolean spawnEffect
Sets if we should show a spawn effect.

Example

Simplified code taken from sandbox's commands.lua

local function MakeRagdoll( Player, Pos, Ang, Model, PhysicsObjects, Data ) local Ent = ents.Create( "prop_ragdoll" ) duplicator.DoGeneric( Ent, Data ) Ent:Spawn() duplicator.DoGenericPhysics( Ent, Player, Data ) Ent:Activate() Ent:SetSpawnEffect( true ) return Ent end
Output: Spawns the ragdoll and then sets the spawnEffect flag to true.