# Custom Scripts

<figure><img src="https://77164042-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUZeEhX4mYsDsoTCSjRyi%2Fuploads%2Fgit-blob-e449e1ca5b11224746ff79c678fbc2a6941e65d9%2Fcolor_model_custom-lua.png?alt=media" alt=""><figcaption><p>Custom Mixer Scripts</p></figcaption></figure>

Custom (Mixes) Scripts take one or more values as inputs, do some processing in Lua code, and output one or more values. Each model can have several Mixes Scripts associated with it, and these scripts are run periodically. They behave similarly to standard EdgeTX mixers, but at the same time they provide a much more flexible and powerful tool.

Typical use cases:

* replacement for complex mixes that are *not critical* to model function
* complex processing of inputs and reaction to their current state and/or their history
* filtering of telemetry values

{% hint style="warning" %}
If the script output is used as a `mixer source` , and the **script is killed** for whatever reason, then *the* **whole mixer line is disabled**! Exercise caution when using them for primary controls. It is advisable to have a fallback mixer line, that will be used if for whatever reason the Mixer Script is terminated.
{% endhint %}

<figure><img src="https://77164042-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUZeEhX4mYsDsoTCSjRyi%2Fuploads%2Fgit-blob-8065f0bfb7f7791b16fba86f31194fba438dc4b9%2Fcolor_model_custom-lua_edit.png?alt=media" alt=""><figcaption><p>Inputs and Outputs for Mixer Scripts</p></figcaption></figure>

Here is an example of mixer script that accepts a source and constant value, and has two outputs that will be selectable in the mixer as sources.
