The env_spark entity is used for emitting the visuals and sounds of a spark, often used for implying cut electric cables, broken buttons and malfunctioning machinery.


OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.

Name targetname : Set name of env_spark so other entities can trigger it to make a spark or toggle sparks if 'Toggle' flag is used. Every trigger use-type works uniformly. Can be kill-targeted.

Pitch Yaw Roll (X Y Z) angles : Where Z means Y and Y means Z, that is, when you're thinking Hammer-grid. (Hammer uses Z for height and Y for depth, while every other sane 3D-application does this the other way round; nonetheless this keyvalue description has the letters in the conventional order) This, technically, is a 3D-vector containing Euler-angles to describe either the entity's rotation or direction of effect. E.g. a func_door_rotating will use this as its initial rotation, while a trigger_push will keep its original alignment and use this for the direction of its push-effect instead. Euler-angles are a hierarchical system to determine an object's orientation in 3D-space. A yaw-value of 0 would mean the entity would face east. (right in top-down view) 90 would mean it would face north. (up in top-down-view) After yaw, pitch is applied. Think aiming up/down with your character in first person. At last, the roll-value is applied. Think your character falling over sideways in first person. Some entities, mostly point entities, do not use the angles keyvalue for any purpose.

Max Delay MaxDelay : Set the maximum delay, in seconds, between sparks, when the 'Toggle'-flag is set. Otherwise, this is redundant.


  • 32 : Toggle : Instead of emitting one spark whenever it is fired, the env_spark will automatically emit multiple sparks consecutively, with a delay between them, while activated.

  • 64 : Start ON : If set, the env_spark entity will start enabled. Makes sense only in combination with the 'Toggle'-flag above.