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

With my house datastore I keep running into this error
DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key (Numbers)
Here is the data saving script
Any help would be much appreciative

local DataStoreService = game:GetService("DataStoreService")

local MainData = DataStoreService:GetDataStore("MainData")

local HouseData = DataStoreService:GetDataStore("HouseData")

--Variables--

function saveHouseData(player)



	local Houses = {}

	for i, value in pairs(player.Houses:GetChildren()) do

	

		Houses[value.Name] = value.Value

	

	end

	HouseData:SetAsync(player.UserId, Houses)

end

--House Data--

game.Players.PlayerAdded:Connect(function(player)



	local Plot = Instance.new("StringValue")

	Plot.Name = "Plot"

	Plot.Value = ""

	Plot.Parent = player

	

	local Houses = Instance.new("Folder")

	Houses.Name = "Houses"

	Houses.Parent = player

	

	for i, house in pairs(game.ReplicatedStorage.Houses:GetChildren()) do

		local newValue = Instance.new("BoolValue")

		newValue.Name = house.Name

		newValue.Value = false

		newValue.Parent = Houses

		

	end

	local houseData = HouseData:GetAsync(player.UserId) or {}

	

	for houseName, houseValue in pairs(HouseData) 

		Houses[houseName].Value = houseValue

	end

end)





--House Saving--

game.Players.PlayerRemoving:Connect(function(player)

	if game.Workspace:FindFirstChild(player.Name.."'sHouse") then

		game.Workspace:FindFirstChild(player.Name.."'sHouse"):Destroy()

	end	

	local PlayerPlot = player.Plot

	

	game.Workspace:FindFirstChild(PlayerPlot.Value).CurrentOwner.Value = ""

	player.Plot.Value = ""

	end)

	

game.Players.PlayerRemoving:Connect(saveHouseData)

game:BindToClose(function()

	for i, player in pairs(game.Players:GetPlayers()) do

		saveHouseData(player)

		end

end)

Thiss is probably the reason you are getting this error

1 Like

OK what should I change it to then if that’s what gives me the error or do I need to remove that part

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.