Question about creating datastores

I haven’t messed with data stores too much in my game other than creating a module to read/write player data. I’m at the point in my game where I want to create an ordered rank list for various stats.

Now the way that I see it, each stat requires it’s own ordered data store. Right now, I have that code written and tested and so far it seems to be working. The issue that I’m running into is when I get an order data store by the name (“GlobalKills” for example), I check for it’s existence and it does not exist. The only data store that actually exists is the one for player data within the game itself since that one actually contains data.

Is this normal behavior?

If you haven’t ever created the datastore before, then yes that should be normal behaviour

(cc @OP)

GetDataStore (and its deritives) always returns a DataStore object, this is more just an empty shell to perform API requests with the given store and scope, the call to GetDataStore doesn’t actually create a datastore itself (if you get what I mean).

1 Like

So you actually have to write something to the data store for it to be created then?

Indeed, GetDataStore isn’t a YieldFunction (pauses execution of the running script until it responds), so that should be enough to suggest its not making a http request.

You should research about ProfileService. It’s a lot more efficient to create datastores with it.

Thanks for answering the question. You got marked with the solution.

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