I've done Leaderstats but I don't know how to save values.
local DS = game:GetService("DataStoreService"):GetDataStore("Data") local StatName = "Cash" game.Players.PlayerAdded:Connect(function(user) user.leaderstats:FindFirstChild(StatName).Value = DS:GetAsync(user.UserId) end) game.Players.PlayerRemoving:Connect(function(user) DS:SetAsync(user.UserId,user.leaderstats:FindFirstChild(StatName).Value) end)
Save and load script. Basic save and load, It can be made better using UpdateAsync() but this will also work.
Take a look at this question's top answer, while the question isn't completely related, the answer should probably help you out
https://scriptinghelpers.org/questions/41698/how-to-save-multiple-values-in-a-datastore