Studio Crashing - DataStore related?

Hey, I just had a quick read-through of the scripts you attached. The warn you’re getting about DataStore queue is when there’s excessive save requests within a set timeframe and it doesn’t handle very well. I’m assuming you had a large spam of those warns.

Your CurrencyManager has a while true loop that makes 3 DataStore calls per player every 60 seconds, I suggest changing this to every 5 minutes cause you really don’t need to be saving data that frequently and then just have datastore save also on game bind to close and when players leave. I would suggest replacing the while true also but if not then wrap it in a task.spawn and change wait to task.wait, that’s current practice - see this for an explanation on why.

You’re also making individual SetAsync calls for each statistic instead of bundling data together.

So do something like this >

Example Script
local success, err = pcall(function()
	local playerData = { 
		Coins = leaderstats.Coins.Value, 
		Rebirths = leaderstats.Rebirths.Value, 
		Kills = leaderstats.Kills.Value 
	}
	CurrencyStore:SetAsync("PlayerData_" .. player.UserId, playerData) 
end)

Then do the same bundling for the top of your script when you load player data and add the aforementioned player removing connection to save the data when they leave. Then… the game bind to close for when servers shutdown. This should drastically reduce your DataStore requests from potentially hundreds or more per hour down to… just a few dozen. This is mostly an address to the currency script, if there’s persistent issues then it may trickle down to the other scripts involved too which should be updated along with them.

Here’s some links which may be helpful.
PlayerRemoving
BindToClose
ProfileStore (a DataStore module, successor to ProfileService)