I get what you’re telling me but how would I do it like the keys can’t be just numbers they have to involve the player’s id somehow right? Also for changing key names I would have to keep that bit of code for replacing forever cuz of how many ppl have that old key name data?
What I would do :
Open suphi datastore player first , if it is empty I look for the datastore2 key,if empty then just set your started data on suphi datastore player or if it is not empty then apply that data to suphi datastore player.
here is a example of how to extract the latest data from datastore2
local dataStoreKey = dataStore2Name .. "/" .. player.UserId
local dataStore = dataStoreService:GetDataStore(dataStoreKey),
local orderedDataStore = dataStoreService:GetOrderedDataStore(dataStoreKey),
local mostRecentKey = orderedDataStore:GetSortedAsync(false, 1):GetCurrentPage()[1]
if mostRecentKey == nil then error("player does not have any player data inside datastore2") end
local playerData = dataStore:GetAsync(mostRecentKey)
-- if you wanted to remove all player data saved by datastore2 you would have to loop from 1 to mostRecentKey
-- WARNING mostRecentKey can be a very high number and this loop could take a very long time to finish
-- for i = 1, mostRecentKey do
-- orderedDataStore:RemoveAsync(i)
-- task.wait(6)
-- dataStore:RemoveAsync(i)
-- task.wait(6)
-- end
print(playerData)
don’t forget to use pcall as GetSortedAsync, GetAsync, RemoveAsync can all fail
MemoryStoreService: InternalError: Failed to parse MemoryStoreService JSON response. API: SortedMap.Update, Data Structure:
I am not using MemoryStoreService in any external scripts.
Platform: Mac OS | Roblox Studio
Did you enable API calls in game settings under security?
MemoryStoreService: InternalError: Failed to parse MemoryStoreService JSON response - Bug Reports / Studio Bugs - Developer Forum | Roblox
seems like your note the problem
I don’t think that’s the same problem
Was there any more information from the error message?
Working on a website version using moonwave stay tuned
It’s here. Still working on adding more docs and API. SuphisDataStoreModule | SuphisDataStoreModule
oh heck that’s amazing wow nice job
Hey Suphi,
I’ve been loving your DataStore module and using it for a while for my game. Recently, one of my data save attempts only affected if I exit and enter the game. So, datastore saves but datastore.StateChanged event won’t trigger for this specific save attempt. This should trigger but it won’t untill I relog:
And this is where I update datastore:
Appreciate if you could help me.
The state only changes when the datastore opens closes or is destroys
Okay, got it. Thanks for such a quick response. I’ve fixed it by adding dataStore:Open() to the script where I update dataSore. Should I use this approach to update the folders under player or should I use another event such as Saving?
You should open when the player enters the game and destroy when they leave
I cover this in my basics video
Yes I’ve watched it. But I’m using your datastore to keep track of quest progression, inventory, skills etc. So, gui needs to update quickly when new item is added or a quest is progressed. Like in your video (You used leaderstats folder to demonstrate), I’m getting the data from datastore and storing inside dedicated folders in Player. When data changes in datastore, I copy the new data in corresponding folders. Like this:
I’m confused why quest progression doesn’t update, even tough stats, skills do update. (If I relog quest progress updates, but does not update untill that)
I don’t see you updating the attributes when the humanoid dies
In such of factions/groups (non-player related data), how would this be able to function for leaderboards and such for factions?