> 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/text-message-replacement/creating-the-script.md).

# Creating the script

Here we are going to create are base for our script

## What script are we going to use?

For this script to work we are going to create a script for "Player Chat Message" I am going to name it: "Replace \[item]" to keep our Ultra Customizer system clean.

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-MbKiOux6aduNBuFsI9V%2F-MbKnK49IBs8l_Po2YAe%2Fimage.png?alt=media\&token=19f6f5b6-3c03-42ca-b8be-a022f2924ec2)

First we are going to get the item in his Main Hand.

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-MbKiOux6aduNBuFsI9V%2F-MbKnxvE7k5RFiuastej%2Fimage.png?alt=media\&token=d1d28587-dc59-404c-8f4d-79e83863b3a9)

Now we need to convert our item to a string so we can use it in our chat.

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-MbKiOux6aduNBuFsI9V%2F-MbKo939EKRKedI8rdqF%2Fimage.png?alt=media\&token=a7c8e2c9-1328-42ef-ba34-9e0d5b86b44b)

{% hint style="danger" %}
The next part is very important and needs to be followed closely
{% endhint %}

Now we are going to add a "Replace String (Ignore Case)"\
Our first input will be "Player Chat Message"\
The second input will be "\[item]"\
And our third input will be "Item To String"

![](https://861805133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_kvS90LCrvnHsAPzTE%2F-MbKiOux6aduNBuFsI9V%2F-MbKp3T2oiBa_plrX_AJ%2Fimage.png?alt=media\&token=52eb41e1-c769-41ca-8b1e-8917f3c2b2e1)

{% hint style="success" %}
Now we are done! When we type \[item] alone or in a sentience it will be replaced with the item in your hand. (If you have nothing in your hand you will get "AIR")
{% endhint %}
