Datastore Request was added to Queue

So, im in the middle of making a simulator and I kept running to this same issue. The object is to lift and when they user lifts a line is sent to my output saying “Datastore request was added to queue. If request queue fulls, further requests will be dropped. Try sending fewer request.key = (numbers)”

Anyone know how to solve this issue?

Check to make sure Studio API access is enabled.

Could we see the script giving the error?

Sure, there are two scripts, a module and a server. Let me get them.

Module script :
local module = {

strengthPerClick = 1,

cooldown = 1

}

return module

Server script:
local _M = require(script.Parent.Settings)
local db = false
local tool = script.Parent
local plr = tool.Parent.Parent

tool.Activated:Connect(function()
if not db then
db = true

	plr.leaderstats.Strength.Value = plr.leaderstats.Strength.Value + _M.strengthPerClick
	wait(_M.cooldown)
end

end)

There’s no datastore in that script, so I don’t believe that fully affects it. Do you possibly do :SetAsync() every time the value changes? Or if you could include your leaderboard script too that could help.

Try using Datastore2, it has a cache system which is used to prevent this error. Read more about it here: DataStore2

Sorry, that was the wrong thing let me get my Datastore.
local serverStorage = game:GetService(“ServerStorage”)
local DataStore = game:GetService(“DataStoreService”):GetDataStore(“PlayerSave3”)

game.Players.PlayerAdded:Connect(function(player)

local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

local strength = Instance.new("NumberValue")
strength.Name = "Strength"
strength.Parent = leaderstats

local rebirths = Instance.new("IntValue")
rebirths.Name = "Rebirths"
rebirths.Parent = leaderstats

local coins = Instance.new("DoubleConstrainedValue",leaderstats)
coins.Name = "Coins"
coins.Parent = leaderstats

coins.MinValue = 0
coins.MaxValue = 100000000

local dataFolder = Instance.new("Folder")
dataFolder.Name = player.Name
dataFolder.Parent = serverStorage.RemoteData

local debounce = Instance.new("BoolValue")
debounce.Name = "Debounce"
debounce.Parent = dataFolder

local strengthData, rebirthsData

local success,errormessage = pcall (function()
	strengthData = DataStore:GetAsync("strength--"..player.UserId)
	rebirthsData = DataStore:GetAsync("rebirths--"..player.UserId)
end)

if success then
	if strengthData then
		strength.Value = strengthData
		rebirths.Value = rebirthsData
	end
end

end)

game.Players.PlayerRemoving:Connect(function(player)
local success, errormessage = pcall(function()
DataStore:SetAsync(“strength–”…player.UserId,player.leaderstats.Strength.Value)
DataStore:SetAsync(“rebirths–”…player.UserId,player.leaderstats.Rebirths.Value)

end)

end)

I also found a thread that might help OP in scripting helpers if he doesn’t wish to migrate to DataStore2

But still its more common to use Datastore2 nowadays or atleast a own cache system.

Yeah, I read that and I have a lot of GetAsyncs and stuff. How would I replace these?

You can use CTRL+SHIFT+F to find all the matches of a certain query, such as :GetAsync( or :UpdateAsync( or foo( for that matter.

This will make it much easier to replace all of them.

Also read some of the APIs for DataStores as they tend to be quite useful.

I do use SetAysnc a lot, see any issues in my script?

Where are you using SetAsync a lot? In the script you provided, I only see it used twice, which wouldn’t error.

In all honesty, this shouldn’t fill the queue that much. Double check to make sure that Studio access to API services is enabled in game settings, and see how often the :SetAsync() functions are called. This will resolve your issue most likely.