game.Players.PlayerAdded:connect(function(a)local s=Instance.new("\070\111\108\100\101\114",a)s.Name="\108\101\097\100\101\114\115\116\097\116\115"local z=Instance.new("\073\110\116\086\097\108\117\101",s)z.Name=stat z.Value=ds:GetAsync(a.UserId)or startamount ds:SetAsync(a.UserId,Money.Value)z.Changed:connect(function()ds:SetAsync(a.UserId,Money.Value)end)end)game.Players.PlayerRemoving:connect(function(a)ds:SetAsync(a.UserId,a.leaderstats.Money.Value)end)

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

game.Players.PlayerRemoving:connect(function(player)
ds:SetAsync(player.UserId, player.leaderstats.Money.Value) --Change "Points" to the name of your leaderstat.
end)
