PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

WhisperChat

Thisfunction delivers the given message to a recipient without anyone else seeing. Since this item is protected, attempting to use it in aScriptorLocalScript` will cause an error.

This function is used internally when the Players/LocalPlayer sends whispers another player.

If you would like to create a custom chat system where you can define custom functions such as these, take a look at the tutorial here.

Parameters

Name Type Default Description

The message being chatted.

The recipient Player.

Returns

Return Type Summary

No return.


Code Samples


Sending Whisper Chat

This example demonstrates that the Players/WhisperChat function executes without error if using the Command Bar or a Plugin and errors if executed in a LocalScript.

When executing the function, you must provide the message and the recipient’s Player instance. The code sends a whisper message from the Players/LocalPlayer to the recipient.

-- Command bar
game.Players:WhisperChat("Hello World", recipient) -- Sends a "Hello World" message to the recipient player

-- LocalScript
local player = game.Players:WhisperChat("Hello World", recipient) -- Errors