• How to use util.Effect()
    3 replies, posted
The util.Effect() wiki page isn't very clear on the use of it, so I basically just used the example given on the wiki, but it does not work. Is there something else necessary in this that I am missing out on? Just to be more clear, I'm doing this inside of a SWEP, and this effect is sometimes created when shot. [CODE] local effectdata = EffectData() effectdata:SetOrigin( Vector( 1, 1, 1 )) util.Effect( "TeslaZap", effectdata )[/CODE]
You need to configure the EffectData and when to run the effect. For example, the effect gets played here when you hit an entity: [code]function ENT:PhysicsCollide( data ) if IsValid(data.HitEntity) then local effect = EffectData() effect:SetOrigin( data.HitPos ) effect:SetNormal( data.HitNormal ) effect:SetStart( data.HitPos ) effect:SetEntity( ent ) effect:SetMagnitude( 2 ) util.Effect( "TeslaHitBoxes", effect, true, true ) end end[/code]
Is there a place that I can find all of the effect data arguments?
[QUOTE=GModKitty;47674603]Is there a place that I can find all of the effect data arguments?[/QUOTE] [URL="http://wiki.garrysmod.com/page/Category:CEffectData"]http://wiki.garrysmod.com/page/Category:CEffectData[/URL]
Sorry, you need to Log In to post a reply to this thread.