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

6 second cooldown when writing to a key(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.

0
This is not they way you should save data but yes you should be ok. The limit only applys to the same hierarchy ie [data store scope][data store name][data store key] User#5423 17 — 6y
0
is there a better way to save data that you could help? i can't figure out why my datastore seems so unreliable :( PoePoeCannon 519 — 6y
0
Save a table of data. User#5423 17 — 6y
0
ehh thisll be fine thanks tho PoePoeCannon 519 — 6y

Answer this question