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

Client to Client function/events?

Asked by
Nickoakz 231 Moderation Voter
9 years ago

I am trying to make a custom private message chat by using remote/bindable events/functions. The only problem is, which one is great for only client to client data transferring.

Each of the players will have a localscript and a event. Both players localscripts are the same and the way I'm trying to communicate is like so.

Player 1 made the pm and Player 2 accepts the pm Player1 sends a message which goes into Player2.Event:Fire and Player2's localscript is responsible for showing the data. Player2 sends a reply which goes into Player1.Event:Fire and Player1's localscript is responsible for showing the responce data.

Which remote/bindable events/function should I use for this purpose? The wiki does not show the recommendations for each API.

1 answer

Log in to vote
2
Answered by
bbissell 346 Moderation Voter
9 years ago

I would recomend making a Message Manager script in ServerScriptService with RemoteFunctions (Local Script to Regular Script). This would work as follows:

--Player 1 Sends Message
--Player 1 Local Script activates remote function
--In MessageManager, Variables (Recepient Name and Message) are taken from the RemoteFunction
--Message is sent to Player 2
--Player 2 Responds
--Repeat

If you would like to read up on Remote Functions, Here is the wiki page.

0
If this answered your question, Please "Approve Answer" So this article can help other users with the same issue. bbissell 346 — 9y
Ad

Answer this question