Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

DataStore request was added to queue?

Asked by 5 years ago
Edited 5 years ago

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

Log in to vote
1
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago

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)

0
Perfect that works! I understand now. Thank you cooldrewbie 94 — 5y
0
glad it worked royaltoe 5144 — 5y
Ad

Answer this question