Entity.AddEffects
From GMod Wiki
Function | |
Syntax | Entity:AddEffects( Enum effect ) |
Description: | |
Gives an entity the given engine-based effect(s). | |
Returns: | nil |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.AddEffects]Entity.AddEffects [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Adds a blinking effect to an entity. |
---|---|
Used on | |
Code | Entity:AddEffects( EF_ITEM_BLINK ); |
Output | N/A |
Description | Adds a blinking effect and a bright light effect. |
---|---|
Used on | |
Code | Entity:AddEffects( EF_ITEM_BLINK | EF_BRIGHTLIGHT ); |
Output | N/A |
Additional Notes
- These effects are different from Scripted Effects. These effects specifically modify entities. For instance, applying the EF_BONEMERGE effect to an entity causes that entity's bones to merge (move to the same position/angles as) that entity's parent. The Bone Merge effect is used by the Source Engine on Weapons to make a player or NPC hold them correctly. This works because weapon world models contain an invisible right-hand bone that then merges with the right-hand bone of the Player/NPC holding the weapon.
- Beware! Once these effects are added to an entity they are often permanent. You will have to remove the entity to get rid of them.
See Also
- Entity:RemoveEffects
- Entity:IsEffectActive
- Effect flags can be seen here: Effect Flags