****PLAYER IS NOT A VALID MEMBER OF DATAMODEL
local DataStore = game: GetService("DataStoreService") local ds = DataStore:GetDataStore("CashSaveSystem")
game.Players.PlayerAdded:connect(function(player) local leader = Instance.new("Folder",player) leader. Name = "leaderstats" local Cash = Instance.new("IntValue", leader) Cash.Name = "Cash" Cash.Value = ds:GetAsync(player.UserId) or 0 Cash.Changed:connect(function() ds:SetAsync(player.UserId, Cash.Value)
end)
end)
game.Player.PlayerRemoving:connect(function(player) ds:SetAsync(player.UserId, player.leaderstats.Cash.Value) end)

3 comments
https://scriptinghelpers.org/help/how-post-good-questions-answers
game.Player.PlayerRemoving--> game.Players.PlayerRemovingWondering if this is actually OP's code. OP had taken an alvinbloxx script... :thonk: