I have everything under one masterkey so there no problem with handling, but i figured out the problem!
It was because i made when data “TotalGold” and “TotalKills” are updating i also update with them OrderedDataStore to update my global leaderboards.
Heres how it looks like:
local DataStore = game:GetService("DataStoreService")
local TotalGold = DataStore:GetOrderedDataStore("TotalGoldGlobalLeaderboardDATAStore")
DataStore2("TotalGold", plr):OnUpdate(function(newPoints)
TotalGold:SetAsync(plr.UserId, newPoints)
end)
Do you have any recommendations how could i update my leaberboard DataStore?
Like if i will make a loop that will update it every x minutes, but theres problem that if player leave it will not be saved and player will keep his old data, so i need to make also a thing that will save it also when player leave, but it can not save sometimes…
Update: I googled it and currently i save it every 2 minutes and on :AfterSave(). This works with no issues as of right now, later will do some tests with more players.
Is there a way to save data using DataStore2 within a universe? Previously using DataStore, I could use the same name of the data store and have all my data save regardless of what place I’m in within the game, however I’m unaware of how to do this within a universe using DataStore2.
Is there any tutorials out on the internet that explain how to create a global leaderboard using DS2? Dungeon Quest was able to accomplish this and I can do it with normal DS, but I can’t seem to figure out how to get it to work with DS2.
I’ve seen people attempt this and they say they have to get the OrderedDataStore, but there’s no API for this in DS2 so they find a workaround.
So I’ve noticed that people have been losing data by quite a bit using DataStore2. The main trend between these people is that they attempt to play on multiple devices. So let’s say they are on phone, and then move to PC without closing off from phone, they would’ve lost all the progress they made on phone.
I’m not too sure, does anyone else have this? Or is it possible to change devices and keep data, and it’s just something wrong with my scripts?
I found that if players don’t close the current game window, and click play on the same game (causing the current game window to close); all the data they gained on that current game instance will be lost. Has anyone else experienced this? If so, what was the solution?