Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Will the space in datastore ever run out?

Asked by 4 years ago

Hello. I am kind of confused about how the DataStoreSystem Works.

so for exmaple, i have a datastore called "PointsDataStore", and it saves the data of everybody's points. Does every single player's data get saved into the same data store or every player has a seperate data store called "PointsDataStore"?

Also, in popular games, lots of player's data needs to be saved. If a game get's popular, does it need to worry about the lack of space in the DataStore? since there's limited space in the data store, with lots of players, would the space run out? If so is there a way to fix the problem?

thanks for your time!

0
No, DataStores don't do that cherrythetree 130 — 4y
0
Don't do what? I asked a few questions on top. Gmorcad12345 434 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

This is a good question Gmorcad12345! So to start, let's dive into how 'DataStores' work...

When you create a DataStore, it should look something like this...

local DataStoreService = game:GetService("DataStoreService")
local pointsDataStore = DataStoreService:GetDataStore("Points")

So in this example, we called the DataStoreService, and then we called a DataStore, indexed as Points. From there, we can call write & save data to that DataStore by using the SetAsync and GetAsync functions. Let me show you an example...

local DataStoreService = game:GetService("DataStoreService")
local pointsDataStore = DataStoreService:GetDataStore("Points")

pointsDataStore:SetAsync("papasherms", 10) 
pointsDataStore:GetAsync("papasherms")

When we used the SetAsync function, we set the value 10 to the key papasherms, now I do not recommend using a player's name as the key, cause names change, so I'd recommend using their UserId. Now when we used the GetAsync function, it should return a value of 10, because that is what we set it as.

Now, to answer your questions... Does every single player's data get saved into the same data store or every player has a separate data store called "PointsDataStore"?" ... all the player data gets saved to a 'DataStore', saved under a specific key, remember how I mentioned the players UserId earlier? Onto your next question... do I need to worry about the lack of space in the DataStore? ... to answer this question, no you don't; however, there are limits on what kind of data you can write to a DataStore, so be careful of that.

Here is a link to the Roblox Developer website which can better answer your questions on limits, queuing, etc.

0
Thanks so much, your explanation is specific :) Gmorcad12345 434 — 4y
Ad

Answer this question