Global Datastores

I am currently trying to make a game in which the player teleports to a different place to play a certain map. After either winning or losing the map they should be teleported back to the main one. Every game they win gives them a certain amount of points.

Is there a way of using DataStores to globally save their points?

I want to do this in the most efficient way possible.

2 Likes

DataStores are able to save and retrieve data throughout places in a single universe, they just need to have the same scope.

1 Like

You can use DataStores between places as long as the places are under the same game. So if you make the player teleport to the map and then check if they won you can retrieve the Datastore for “Wins” and update it and it will update for all places so including the main one. In my opinion, you can use DataStore2 to achieve this even easier!

1 Like

I think this page will help:
https://developer.roblox.com/en-us/api-reference/function/DataStoreService/GetGlobalDataStore


I might be wrong about the page above. Since I don’t have access to Studio, try testing a normal data store in an universe. Add something from the starting place followed up by reading the output from the other place.

1 Like

I believe if your places aren’t under one universe (which it sounds like they are but for the sake or argument) you’d need to use http service and a server. But yes if your places are in a single universe then you can access via DataStores. Just make sure to save each players data fully when they leave. (seems obvious)

2 Likes

DataStores are global to your game by default. Any place in your game using DataStores has access to the same partition of data. Places not part of the same game require an external server to accomplish data transferring.

Also, for the sake of clarifying terminology since I see there’s a bit of misconception here, I’ll just add a quick little game glossary.

Common Term Technical Term Summary
Server Instance An instance of your place containing players.
Game Place A part of a game, like a level or a map.
Universe Game Your overall game with all places in it.
3 Likes

To be honest, at one point I was considering using an external API anyway as web development is my thing. The only con would be if the hosting I used was down meaning players data wouldn’t save.

I might have a go with DataStore2. I heard that the top Devs used it.

1 Like

Thanks for the table. It makes me understand ‘Universes’ more.

I probably will do a test like you say. Probably a simple coins system. :thinking:

So basically so long as the places are all connected it’ll work?

Yes! Basically, places don’t have datastores, universes/games do!