DataStore2 request was added to queue warning?

Hi,

How can i fix this? This happening when many players joins at once…
Any ideas how to fix this?

Try looking for the errors in the output, the output detects the errors. Most of the time when you click the text (The red text is the error) it would take you to the exact line of the script where you messed up. For each datastore request, you would need it to prevent it from getting in any other thing in your game. If you do not want it, just look for the hidden scripts in the explorer. Also, try to re-check what you did wrong and if there is something inside the script that travels it to the queue warning, try to rewrite some lines of scripts.

This only happens when you poorly handle your data. DataStore2 should not throttle, thus there is some problem with handling data on your side.

Do you do DataStore2.Combine("MasterKey", "Your", "other", "keys")?


@XxScottieBoixX Your response is irrelevant, this is something with too much data flow.

1 Like

Oh, so it is just the data flow that is buried within each datastore table? I didn’t realize that that was the main propaganda of that statement. It was misunderstood that it was just the flow of the datastore. I am questioning on why the datastores are affecting different parts of the game.

actually no,

i have multiple scripts for some types of data like:
1 script for leaderboard (TAB) data
like 2 scripts for Tables that i want to save…

What is your current code?

this is what i use for leaderboard data:

local DataStore2 = require(game.ServerScriptService.DataStore2)
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	for i,v in pairs(script:GetChildren()) do 
		local vStore = DataStore2(v.Name.."SECRETKEY", player)
		local x = Instance.new("NumberValue")
		x.Name = v.Name
		x.Value = vStore:Get(0)
		x.Parent = leaderstats
		vStore:OnUpdate(function(newPoints)
        	x.Value = newPoints
		end)
	end
	leaderstats.Parent = player
end)

For tables i use something like this:

You do not need to store the person’s name in a DataStore2 request, thats handled by DataStore2 request with the player object you’ve passed. The reason its freaking out is because you haven’t combined the data values correctly.

Docs can be found here:

You also don’t need a secret key. Exploiters can’t access datastores