Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

DataStore request was added to queue?

This code saves the players in game clothes in a clothes folder. I keep getting the "DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 2Clothes-8762695 (x2)"

I have no idea what this means or how to fix it. Here are some excerpts from my script that may be involved in this error.

local key = "2Clothes-"..player.UserId	

local saved = {}
	for i,v in pairs(player.Clothes:GetChildren()) do
		if v.Name ~= "CurrentClothes" then
			table.insert(saved, v.Name)
			ds:SetAsync(key, saved)
		end
	end
	
end)

Again I have no idea what this is or how to fix it so anything helps. Thank you!

1 answer

✓ Accepted answer

You're calling the datastore a bunch and the game doesn't like that. You're also saving over the last value you inserted in the datastore every time you save something to the datastore in the loop. Instead, you can keep all the close in the saved table and then save that singular table to the datastore.

local key = "2Clothes-"..player.UserId  

local saved = {}

for i,v in pairs(player.Clothes:GetChildren()) do
	if v.Name ~= "CurrentClothes" then
		table.insert(saved, v.Name)
        end
end

ds:SetAsync(key, saved)

2 comments

0

Perfect that works! I understand now. Thank you

0

glad it worked

This discussion is preserved as it was. New answers, comments, and votes are closed.