I’m changing my current Server script from DataStore2 to DataStore.
I have a function that receives any change sent from LocalScript and stores it in a tableGame in DataStore.
local function SaveGame(Player, Game)
local GameStore = DataStoreService:GetDataStore("Game", Player)
JogoStore:SetAsync("Game", Game)
end
However, every time the function is invoked I get this warning:
DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = Game
you cannot pass physical games through datastores. please read the docs next time and save tables instead. Now that thats covered, you are getting this issue because you are calling setasync or getasync too many times. You can view the limits here Documentation - Roblox Creator Hub
However, if you do a single datastore request when a player joins and when they leave it will not overload the queue. If you can show the code where you call that function, that would also help.
The datastore limit is 6 (higher, see post 12) per minute IIRC, I get the error when I’m doing a single datastore. I have been told the same elsewhere. (about the error, not limit)
what you could use is ProfileService. It is VERY well made and is used by a lot of people. Its main feature is session locking which helps prevent duplication glitches
Yeah, you will get that output every time data is saved. You don’t have to worry about it as long as you aren’t going over the limit, it gets annoying but wrapping it in a pcall should resolve it, and you shouldn’t see it anymore.
local s,e = pcall(function()
JogoStore:SetAsync("Game", Game)
end
I dont think you will get that every output. That is bad and should be looked into. If it happens every once in a while its fine but if it happens everytime its saved thats just a disaster if the game becomes big.
If you are worried about data being lost/corrupted due to save size, you can JSONEncode your table, and then save it to the DS, and then JSONDecode when loading the data. JSONEncode formats the table into a string. Also, believe me, it isn’t anything to worry about. I’m saving quite a few values and have yet to run into any errors. It is also putting the same output right below.
I was trying to make many SetASync before 6 seconds.
So, as I said, I’ll try to save all data only when the user exits, using game.Players.PlayerRemoving.