# createTrayNotification (Client)

> Shows a system notification in the Windows tray, while the game is not focused.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Output and debugging
- **URL**: https://wiki.mymp.gg/en/createTrayNotification

## Syntax

```lua
bool createTrayNotification(string text [, string icon = "default", bool sound = true])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `text` | `string` | The notification's text. |
| `icon` | `string` | `"default"`, `"info"`, `"warning"` or `"error"`. *(default: `"default"`)* |
| `sound` | `bool` | Whether the notification plays the system sound. *(default: `true`)* |

## Returns

`true` if the notification was shown. `false` if the game window is focused or another notification was shown less than 30 seconds ago.

## Example

```lua
addEvent("onRaceStart", true)
addEventHandler("onRaceStart", root, function()
    createTrayNotification("The race is starting!", "info")
end)
```

## See also

- [setClipboard (Client)](https://wiki.mymp.gg/en/setClipboard.md): Copies a text to the player's computer clipboard.
