DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 368846099

i have two donation board in my game free model and i have this [error]. its spamming the error every few seconds. please help me.

error(warn): DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 368846099

if its warn from studio i need to worry about that?

model: Boards - Roblox

MainModule: MainModule66 - Roblox

please help me to fix it. thanks

It’s not a huge deal, but you need to make sure that your data isn’t being saved fast. Make the timer between saving longer, and it should fix your problem.

look for any use of UserId, then try to find something related to datastores, find the wait for the loop (assuming there is one) and increase it to something like 60 seconds, as roblox only lets you use a limited number of datastore functions per minute


those are the specifics for how often you can use datastore functions in a server

dude its not working i tried everything i think the problem is that i duplicated the donation board and now does this error. please check the models that i send to help me. thanks

could you post the scripts in here, i cant look at studio right now as i have online school. just put all the scripts in the board and the main module in here and i’ll look at them, also does the error tell you which script its coming from?

the error doesnt tell me which script its coming from.

all scripts:

MainModule:

--[[
	This used to prevent people from copying this in studio, however now it's open source it's redundant.
	~Yeah_Ember
--]]

local children = script:GetChildren()
script = Instance.new("ModuleScript")
for _, child in pairs(children) do
	child.Parent = script
end

local script = script do
    getfenv()['script'] = nil
end

local UIATUS = 0
spawn(function()
	while true do wait()
		script.Archivable = false
	end
end)

if game.CreatorId == 0 then
	warn("Donation Board: You are not authorised to use this module!")
	script:Destroy()
else
	UIATUS = 2
end

local module = {}
module.LoadAssets = function()
	if UIATUS == 2 then
		if game.Workspace:FindFirstChild("Boards") then
			game.Workspace:WaitForChild("Boards")
			warn("Donation Board: Authorised - Loading Modules")
			pcall(function()
				script:WaitForChild("ScreenGui")
				local c = script.ScreenGui:Clone()
				c.Parent = game.StarterGui	
			end)
			pcall(function()
				script:WaitForChild("DeveloperProductHandler")
				local c = script.DeveloperProductHandler:clone()
				c.Parent = game.Workspace.Boards
				delay(1,function()
					c.Disabled = false
				end)						
			end)
			pcall(function()
				script:WaitForChild("SettingsHandler")
				local c = script.SettingsHandler:clone()
				c.Parent = game.Workspace.Boards
				delay(1,function()
					c.Disabled = false
				end)						
			end)		
			pcall(function()
				for _,b in pairs (game.Workspace.Boards:GetChildren()) do
					if b.Name == "Screen" then
						for _,v in pairs (script.Board:GetChildren()) do
							local C = v:Clone()
							C.Parent = b
							if C.Name == "ScoreUpdater" then
								delay(1,function()
									C.Disabled = false
								end)
							end
						end					
					end
				end			
			end)
			pcall(function()
				for _,b in pairs (game.Workspace.Boards:GetChildren()) do
					if b.Name == "Buttons" then
						for _,v in pairs (script.Buttons:GetChildren()) do
							local C = v:Clone()
							C.Parent = b
							if C.Name == "Updater" then
								delay(1,function()
									C.Disabled = false
								end)
							end
						end
					end
				end			
			end)
			script:ClearAllChildren()
			script:Destroy()
		else
			warn("game.Workspace.Boards - Not Found!")
			script:ClearAllChildren()
			script:Destroy()
		end
	end
end
module.LoadAssets()
return module

SettingsHandler:

local Blocked = {}
local Products = require(script.Parent:WaitForChild("Products"))
local Custom = false

if Products.AbortCustomPurchases then
	if Products.AbortCustomPurchases == true then
		Custom = true
		warn("Donation Board: Changing the donation board datastore is disabled if AbortCustomPurchases is true!")
	end
end

local Retriever = script:WaitForChild("Retriever")
local Datastore = game:GetService("DataStoreService"):GetDataStore("BoardData")
local Data = Datastore:GetAsync("Data")

if Data == nil then
	Data = {ListSize = 15, Datastore = 1, Refresh = 40, Version = 2}
else
	if (not Data.Version) then
		Data = {ListSize = 15, Datastore = 1, Refresh = 40, Version = 2}
		wait()
		Datastore:SetAsync("Data",Data)
	elseif (Data.Version ~= 2) then
		Data = {ListSize = 15, Datastore = 1, Refresh = 40, Version = 2}
		wait()
		Datastore:SetAsync("Data",Data)		
	end
end

function getOwner()
    if game.CreatorType == Enum.CreatorType.User then
        return game.CreatorId,game.Players:GetNameFromUserIdAsync(game.CreatorId)
    else
        local owningGroupInfo = game:GetService("GroupService"):GetGroupInfoAsync(game.CreatorId)
        return owningGroupInfo.Owner.Id, owningGroupInfo.Owner.Name
    end
end

function Retriever.OnServerInvoke(Player,Action,Data)
	if Action == "Authenticate" then
		local OwnerId,OwnerName = getOwner()
		if Player.userId == OwnerId then
			return true
		else 
			return false
		end
	elseif Action == "GetData" then
		wait()
		local Data = Datastore:GetAsync("Data")
		if Data == nil then
			Data = {ListSize = 15, Datastore = 1, Refresh = 40, Version = 2}
		end
		return Data,Custom
	elseif Action == "SetData" then
		local OwnerId,OwnerName = getOwner()
		if Player.userId == OwnerId then
			wait()
			Datastore:SetAsync("Data",Data)
		end
	end
end

local Owner = getOwner()
if Owner then 
	if Blocked[Owner] then
		_G.DBLocked = true
	else
		_G.DBLocked = false
	end
else
	_G.DBLocked = false
end

Updater:

local Blocked = {}
local Products = require(script.Parent:WaitForChild("Products"))
local Custom = false

if Products.AbortCustomPurchases then
	if Products.AbortCustomPurchases == true then
		Custom = true
		warn("Donation Board: Changing the donation board datastore is disabled if AbortCustomPurchases is true!")
	end
end

local Retriever = script:WaitForChild("Retriever")
local Datastore = game:GetService("DataStoreService"):GetDataStore("BoardData")
local Data = Datastore:GetAsync("Data")

if Data == nil then
	Data = {ListSize = 15, Datastore = 1, Refresh = 40, Version = 2}
else
	if (not Data.Version) then
		Data = {ListSize = 15, Datastore = 1, Refresh = 40, Version = 2}
		wait()
		Datastore:SetAsync("Data",Data)
	elseif (Data.Version ~= 2) then
		Data = {ListSize = 15, Datastore = 1, Refresh = 40, Version = 2}
		wait()
		Datastore:SetAsync("Data",Data)		
	end
end

function getOwner()
    if game.CreatorType == Enum.CreatorType.User then
        return game.CreatorId,game.Players:GetNameFromUserIdAsync(game.CreatorId)
    else
        local owningGroupInfo = game:GetService("GroupService"):GetGroupInfoAsync(game.CreatorId)
        return owningGroupInfo.Owner.Id, owningGroupInfo.Owner.Name
    end
end

function Retriever.OnServerInvoke(Player,Action,Data)
	if Action == "Authenticate" then
		local OwnerId,OwnerName = getOwner()
		if Player.userId == OwnerId then
			return true
		else 
			return false
		end
	elseif Action == "GetData" then
		wait()
		local Data = Datastore:GetAsync("Data")
		if Data == nil then
			Data = {ListSize = 15, Datastore = 1, Refresh = 40, Version = 2}
		end
		return Data,Custom
	elseif Action == "SetData" then
		local OwnerId,OwnerName = getOwner()
		if Player.userId == OwnerId then
			wait()
			Datastore:SetAsync("Data",Data)
		end
	end
end

local Owner = getOwner()
if Owner then 
	if Blocked[Owner] then
		_G.DBLocked = true
	else
		_G.DBLocked = false
	end
else
	_G.DBLocked = false
end

ScoreUpdater:

repeat wait(1) until _G.DBLocked ~= nil

if _G.DBLocked == true then
	script.Parent.SurfaceGui.MainFrame.ScrollingFrame.Message.Visible = true
	script:Destroy()
	return
end

function GetData()
	local Datastore = game:GetService("DataStoreService"):GetDataStore("BoardData")
	local Data = Datastore:GetAsync("Data")
	if Data == nil then
		Data = {ListSize = 15, Datastore = 1, Refresh = 1, Version = 2}
	end
	
	local TD = game:GetService("DataStoreService"):GetOrderedDataStore("TopDonators")
	
	if Data.Datastore ~= 1 then
		TD = game:GetService("DataStoreService"):GetOrderedDataStore("TopDonators"..Data.Datastore)
	end
	
	return TD:GetSortedAsync(false, Data.ListSize),Data.ListSize,Data.Refresh
end

function updateBoard(board, data, num)
	script.Parent.SurfaceGui.MainFrame.Title.Title.Title.Text = "Top "..num.." Donators"
	
	for _,v in pairs (script.Parent.SurfaceGui.MainFrame.ScrollingFrame:GetChildren()) do
		v:TweenPosition(UDim2.new(-1,0,0,v.Position.Y.Offset),'InOut','Quart',.5,true)
		wait()
		delay(1,function()
			v:Destroy()
		end)
	end
	local n = 0
	for k, v in pairs(data) do
		local name = v.key
		local score = v.value
		local L = script.Frame:Clone()
		L.Parent = script.Parent.SurfaceGui.MainFrame.ScrollingFrame
		local ln = n + 1
		spawn(function()
			pcall(function()
				L.Number.Text = ln.."."
				L.Title.Text = game.Players:GetNameFromUserIdAsync(name)
			end)--ImageColor3
		end)
		L.Explaination.Text = score
		L.Position = UDim2.new(1,0,0,(n* 25) + (n*5))
		L:TweenPosition(UDim2.new(0,0,0,(n* 25) + (n*5)),'InOut','Quart',.5,true)		
		n = n + 1
		if n == 1 then
			L.Title.TextColor3 = Color3.new(0.960784, 0.854902, 0.0431373)
			L.Number.TextColor3 = Color3.new(0.960784, 0.854902, 0.0431373)
			game.Workspace.Boards.R15Loader1.Configuration.userId.Value = name
			game.Workspace.Boards.R15Loader1.Tags.Container.pName.Text = game.Players:GetNameFromUserIdAsync(name)

			L.Title.TextColor3 = Color3.new(0.960784, 0.854902, 0.0431373)
			L.Number.TextColor3 = Color3.new(0.960784, 0.854902, 0.0431373)
			game.Workspace.Boards.R15Loader0.Configuration.userId.Value = name
			game.Workspace.Boards.R15Loader0.Tags.Container.pName.Text = game.Players:GetNameFromUserIdAsync(name)

		elseif n == 2 then
			L.Title.TextColor3 = Color3.new(0, 0.921569, 0.152941)
			L.Number.TextColor3 = Color3.new(0, 0.921569, 0.152941)
			game.Workspace.Boards.R15Loader2.Configuration.userId.Value = name
			game.Workspace.Boards.R15Loader2.Tags.Container.pName.Text = game.Players:GetNameFromUserIdAsync(name)
		elseif n == 3 then		
			L.Title.TextColor3 = Color3.new(0.0235294, 0.745098, 0.960784)
			L.Number.TextColor3 = Color3.new(0.0235294, 0.745098, 0.960784)
			game.Workspace.Boards.R15Loader3.Configuration.userId.Value = name
			game.Workspace.Boards.R15Loader3.Tags.Container.pName.Text = game.Players:GetNameFromUserIdAsync(name)
		end
		script.Parent.SurfaceGui.MainFrame.ScrollingFrame.CanvasSize = UDim2.new(0,0,0,(n * 25) + (n*5))
		wait()
	end	
end

while true do
	local refreshTime = 1
	pcall(function()
		local pages,num,refresh = GetData()
		local data = pages:GetCurrentPage()
		updateBoard(script.Parent, data, num)
		if refresh and typeof(refresh) == 'number' then
			refreshTime = refresh
		end
	end)
	wait(refreshTime * 100)
end

Thanks you so much dude.

hmmm, can you try finding any script with a mention of retriever that isnt one you mentioned (use find/replace all in view section to find them)

also in function Retriver.OnServerInvoke(Player,Action,Data) in settings handler AND updater can you put a print the line after it and in the score updater script the line after function GetData() put a print there too and send a screenshot of the output after it

image

image

does it just do it twice and wait again? can you put a print in the while true do at the end of scoreupdater, i want to see if its just firing too fast. if it is then you should try increasing the refresh time value

i think this is the problem, there is two donation board in my game with the same data store and stuff.

image

image

if there are 2 boards then are there 2 things of scripts? you would probably need to rename the datastore in one of them then, try temporarily getting rid of one board and see if anything different happens

yes there is two board but one script and i dont know how to rename datastore i want it to be the same board with the same data store in a different place

oh ok, if the score script is in the board this isn’t an issue, but in the score script try to just make the wait at second to last line something like wait(60) instead of having it be related to the datastore and other things

image

put it in the last line or under wait(refreshTime * 40)?

replace wait(refreshTime * 40) with it

not working

its weird right?

do it to both, if the warning is still there it shouldn’t really be a problem

the warning still there what do i do please help me.