Any way to save reserved server-dependent data to Data Stores?

Currently, I’m storing teleport data that contains information about the game (e.g: difficulty) when players teleport to the reserved server.

I might be noticing that it does not always work. Initially I wanted to write data to data stores for the specific reserved server instance, but the problem with that is I don’t know what key I would use that could be accessed both from the lobby and the server in which players would teleport to. I thought there’d be like a jobID or something like that I could use but I couldn’t find much.

I’d appreciate any feedback. Thanks :slight_smile:

There could be an issue with your use of teleport data, as I don’t know of how it could fail. Nevertheless, I would recommend the use of Memory Stores much more over the use of Data Stores as they’re literally made for this kind of stuff.

TeleportService:ReserveServer() returns the access code of the server, plus the PrivateServerId of the reserved server. Perhaps you could use that id as the key. The id is also accessible from the reserved server itself, which you could use to retrieve the data.

2 Likes

Thanks for the response.

I was a bit interested in receiving clarification on Roblox’s overview of private server ids, based on what this passage says it indicates there can potentially be multiple running servers with the same private server id? If that’s truly the case, this solution does not seem any more reliable than just using teleport data.

I’m sure it’s otherwise. In that paragraph it says that they can have multiple server instances associated with them over time (not at once). In the next sentence they also state that only one server instance can be running at once for a private(reserved) server.

1 Like