util.Effect

From Garry's Mod
Jump to: navigation, search
 util.Effect( )

Contents

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.

NOTE

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.

NOTE

You will need to couple this function with IsFirstTimePredicted should you use this in a predicted hook.

Arguments

string effectName

The name of the effect to create.

Arguments

CEffectData effectData

The effect data describing the effect.

Arguments

boolean allowOverride=true

Whether Lua-defined effects should override engine-defined effects with the same name for this/single function call.

Arguments

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.

Examples

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 )


Personal tools
Navigation