Skip to content

Send

Allows you to send a message to a specific target.

function light.send

Client Synchronous
1
2
3
4
function send<T>(
    message: Message<T>,
    data: T
): ()
Server Synchronous
1
2
3
4
5
function send<T>(
    message: Message<T>,
    to: Player,
    data: T
): ()

On the Client

Send a message with given data to the server, for example:

light.send(messages.abc, 123)

On The Server

Send a message with given data to a player, for example:

1
2
3
Players.PlayerAdded:Connect(function(player)
    light.send(messages.abc, player, 123)
end)

Sending messages to multiple people

To send messages to multiple people on the server, check out light.broadcast().