Datastore request was added to queue. If request queue fills, further requests will be dropped

So I use Chatgpt because I suck at datastore.
I try to make 1 leaderboard for 50 datas. How I make it is by use 1 leaderboard with template screen gui and clone it 50 times with leaderboard script inside [so I can switch screen to any data I want].

Here is Clone script
for i, v in pairs(workspace:WaitForChild(“Creatures”):GetChildren()) do
task.wait(3)

local clone = script.Parent.Board:Clone()
clone.Name = v.Name
clone.Parent = script.Parent 

task.defer(function()
	clone:WaitForChild("Stat").Value = v.Name
end)

end

and leaderboard script that chat gpt made
local LAST_FETCH = 0
local FETCH_COOLDOWN = 35
local GLOBAL_FETCH_LOCK = false
local GLOBAL_SAVE_LOCK = false

local DataStoreService = game:GetService(“DataStoreService”)
local Players = game:GetService(“Players”)

local StatObject = script.Parent.Parent.Parent:WaitForChild(“Stat”)

– wait until Stat is valid
while StatObject.Value == “” do
StatObject:GetPropertyChangedSignal(“Value”):Wait()
end

local function GetStat()
return StatObject.Value
end

local function GetStore()
return DataStoreService:GetOrderedDataStore(“Speedrun_” .. GetStat())
end

script.Parent.Parent.Header.Text = “Top Speedrun Time [” .. GetStat() .. “]”

local SaveCooldown = {}
local UpdateCooldown = false
local LeaderboardCache = {}

– GUI
local function CreateGui()
return script.Parent.PlayerFrame:Clone()
end

– SAFE UPDATE
local function SafeUpdateGui()
if UpdateCooldown then return end
UpdateCooldown = true

UpdateGui()

task.delay(5, function()
	UpdateCooldown = false
end)

end

– SAVE
local function SavePlayer(player)
if SaveCooldown[player] then return end
SaveCooldown[player] = true

task.delay(10, function()
	SaveCooldown[player] = nil
end)

local statName = GetStat()
local folder = player:FindFirstChild("Speedrun")
if not folder then return end

local statValue = folder:FindFirstChild(statName)
if not statValue then return end

local value = statValue.Value
if value <= 0 then return end

local cs = math.floor(value * 100)
local userId = player.UserId

local improved = false
if GLOBAL_SAVE_LOCK then return end
GLOBAL_SAVE_LOCK = true

task.delay(3, function()
	GLOBAL_SAVE_LOCK = false
end)
task.spawn(function()
	local success, err = pcall(function()
		GetStore():UpdateAsync(userId, function(old)
			if not old then
				improved = true
				return -cs
			end

			if -cs > old then
				improved = true
				return -cs
			end

			return old
		end)
	end)

	if not success then
		warn("Save failed:", err)
		return
	end

	if improved then
		SafeUpdateGui()
	end
end)

end

– FETCH
local function FetchLeaderboard()

LAST_FETCH = LAST_FETCH or 0

local now = os.clock()
local canFetch = (now - LAST_FETCH) >= FETCH_COOLDOWN

if GLOBAL_FETCH_LOCK then
	return
end

GLOBAL_FETCH_LOCK = true

task.delay(2, function()
	GLOBAL_FETCH_LOCK = false
end)

local success, result = pcall(function()
	return GetStore():GetSortedAsync(false, 10)
end)

if not success or not result then
	warn("Fetch failed")
	LeaderboardCache = {}
	return
end

local pages = result:GetCurrentPage()

local newData = {}

for rank, data in ipairs(pages) do

	-- 🔥 SAFETY CHECK (IMPORTANT FIX)
	if typeof(data.value) ~= "number" then
		continue
	end

	local userId = data.key
	local raw = data.value

	-- avoid negative confusion
	local score = math.abs(raw) / 100

	local name = "[Unknown]"
	pcall(function()
		name = Players:GetNameFromUserIdAsync(userId)
	end)

	table.insert(newData, {
		Name = name,
		Score = score,
		Rank = rank
	})
end

LeaderboardCache = newData

end

– UPDATE GUI
function UpdateGui()
FetchLeaderboard()

-- clear
for _, v in pairs(script.Parent:GetChildren()) do
	if v.Name == "Player" then
		v:Destroy()
	end
end

-- ALWAYS show something (important fix)
if #LeaderboardCache == 0 then
	for i = 1, 5 do
		local Frame = CreateGui()
		Frame.Name = "Player"
		Frame.Parent = script.Parent

		Frame.Position = UDim2.new(0.05, 0, i * 0.08, 0)

		Frame.PlayerName.Text = "No Data"
		Frame.Place.Text = "-"
		Frame.Score.Text = "0.00"
	end
	return
end

for i, v in ipairs(LeaderboardCache) do
	local Frame = CreateGui()
	Frame.Name = "Player"
	Frame.Parent = script.Parent

	Frame.Position = UDim2.new(0.05, 0, i * 0.08, 0)

	Frame.PlayerName.Text = v.Name
	Frame.Place.Text = tostring(v.Rank)
	Frame.Score.Text = string.format("%.2f", v.Score)
end

end

– PLAYER JOIN
Players.PlayerAdded:Connect(function(player)
local speedrun = player:WaitForChild(“Speedrun”)

local function connectStat()
	local statName = GetStat()
	local statValue = speedrun:WaitForChild(statName)

	statValue.Changed:Connect(function()
		task.wait(3)
		SavePlayer(player)
	end)
end

connectStat()
task.wait(2)
SafeUpdateGui()

end)

– PLAYER LEAVE
Players.PlayerRemoving:Connect(function(player)
SavePlayer(player)
end)

– :fire: IMPORTANT: run once on start
task.defer(SafeUpdateGui)

I tried adding delay so many place but it keeps doom, please help.

First thing they are really not hard to learn and second could you actually format your code so its easy to read?

And third, the error you’ve made the title is because you’re calling too many datastore requests. I would help you point out where the problem is (and that you’d probably have to rewrite the datastore system), but as mentioned, the code is unreadable.

Hey, have you looked into using something like ProfileService? It actually handles all data handling for you with roblox DataStore service. The whole post also contains many tutorials for setting up and making example systems which you might find useful.

Your approach has a fundamental DataStore architecture problem. Cloning 50 leaderboards and firing DataStore requests from each one simultaneously will absolutely flood your request queue — you’re hitting the wall that Roblox is warning you about.Here’s what’s happening:- Each cloned leaderboard script is independently calling DataStore methods- 50 scripts × fetch intervals = request pile-up- DataStore has a hard limit (~6,000 requests/minute per store), and queue drops are permanent data loss**The fix: Centralize your DataStore logic.**Instead of having every cloned board fetch its own data:1. Use one DataStore manager script (ServerScriptService) that fetches all 50 stats once per cooldown cycle2. Push results to RemoteEvents that your UI clones listen to3. Remove DataStore calls from individual board scriptslua-- ServerScriptService: CentralDataStoreManagerlocal DataStoreService = game:GetService("DataStoreService")local ds = DataStoreService:GetDataStore("LeaderboardStats")local UpdateSignal = Instance.new("RemoteEvent", ReplicatedStorage)UpdateSignal.Name = "LeaderboardUpdate"while true do task.wait(35) -- Your cooldown local stats = {} for _, creature in pairs(workspace:WaitForChild("Creatures"):GetChildren()) do local success, value = pcall(function() return ds:GetAsync(creature.Name) end) if success then stats[creature.Name] = value or 0 end end UpdateSignal:FireAllClients(stats)endEach cloned board listens to one RemoteEvent instead:lualocal UpdateSignal = ReplicatedStorage:WaitForChild("LeaderboardUpdate")local statName = script.Parent.Parent.Stat.ValueUpdateSignal.OnClientEvent:Connect(function(allStats) script.Parent.Value = allStats[statName] or 0end)This drops your requests from 50 per cycle to 1, and you control the exact frequency. No more queue warnings.