I also want to port my data from the traditional datastores to profilestore, but I don’t know how.
Here is how I do it in my game:
- Add some “DataTransferred” boolean to your ProfileStore data, set to false by default
- When a player joins, if DataTransferred is false, call GetAsync on the traditional datastore
- If the returned data is not nil, set the ProfileStore data to the old data
- Set DataTransferred to true (regardless if old data exists or not)
Note that this would not work if you were already using ProfileStore in production, since the existing data would be lost
I’ve got 2 questions:
-
Would it be a bad Idea to sync leaderstat changes from the leaderstats themselves instead of the other way around after initialization? Like, cash leaderstats gets changed → data gets changed?
-
What would be the best way to handle multiple tables? Like save slots? Should I assign them all to one profile or create multiple profiles? And If it’s just one profile, could I only load a selected save instead of all of them? I feel it would be stupid to load say, 5 saves, only to end up changing data on Save1 but saving all of them regardless.
Super nice Module by the way!
Hi, I’m currently experiencing a problem where calling the .New() method produces the following error:
ProfileStore:390: attempt to concatenate nil with string
This is my code:
local DATA_TEMPLATE = {
money = 0,
reputation = 0,
firstTimePlaying = true
}
local DATASTORE_NAME = "Live"
if RunService:IsStudio() then
DATASTORE_NAME = "Test"
end
--Access profile store
local PlayerStore = ProfileStore.New(DATASTORE_NAME, DATA_TEMPLATE)
What’s going on here?