The script won't save the money in studio.
Here is the code:
local DSS = game:GetService("DataStoreService")
local Money = DSS:GetDataStore("Cash")
game.Players.PlayerAdded:Connect(function(plr)
local pCash = Money:GetAsync(plr.UserId)or 10
local leaderstats = Instance.new("Folder",plr)
leaderstats.Name = "leaderstats"
local CashValue = Instance.new("NumberValue")
CashValue.Name = "Cash"
CashValue.Value = pCash
CashValue.Parent = leaderstats
CashValue.Changed:connect(function(v)
Money:SetAsync(plr.UserId,v)
end)
end)
I hope you can help, thank you!
Because studio cant use datastore service, test it in published game.