Saving a table and loading it

local main = {
	textChilling = false,
	textOG = false
	
}

for i,v in pairs(main) do
	if v == false then
		print(i)
	end
end

How would I go about saving main(variable) and also loading it back in. I have a decent understanding on using datastores to save single info. Would I go abouts looping all the data and saving it/loading it shown at the bottom of the code? Or am I completely wrong?

You don’t even need a loop, you can just save the table main.
Here’s a guide on how to use DataStore:

To access the data: table.textChilling / table.textOG

What if I where to add another item to the table? Would I have to do table.[name]? Is there a way I could make this automatic/not need to be manually added to the whole code?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.