Garry's Mod Wiki

Revision Difference

CEffectData:SetFlags#545924

<function name="SetFlags" parent="CEffectData" type="classfunc"> <description> Sets the flags of the effect. Can be used to change the appearance of a MuzzleFlash effect⤶ ## Example values for MuzzleFlash effect Sets the flags of the effect. Can be used to change the appearance of a MuzzleFlash effect.⤶ ⤶ ## Example values for MuzzleFlash effect Flags | Description | ------|--------------| 1 | Regular muzzleflash| 5 | Combine muzzleflash| 7 | Regular muzzle but bigger| ⤶ ⤶ <note>Internally stored as an integer, but only first 8 bits are networked, effectively limiting this function to 0-255 range.</note>⤶ ⤶ <note>Internally stored as an integer, but only first 8 bits are networked, effectively limiting this function to `0-255` range.</note>⤶ </description> <realm>Shared</realm> <args> <arg name="flags" type="number">The flags of the effect. Each effect has their own flags.</arg> </args> </function> <example> ⤶ <code>⤶ <code>⤶ local ef = EffectData() ef:SetEntity(self) ef:SetAttachment(1) //self:LookupAttachment("muzzle") ef:SetFlags(5) //Sets the Combine AR2 Muzzle flash util.Effect("MuzzleFlash", ef) </code> ef:SetEntity( self ) ef:SetAttachment( 1 ) -- self:LookupAttachment( "muzzle" ) ef:SetFlags( 5 ) -- Sets the Combine AR2 Muzzle flash util.Effect( "MuzzleFlash", ef ) </code> </example>