Skip to main content

sendMessageTo

Sends a message to a specific player in the server.

This method can be used to send private messages or group messages to specific players or groups. The player must be specified using their unique ID or player manager.

Syntax

engine.chat.sendMessageTo(player, message);

Parameters

NameTypeDescription
playerOrPlayerIdPlayerManager or numberThe player manager or player id
messagestringThe message to be send the player

Example

// using a player manager
engine.chat.sendMessageTo(player, 'Welcome to the {green}Server');

// using the player id
engine.chat.sendMessageTo(1, 'Welcome to the {green}Server');

Available on: Server