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

what exactly does the 6 second cooldown apply to when saving datastores?

Asked by 6 years ago

So i have a datastore system in my game and i keep getting throttled from too many requests, but it really is not that many requests and my datastore budget for set async is nowhere near empty.

Here is the code for how it saves player data.

--function to save data
function savedata(dataname, playerid, value)
    game:GetService("DataStoreService"):GetDataStore(dataname):SetAsync(playerid, value)
end

--calling the function to save data
savedata('level',playerKey,player.leaderstats.Level.Value)
savedata('EXP',playerKey,player.Exp.Value)
savedata('xpLevel',playerKey,player.ExpNeeded.Value)
savedata('Gold',playerKey,player.leaderstats.Gold.Value)

So when it says there is a 6 second cooldown to write (setAsync) to a certain Key... Does that mean i can only call this function once every 6 second because its saving different stats separately?

or does this code look okay? because it keeps throttling and i can't seem to figure out why.

Answer this question