> 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/untitled.md).

# Creating the /mutechat command

In this step, we'll write the command for the mute chat script.

To begin, we must create the command to mute the chat. This command can be anything you want, but for this tutorial, we'll use /mutechat.

```
/customizer >> commands >> new command
```

When you've finished creating the command, we'll check to see if it's a staff member or a regular player. We'll use the "Has Permission" element for this.

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_o7TOdfCazmsFHBnCd%2F-M_o8OFk1rLbwkZa4X1S%2Fimage.png?alt=media\&token=94a2ec5b-3542-4230-9ac2-dde7db1945ff)

{% hint style="info" %}
Permission can be anything you want it to be! I've decided on the name "mutechat.admin."
{% endhint %}

We must now set up the true and false statements. To make things easier, I've separated the true and false statements into separate tabs.

{% tabs %}
{% tab title="True" %}
When he has the permission, we will allow him to lock the chat. To accomplish this, we'll use the "Store Variable (String)" element to save a variable.

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_o7TOdfCazmsFHBnCd%2F-M_o9y-eoGnKa_lHi3BX%2Fimage.png?alt=media\&token=04641017-d2a1-447f-87ed-844a327d4204)

{% hint style="info" %}
As the variable name, I've used "mutechat-status." The value of "mutechat-status" is "ON."&#x20;
{% endhint %}

{% hint style="warning" %}
You can select different values, but you must remember them because they are required by the mute-chat script.
{% endhint %}

Once we've created the save variable, we'll send a message indicating that the chat is locked to the person in question. The message can be whatever you want it to be.

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_o7TOdfCazmsFHBnCd%2F-M_oAnlDfmmLXPdg1ZwU%2Fimage.png?alt=media\&token=8814afcc-0748-4815-8246-ceb2f29cb1cc)

Following that, we will send a message to all of the players on the server.

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_o7TOdfCazmsFHBnCd%2F-M_oBCyjuk9IVftfXE4k%2Fimage.png?alt=media\&token=6cea0e94-3e4c-4b15-a1ab-22d0bb20b70a)

We want to make it so that people with the bypass permission get a message saying that the chat has been muted by... but also that you have the bypass permission and can still talk. We will take the following steps to accomplish this.

1. Get Player Name (From the command sender)
2. Send Player Message (To every player)&#x20;
3. Has Permission

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_o7TOdfCazmsFHBnCd%2F-M_oVBPdOiFoiEOx41Gl%2Fimage.png?alt=media\&token=9d1ba167-732c-48c4-bf7a-d8bcaa7ffbdb)

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_o7TOdfCazmsFHBnCd%2F-M_oVGEuX5fSFepauwqM%2Fimage.png?alt=media\&token=4a04b771-a543-4833-8d86-aa2ac7301e78)

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_o7TOdfCazmsFHBnCd%2F-M_oVfja1rVl2HUUpN4v%2Fimage.png?alt=media\&token=dc330ec7-ee02-4fe2-aebd-fb6930bba435)

| True                                                                                                                                        | False                               |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| <p>Using the "Send Player Message" element,<br>we will send a message to the people<br>who have that permission (Screenshot down below)</p> | In the false statement, do nothing. |

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_o7TOdfCazmsFHBnCd%2F-M_oXkyGy5yra7ga5afB%2Fimage.png?alt=media\&token=c781ed3e-8f9d-453f-9833-eaf9164e1833)

{% hint style="info" %}
After sending the "Chat has been muted" message, you could add a sound notification using play sound.
{% endhint %}
{% endtab %}

{% tab title="False" %}
When the player has no permission to mute the chat we want him to send a message that he has no permission using the "Send Player Message" element.<br>

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-M_ofiMaSbUNcgc9FuZ6%2F-M_ogh8XTPkt6Kze8EZU%2Fimage.png?alt=media\&token=6655f237-22d7-4481-bf0e-e5c40ff95250)
{% endtab %}
{% endtabs %}

After you've completed both the True and False statements, you can move on to creating the /unmute command.

{% content-ref url="/pages/-M\_ojrDI\_sehom4GVA7L" %}
[Creating the /unmutechat command](/creating-a-mute-chat-script/creating-the-unmutechat-command.md)
{% endcontent-ref %}
