Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Need help with saving values to a table, then saving the table?

This is not a request, just putting that out there, I know how to script a datastore, but I am curious, when you save values through a table in datastore, do you just put where the values are located in the table, and save the table the same way you would usually save a value?

I have never saved a values with a table before, I usually save the value itself.

1 answer

✓ Accepted answer

Here is how you would save a table to the DataStoreService:

local DS = game:GetService("DataStoreService"):GetDataStore("TableDS");

DS:SetAsync("Table", {"Apples", "Oranges", "Pineapples", "Grapes"});

You can get it like this:

local DS = game:GetService("DataStoreService"):GetDataStore("TableDS");

pcall(function()
	local test = DS:GetAsync("Table");
	print(test[1]);
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.