Hi, I'm trying to create a for loop that gets variables inside the players folder but every time I try I get and error or I only get one. For what I'm doing I can't use json it needs to be a global variable because I need to be able to script adding new values.
game.Players.PlayerRemoving:Connect(function(player)--player leaving the game
local save = {}--the table of data
for _, Child in pairs(player.chars:GetChildren()) do --gets the children of the chars folder
table.insert(save, Child.Value) --should insert the children in but it only inserts one
end
dataStore:SetAsync(player.UserId, save)--saves the table
end)
