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 )
You are saving too frequently therefore it adds it to a queue because you are saving too frequently. Maybe add a wait() for saving.