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

How can I access a client from another client?

Asked by
KoreanBBQ 301 Moderation Voter
8 years ago

Lets say for an ingame chatting service. How would I sent the chats from a PlayerGui to another, and vice versa? I tried using BindableFunctions but I dont know how to use them.

1 answer

Log in to vote
0
Answered by 8 years ago

Use a RemoteEvent,

Client Script:

Event.OnClientEvent:connect(function(Text)
    --You have your text (as will everyone else)
end)

local Text = "Testing..1..2..3"

Event:FireServer(Text)

Server Script:

Event.OnServerEvent:connect(function(Player, Text)
    Event:FireAllClients(Text)
end)
0
Ah great. Thanks. And would there be another way of doing it using RemoteFunctions? KoreanBBQ 301 — 8y
0
It would work (pretty much) the same way as a remoteevent, although personally I prefer RemoteEvents. darkelementallord 686 — 8y
Ad

Answer this question