I'm making a place that will save multiple values and I was wondering if I could use an easier way for values?
local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("CashSaveSystem")
game.Players.PlayerAdded:connect(function(player)
local folder = Instance.new("Folder",player)
folder.Name = "places"
local stat = Instance.new("IntValue",folder)
stat.Name = "first"
stat.Value = ds:GetAsync(player.UserId) or 0
ds:SetAsync(player.UserId, stat.Value)
stat.Changed:connect(function()
ds:SetAsync(player.UserId, stat.Value)
end)
end)
game.Players.PlayerRemoving:connect(function(player)
ds:SetAsync(player.UserId, player.places.first.Value)
end)

2 comments
use an array to store all the values
do a for i,v in pairs on the values parent