hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
93 lines (44 loc) • 1.15 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [server](./server.md) > [ChatManager](./server.chatmanager.md) > [sendPlayerMessage](./server.chatmanager.sendplayermessage.md)
## ChatManager.sendPlayerMessage() method
Send a system message to a specific player, only visible to them.
**Signature:**
```typescript
sendPlayerMessage(player: Player, message: string, color?: string): void;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
player
</td><td>
[Player](./server.player.md)
</td><td>
The player to send the message to.
</td></tr>
<tr><td>
message
</td><td>
string
</td><td>
The message to send.
</td></tr>
<tr><td>
color
</td><td>
string
</td><td>
_(Optional)_ The color of the message as a hex color code, excluding \#.
</td></tr>
</tbody></table>
**Returns:**
void
## Example
```typescript
chatManager.sendPlayerMessage(player, 'Hello, player!', 'FF00AA');
```