> For the complete documentation index, see [llms.txt](https://guides.ultracustomizer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.ultracustomizer.com/creating-a-mute-chat-script/creating-the-script.md).

# Creating the script

In this step, we will write the script for the mute chat script.

First, we must write our script. For this script, we will use the "Player Chat Message" script.

```
/customizer >> Scripts >> Add >> Player Chat Message
```

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_ohJ7QGurIoNFEUACR%2F-M_ohp0b8VLinyH0NcCm%2Fimage.png?alt=media\&token=c0a0db5a-7b3f-4583-b720-64d4b1615a9a)

{% hint style="info" %}
The script's name can be whatever you want it to be. I used "mute-script" for this guide.
{% endhint %}

Once we have the script, we will use the "Get Variable (String)" and "Compare String" elements to see if the mute-command has been used and the script is on.

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_ohJ7QGurIoNFEUACR%2F-M_ongo4q2_2mS1UmsgJ%2Fimage.png?alt=media\&token=94813e33-4e4a-415b-a225-1f8bdc2fc159)

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_ohJ7QGurIoNFEUACR%2F-M_onoLiok-rt9EGmoye%2Fimage.png?alt=media\&token=2be2863b-337a-4cd0-a60f-7785cc37ae12)

{% hint style="danger" %}
We will **not** write a compare script for "off" because if it is off.\
This script will do nothing if the value is not "on."
{% endhint %}

We'll add the "If Else Statement" element after you've added the "Compare String" element.

{% tabs %}
{% tab title="True" %}
When the mute-script is enabled, we will add the element "Block Vanilla Behaviour," which will prevent the message from being sent.

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_ohJ7QGurIoNFEUACR%2F-M_opjDyY4jiuo4ftVky%2Fimage.png?alt=media\&token=34d47720-a624-44aa-a80b-7cfdb562b568)

Once we've blocked the message, we'd like to notify the player that the chat has been locked. This is possible with the "Player Message" element.

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_ohJ7QGurIoNFEUACR%2F-M_oqDN1It8eXtDc5SL4%2Fimage.png?alt=media\&token=150d7a6a-a8a3-4120-b91a-b9e4fb791df6)
{% endtab %}

{% tab title="False" %}
When the value is false we are going to return nothing (Put no elements in place)
{% endtab %}
{% endtabs %}

{% hint style="success" %}
When you've finished writing the script, it's time to put it to use.
{% endhint %}
