Help with Mail System

How would I go about making a mail system that lets players send messages to players in other servers, as well as players who are offline? Any information or guides would be extremely helpful, thanks!

You can put the messages in a DataStore and use MessageService to tell other servers they need to check their “mailbox”

Roblox and other people much prefer if you using MessagingService or MemoryStoreService for cross server communication. Unless you develop your own way to network that information.

It’s relatively the same as datastores are, but they can be used more frequently without the cost towards using datastore limits. Just have a system which grabs queued or newly transmitted/sent data from either of the services and relay them to the user if the user is within that server. If you’re doing a 1:1 communication for players, make it request the mail when the user tries opening up their mail from that specific user (or hold all mail within the same table).

Personally wouldn’t use datastore service for this as this could potentially (not completely or likely) mess up saving/getting data when using datastore service.

Since I suppose you want those DM’s to persist (I saw that you want to contact offline people too, so best bet is you want it to persist), then you should use DataStores. Although you could create your own system, a good approach is to use ProfileService and the GlobalUpdates system that includes ProfileService. If the data takes too long to arrive with GlobalUpdates, you can use MessagingService to check if they’re online, and ask the server they are in to save their data, so that the GlobalUpdate arrives quicker. You can view this on ProfileService’s documentation

I would advise you to watch this Video and then try to modify it to exactly what you want

Thank you all for the ideas and links, I ended up using Datastores (specifically :UpdateAsync()) to make this work. Each piece of mail has an attribute called “Opened”, and the server will keep checking the datastore to see if there’s any new mail that has its Opened set as false. You can test the system here: (The gui is very simple, that was not the focus of this project) Mail System (WIP) - Roblox

Again, thank you very much for all the help!

You should mark as a solution the reply that most helped you. Not posting your own (especially considering that your reply is basically our ideas, as you said) and marking it as one.

But the solution I ended up using is different than what the people suggested. I am marking the solution that I created. All of the information shared was helpful, and it’s difficult to pick one good solution.

Also, if someone is looking at this post because they are trying to solve the same issue, a single solution just might not be it for them.

That being said, the first is probably the closest(?) So I’ll just mark it as that for now.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.