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

Fix? Pls help error Portals Save System or DataStore for Portals

Asked by 2 years ago

Pls Help

Error - DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 1744613578

Code

    local dss = game:GetService("DataStoreService")
    local sv = dss:GetDataStore("Save1")

game.Players.PlayerAdded:Connect(function(plr)
    for i,v in pairs(game.Workspace.Teleports:GetChildren()) do
        local tp = v.Bought

        local data
        local succ, err = pcall(function()
            data = sv:GetAsync(plr.UserId, v.Bought.Value)
        end)

        if succ then
            tp.Value = data
            print("Succ")
        end
        end
end)
for i,v in pairs(game.Workspace.Teleports:GetChildren()) do
game.Players.PlayerRemoving:Connect(function(plr)
        local data = v.Bought.Value

        local succ,err = pcall(function()
            sv:SetAsync(plr.UserId, v.Bought.Value)
        end)

        if succ then
            print("Data Saved")
        else
            print("Error Data")
            warn(err)
        end
    end)
end

Answer this question