So, I have a clicker clicking at 0.1s speed and a datastore is saving a value, but after about 20 clicks it starts coming up with an error and stops saving the value. Help please?
function newData(statType,startingAmt,datastore,Name,Parent,player) local test = Instance.new(statType,Parent) test.Name = Name test.Value = datastore:GetAsync(player.UserId) or startingAmt datastore:SetAsync(player.UserId, test.Value) test.Changed:Connect(function() datastore:SetAsync(player.UserId, test.Value) end) game.Players.PlayerRemoving:Connect(function(player) datastore:SetAsync(player.UserId, player.stats[Name].Value) end) end
Use Debounce Bruh
I figured it out myself.
I moved the PlayerRemoving function to the end of the script and switched the datastores to the datastores that are being saved.
Same with the Value of what i'm saving.