Problems with datastores

So I’m making a skill tree and how I have it right now is that the player’s skill tree data (a table) saves every time a new move is bought. So if a player buys a move within the 6 second cooldown on the datastore save it doesn’t work.

This is really annoying because I didn’t know at the time that DataStoreService had a sort of “cooldown.” I spent hours basing everything off a saving script that saves when the move is bought.

I’m not sure how to fix the problem…

Why don’t you just save when the player leaves? There’s no point making unnecessary data store calls every time something happens.

The limit should put the request in a queue, it shouldn’t cancel the request entirely. Are you using :BindToClose?

game:BindToClose(function()
    task.wait(30) --just wait for datastore queue to be emptied
end)

A good practice for datastores is have it save every X seconds (I have it be 30) then also have it save when the player leaves as mentioned in the reply above mine.

I’m not sure how to explain what I meant but I’ve fixed it now. :+1: