Garry's Mod Wiki

util.Effect

util.Effect( string effectName, CEffectData effectData, boolean allowOverride = true, any ignorePredictionOrRecipientFilter = nil )

Description

Creates an effect with the specified data.

You can find a list of built-in engine effects here. You can create your own. Example effects can be found here and here.

When dispatching an effect from the server, some values may be clamped for networking optimizations. Visit the Set accessors on CEffectData to see which ones are affected.
You will need to couple this function with IsFirstTimePredicted if you want to use it in predicted hook.

Arguments

1 string effectName
The name of the effect to create.
2 CEffectData effectData
The effect data describing the effect.
3 boolean allowOverride = true
Whether Lua-defined effects should override engine-defined effects with the same name for this/single function call.
4 any ignorePredictionOrRecipientFilter = nil
Can either be a boolean to ignore the prediction filter or a CRecipientFilter.

Set this to true if you wish to call this function in multiplayer from server.

Example

Creates a HelicopterMegaBomb effect at the origin of the map. ( 0, 0, 0 )

local vPoint = Vector( 0, 0, 0 ) local effectdata = EffectData() effectdata:SetOrigin( vPoint ) util.Effect( "HelicopterMegaBomb", effectdata )

Page Links


Special Pages


Wikis

?

Render Time: 52ms

DB GetPage 4
Generate Html 13
SaveChanges (1) 20
Render Body 0
Render Sidebar 12