of     1   

rudolph101
#185258395Sunday, March 13, 2016 4:15 PM GMT

I have a bunch of values I need saving and loading. Saving isn't a problem because I save them one at a time everytime they change, but loading the values into the game takes ages. I have about 30ish values I need loading in. Is there a better technique I can use?
chimmihc
#185258485Sunday, March 13, 2016 4:16 PM GMT

The problem is your code.
rudolph101
#185258820Sunday, March 13, 2016 4:21 PM GMT

for f, folder in pairs(script.Parent:GetChildren()) do if folder:IsA("Folder") then for v, value in pairs(folder:GetChildren()) do value.Value = DataStore:GetAsync(value.Name..id) end end end This is my code. So every value is in a specific folder, this loads up the value.
ThoughtConduit
#185258898Sunday, March 13, 2016 4:23 PM GMT

store it all together so you only use GetAsync once.
rudolph101
#185259065Sunday, March 13, 2016 4:25 PM GMT

How would I do that?
jode6543
#185261388Sunday, March 13, 2016 5:04 PM GMT

Store them in a table when you save them: local t = {} for _, folder in pairs(script.Parent:GetChildren()) do if folder:IsA("Folder") then for _, value in pairs(folder:GetChildren()) do t[value.Name] = value.Value end end end dataStore:SetAsync("data", t) Then, when you call GetAsync, you'll get the table back all at once.
rudolph101
#185262882Sunday, March 13, 2016 5:28 PM GMT

Thank you very much jode! It works like a charm!

    of     1