Hi, I've lately started practising with DataStores; I've been aiming to try and save multiple values at once. So far this has worked; I've now encountered the issue of essential reverse engineering the method in an attempt to re-call the values when loading.
Below is the method of saving, but as I said I'm struggling to reverse this.
Does anybody have any suggestions?
function System.DataSave(Player)
local PlayerData = Player:WaitForChild('PlayerData')
local Saves = {}
Saves.isPlaying = PlayerData.isPlaying.Value
local configs = {"CharacterData", "StarShipData", "Unlocked"}
for _, config_name in pairs(configs) do
local config = PlayerData[config_name]
Saves[config_name] = {}
for _, ValueObject in pairs(config:GetDescendants()) do
Saves[config_name][ValueObject.Name] = ValueObject.Value
end
end
DS1:SetAsync(Player.UserId, Saves)
end

1 comment
is there any error in the output?