Garry's Mod Wiki

Entity:SetSpawnEffect

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.

Special Pages


Wikis

?

Render Time: 59ms

DB GetPage 41
Generate Html 3
SaveChanges (1) 6
Render Body 0
Render Sidebar 7