DataStore request was added to queue

I dont know why am i having this error. Could anyone say a way to fix it?

[16:29:46.454 - DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = RobuxSpent]

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MarketplaceService = game:GetService("MarketplaceService")
local DataStoreService = game:GetService("DataStoreService")

local DailyStore = DataStoreService:GetDataStore("Daily")
local TickStore = DataStoreService:GetDataStore("Tick")

local DailyRobuxAmmount = 2350

local GoalPart = workspace:WaitForChild("GoalPart")

local _tickGetAsync = TickStore:GetAsync("Tick")

if _tickGetAsync == nil or tick() - _tickGetAsync > 86400 or tick() - _tickGetAsync >= 86400 then
	TickStore:SetAsync("Tick", tick())
end

UpdateGoal = function(PriceInRobux)
	local RobuxSpent = DailyStore:GetAsync("RobuxSpent")
	if tick() - _tickGetAsync > 86400 or tick() - _tickGetAsync >= 86400 then
		_tickGetAsync = tick()
		TickStore:SetAsync("Tick", tick())
		DailyStore:SetAsync("RobuxSpent", PriceInRobux)
	else
		if RobuxSpent ~= nil then
			DailyStore:SetAsync("RobuxSpent", PriceInRobux + RobuxSpent)
		else
			DailyStore:SetAsync("RobuxSpent", PriceInRobux)
		end
	end
	local ammount = (100/RobuxSpent)
	GoalPart.SurfaceGui.DonationFrame.Percentage.Text = "%"..math.floor((ammount*100)+0.5)/100 .." of " ..DailyRobuxAmmount
	GoalPart.SurfaceGui.DonationFrame.SizeFrame.RealFrame.Size = UDim2.new(0, ammount, 1, 0)
end

processReceipt = function(receiptInfo)
	local Player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
	local ProductId = receiptInfo.ProductId
	
	local productInfo = MarketplaceService:GetProductInfo(receiptInfo.ProductId, Enum.InfoType.Product)
	local Price = productInfo.PriceInRobux
	
	if not Player then
		return Enum.ProductPurchaseDecision.NotProcessedYet
	elseif ProductId == 640481772 then
		UpdateGoal(Price*10/100)
	end
end

MarketplaceService.ProcessReceipt = processReceipt

It just means you are sending to many requests to the Datastore.

It could happen because you start the game too many times.

I mean, its impossible to not using lots of DataStore at that daily robux goal script.

Iā€™d suggest sending less updates and only changing it when it is necessary or using one datastore as a table and json encode it

Nah, when i buy something again in 60 seconds, it gives this error and the script doesnt work if i get that error.

1 Like