util.Effect

From Garry's Mod
Revision as of 16:06, 18 May 2016 by Bo98 (Talk | contribs)
Jump to: navigation, search
 util.Effect( )

Contents

Description

Creates a effect with the specified data. You can find a list of effects 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.

NOTE

Lua effects with same name as one of the engine effects will override the engine effect unless you set the allowOverride parameter to false.

Arguments

string effectName

The name of the effect to create.

Arguments

CEffectData effectData

The effect data describing the effect.

Arguments

boolean allowOverride=true

If this is an engine-defined effect, this controls whether or not we can be overridden by Lua defined scripted effects with the same name.

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