Roblox 'DataStore request was added to queue' Warning – Fix
The error
DataStore request was added to queue. If request queue fills, further requests will be dropped.
What it means
You're calling the DataStore faster than the per-server request budget allows, typically saving on every change or in a tight loop, or writing the same key more than once every 6 seconds.
The fix
local DataStoreService = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local store = DataStoreService:GetDataStore("PlayerData")
local function save(player)
local data = { Coins = player.leaderstats.Coins.Value }
local ok, err = pcall(function()
store:UpdateAsync("Player_" .. player.UserId, function() return data end)
end)
if not ok then warn("Save failed:", err) end
end
Players.PlayerRemoving:Connect(save)
game:BindToClose(function()
for _, p in ipairs(Players:GetPlayers()) do save(p) end
end)Keep data in memory while the player is in-game and save on leave, on shutdown and, at most, on a slow autosave timer (e.g. every few minutes). Enable Studio API access to test.
Related tools: Roblox script generator · Roblox Lua error fixer · all script generators