local DStoreService = game:GetService("DataStoreService") local CashStore = DStoreService:GetDataStore("Cash")
game.Players.CharacterAdded(function(plr)
local MaxHealth = game.Workspace:WaitForChild("player.Name"):WaitForChild("Humanoid").MaxHealth
local CashValue = plr:WaitForChild("leaderstats"):WaitForChild("Cash").Value
CashStore:SetAsync("plr_"..plr.UserId, CashValue, MaxHealth)
end)
game.Players.PlayerRemoving:Connect(function(plr) local MaxHealth = game.Workspace:WaitForChild("player.Name"):WaitForChild("Humanoid").MaxHealth local CashValue = plr:WaitForChild("leaderstats"):WaitForChild("Cash").Value CashStore:GetAsync("plr_"..plr.UserId, CashValue, MaxHealth) end)
