Hi, I made a simple datastore script.
local DSS = game:GetService("DataStoreService")
local SFKDSS = DSS:GetDataStore("SFKDSS")
local SFDDSS = DSS:GetDataStore("SFDDSS")
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = player:WaitForChild("leaderstats")
local Kills = leaderstats:WaitForChild("Kills")
local Deaths = leaderstats:WaitForChild("Deaths")
Kills.Value = SFKDSS:GetAsync(player.UserId, Kills.Value)
Deaths.Value = SFDDSS:GetAsync(player.UserId, Deaths.Value)
end)
game.Players.PlayerRemoving:Connect(function(player)
local leaderstats = player:WaitForChild("leaderstats")
local Kills = leaderstats:WaitForChild("Kills")
local Deaths = leaderstats:WaitForChild("Deaths")
SFKDSS:SetAsync(player.UserId, Kills.Value)
SFDDSS:SetAsync(player.UserId, Deaths.Value)
end)
game:BindToClose(function()
for _, player in pairs(game.Players:GetPlayers()) do
local leaderstats = player:WaitForChild("leaderstats")
local Kills = leaderstats:WaitForChild("Kills")
local Deaths = leaderstats:WaitForChild("Deaths")
SFKDSS:SetAsync(player.UserId, Kills.Value)
SFDDSS:SetAsync(player.UserId, Deaths.Value)
end
end)
But when I leave the game in Studio, I get this error
22:10:53.883 DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 461604490
I'm not sure why, someone please explain and present a solution. Thanks!

1 comment
Thank you