Issue Saving Datastores

I have a datastore, I started with 5,000 Cash, then I went into game and I got to about 5,500, then I rejoined with only 5,011

This is my script

local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("CashSaveSystem")
local part = game.Workspace.Part

game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder",player)
leader.Name = "leaderstats"
local Cash = Instance.new("IntValue",leader)
Cash.Name = "Money"
Cash.Value = ds:GetAsync(player.UserId) or 5000
ds:SetAsync(player.UserId, Cash.Value)
Cash.Changed:connect(function()
ds:SetAsync(player.UserId, Cash.Value)
end)
end)
game.Players.PlayerRemoving:connect(function(player)
ds:SetAsync(player.UserId, player.leaderstats.Cash.Value)
end)

function onMouseClick(player)
local Cash = player.leaderstats.Money
Cash.Value = Cash.Value + 1
end

part.ClickDetector.MouseClick:connect(onMouseClick)
Cash.Changed:connect(function()
    ds:SetAsync(player.UserId, Cash.Value)
end)

The reason why it’s not saving their data is because you’re saving it way too often. Set up a loop that will iterate through all the players and save their data every few minutes or so.