How can I make a table transfer correctly from server to server using MemoryStores

Hi, I’m currently making a lobby system where I store settings in a table, and I want to transfer it to a new place within the game. I don’t want to use MessagingService, as it’s not always the most reliable, nor the best thing to use for a system like this.

Problem is, I’m not really sure how to use MemoryStoreService. All of the documentation is not clear to me, and guides are not helpful either.

Here’s as far as I got:

local MemoryStore = game:GetService("MemoryStoreService")
local Queue = MemoryStore:GetQueue("HeistLobbyInformation")

local LobbySettings = {}
local UserId = Player.UserId

Queue:AddAsync(UserId, 30, 1)

Basically, what I want to do is use this, except not only do I want the UserId to be what the queue key is called, I also want it to transfer LobbySettings with it as well so I can retrieve it in the new server.

Any help with my problem would be greatly appreciated! :happy3:

Can you send a table at all? Like {“A”, “B”, “C”} ?

I’m not sure why you wouldn’t be able to, it’s meant to function sort of like DataStores from what I’ve heard. I just can’t figure out how.

I mean like what happens if you try to do it?

It would work, but my problem is that it doesn’t seem like the table can be ‘named’ per-se, like how a DataStore can. I would want to use something MemoryStoreService:ReadAsync(), but with a named table so that I can get a specific thing from the MemoryStore instead of needing a loop until I find the correct table.

Remember, what I’m trying to do is:

  1. Save lobby data to a MemoryStore
  2. Teleport lobby participants to a new place
  3. Retrieve that exact same lobby data to use in the new place