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. What i need to do?

Asked by 3 years ago

I'm trying to do data saving for my game. Can anyone help?

game.Players.PlayerRemoving:Connect(function(player)
    local Worked, Errorey = pcall(function()
        local data = game:GetService("DataStoreService"):GetDataStore("Data")
        data:SetAsync(player.UserId, game.ReplicatedStorage.Cash.Value)
        data:SetAsync(player.UserId, game.ReplicatedStorage.Rebirth.Value)
        data:SetAsync(player.UserId, game.ReplicatedStorage.X5.Value)
        data:SetAsync(player.UserId, game.ReplicatedStorage.X2.Value)
    end)
    if Worked then
        print("Okay,i saved data store. Fuw-w-w!")
    else
        warn(Errorey)   
    end
end)

( I'm bad at programming lol )

0
you have the players value in ReplicatedStorage? johnoscarbhv1 137 — 3y
0
I don't know English well (I'm Russian), so can you explain what exactly? KarmaForevor 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

You are saving too frequently therefore it adds it to a queue because you are saving too frequently. Maybe add a wait() for saving.

Ad

Answer this question