local A=game:GetService("\068\097\116\097\083\116\111\114\101\083\101\114\118\105\099\101")local S=A:GetDataStore("\084\105\109\101\083\116\097\116\115")game.Players.PlayerAdded:Connect(function(A)local x=Instance.new("\070\111\108\100\101\114")x.Name="\108\101\097\100\101\114\115\116\097\116\115"x.Parent=A local v=Instance.new("\073\110\116\086\097\108\117\101")v.Name="\067\097\115\104"v.Value=0 v.Parent=x local M=S:GetAsync(A.UserId)if M then v.Value=M end end)game.Players.PlayerRemoving:Connect(function(A)S:SetAsync(A.UserId,A.leaderstats.Cash.Value)end)


local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("TimeStats")

game.Players.PlayerAdded:Connect(function(Player)
    local Leaderstats = Instance.new("Folder")
    Leaderstats.Name = "leaderstats"
    Leaderstats.Parent = Player
    local Cash = Instance.new("IntValue")
    Cash.Name = "Cash"
    Cash.Value = 0
    Cash.Parent = Leaderstats
    
    local Data = DataStore:GetAsync(Player.UserId)
    if Data then
        Cash.Value = Data
    end
    
    
    end)


game.Players.PlayerRemoving:Connect(function(Player)
    DataStore:SetAsync(Player.UserId, Player.leaderstats.Cash.Value)
end)
