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.