Removing or Changing Ordered DataStore's User Data

Someone’s data on the leaderboard is 10
To change it, I tried:

local ds = game:GetService("DataStoreService")
local thing = ds:GetOrderedDataStore("PointData")
thing:SetAsync(6734568, 5)

result →

Warning:
DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 6734568

( same thing happens when using :RemoveAsync() )

Whenever you print the data it remains at 10. How does one change the value to 5, or, even remove the User’s data?

1 Like

About the warning


That warning means you’re sending too many requests for the user and will start a queue system till that fills up. This error is a normal thing just try adding a wait or make your own queue system for your datastores.

About the saving


The SetAsync is perfectly what you should be using so there’s nothing wrong with that. If you’re making a global leaderboard then be sure to add a refresh rate of 30+ seconds.

Why is it not enough to save data only when player leaves or when server closes?

By that do you mean the server closes / leaves before the data could be saved? or are you questioning the 30+ seconds for the global leaderboard?

I’m asking how often would you save player data to data store. I do it when player leaves the game and when server is closed (server shutdown)

Should I save it every 30s?
Why/why not?

If you have an AutoSave system then yea every 30+ seconds you can save it but it’s best to save them when the player leaves.

Though I mentioned the 30+ second save because of the global leaderboards since they require to be saved and send in between servers.

Ahhh yeah, i get it. I refresh leaderboards every 2 mins