This is getting all the values inside of a folder however it errors because there's another folder inside of it called "PlayerAbilities" How would I make it ignore PlayerAbilities when it does "GetChildren()"
SaveStats = function(Player)
local UserId = Player.UserId
PlayerStats[UserId] = {}
for i,v in next, GlobalStats[UserId]:GetChildren() do
PlayerStats[UserId][v.Name] = v.Value
end
if VerifySavedData then
print(Player,UserId)
for i,v in next, PlayerStats[UserId] do print(i,v) end
end
end

1 comment
As general advice: designs tend to work better when they talk in terms of what you want to INCLUDE rather than what you want to EXCLUDE (because it makes changing design in future easier!)