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

DataStore problems, Causing "not running script because past shutdown deadline"?

Asked by 5 years ago
game.Players.PlayerRemoving:Connect(function(player) -- when player leaves
    local ID = currencyName.."_"..player.UserId
    DataStore:SetAsync(ID,{player.leaderstats[currencyName].Value,
        player.leaderstats[currencyName2].Value,
    player.leaderstats[currencyName3].Value})
end)

game:BindToClose(function() -- when game is shutting down
    for i, player in pairs(game.Players:GetPlayers()) do
        if player then
            local ID = currencyName.."_"..player.UserId
            DataStore:SetAsync(ID,{player.leaderstats[currencyName].Value,
            player.leaderstats[currencyName2].Value,
            player.leaderstats[currencyName3].Value})
        end
    end
end)

Error caused: Not running script because past shutdown deadline

Can't seem to figure out what is causing it as it shouldn't take 30seconds to save to the datastore, which is the only thing both of these do.. Anyone got any clues to what I am doing wrong?

Thanks in advance.

0
I got that too, I think it is because of the Bind to close. idk how to fix it though greatneil80 2647 — 5y
0
It is.The game needs to shut down eventually. User#19524 175 — 5y
0
It takes a long time to shutdown though now :/ Dogszss 0 — 5y
0
Same here. It gives me this error but it saves. xJathur95x 129 — 5y

Answer this question