DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Data Store

There is more but they are for something else

Okay there seems to be some confusion here, let me explain it more carefully.

In this script below you save with the key thats the UserId of the player. This script itself should work fine!

-- main datastore script
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("DataStoreV3")

game.Players.PlayerAdded:Connect(function(player)
	local key = player.UserId
	local data = DataStore:GetAsync(key)
end)

game.Players.PlayerRemoving:Connect(function(player)
	local key = player.UserId
	local success,msg = pcall(function()
		DataStore:SetAsync(key,32423424)
	end)

	if success then
		print("Data Saved!")
	else
		warn(msg)
	end
end)

Until we have another script that also does something with datastore. As you can see here we also save when the player leaves the server, and we also save it with the same exact key! Which is the user their UserId. so you see the problem here is that there are datastore limits. You can not save data with the same key too frequently. There has to be a 6 second interval. Which in this case there isnt cause we immediately save the data when the player leaves with the same key.

-- Second datastore script

local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("DataStoreV3")

-- Some code bla bla bla

-- Oh yeah the player left!
game.Players.PlayerRemoving:Connect(function(player)
	local key = player.UserId
	local success,msg = pcall(function()
		DataStore:SetAsync(key,32423424)
	end)

	if success then
		print("Data Saved here too!")
	else
		warn(msg)
	end
end)

This can be fixed by just using different keys in a script. Lets change the key in the second datastore script.

-- Second datastore script

local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("DataStoreV3")

-- Some code bla bla bla

-- Oh yeah the player left!
game.Players.PlayerRemoving:Connect(function(player)
	local key = player.UserId.."_SecondKey" -- We changed the key here
	local success,msg = pcall(function()
		DataStore:SetAsync(key,32423424)
	end)

	if success then
		print("Data Saved here too!")
	else
		warn(msg)
	end
end)

And to get the data back we must use the same key!

local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("DataStoreV3")

game.Players.PlayerRemoving:Connect(function(player)
	local key1 = player.UserId.."_SecondKey"
	local data1 = DataStore:GetAsync(key1)
	
	local key2 = player.UserId
	local data2 = DataStore:GetAsync(key2)
	
	print(data1)
	print(data2)
end)
1 Like

Simple solution. Datastore:updateasync() can handle it with no limits. Unless ur game is huge about 155 million people so you would use datastore 2

UpdateAsync still needs a 6 second interval between saves so it should still not fix the problem

Add a wait(6) when function is called (task.wait(6) is better)

No, just make fewer requests to the DataStore(s) functions in your game.

I am not going to lie but I am still confused, I might not do a second datastore because my game isn’t released yet

I fixed the problem I was saving the same like stats value to many times in some other scripts, thank you for everyone that helped!

1 Like