Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Anyway I can talk to other Clients through a local script?

Asked by 2 years ago

Although I highly doubt it, is there any way? Niche or not idc.

1 answer

Log in to vote
1
Answered by 2 years ago
Edited 2 years ago

You can use either through client-server-client by RemoteEvents, or client-client (also server-server) by BindableEvents. But I recommend using RemoteEvents instead. It's because BindableEvents might only fire to one client (not sure), while RemoteEvents can choose any client.

First, you will fire the server and pick the player (other client) you want to communicate with as the first argument.

RemoteEvent:FireServer(otherPlayer)

Next, you will ccreate an event listener for that RemoteEvent, and for this one, just fire this back to the client and set the first argument as the otherPlayer.

RemoteEvent.OnServerEvent:Connect(function(player, otherPlayer)
    RemoteEvent:FireClient(otherPlayer)
end)

And lastly, you create a handler in the client script.

RemoteEvent:FireServer(otherPlayer)

RemoteEvent.OnClientEvent:Connect(function()
    print("Other client has communicated with you.")
end)
Ad

Answer this question