Here is the script I used to script my currency that saves.
--Datastore service
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)
print("MoneySaved!")
end)
end)

1 comment
dekkeda it is incorrect