Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Client to Client function/events?

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

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.

1 comment

0

If this answered your question, Please "Approve Answer" So this article can help other users with the same issue.

This discussion is preserved as it was. New answers, comments, and votes are closed.