local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore ("CashSaveSystem")
game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder")
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.Players.PlayerRemoving:Connect(function(player)
ds:SetAsync(player.UserId, player.leaderstats.Cash.Value)
end)
COMMUNITY QUESTION
Cash is not a valid member of folder how to fix??
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
The parent argument of Instance.new is deprecated. Don't use it