Locker, gui that saves

I have made a topic like this before, I’m wondering how I could make like an inventory GUI that saves. So I could easily add things to a players inventory. For example if they bought a customization to their car like a spoiler and it would add it to the GUI and save when the player rejoins.

You can load and save one table that contains information about everything they own

Sorry not information about everything they own, but just their id

You might want to consider checking out this guide, it will teach you how to use DataStores to make player data get carried when they leave and rejoin.
To save the GUI, you would want to make a function to convert the GUI into a savable format (like a table, as @Veesuuu mentioned)
Then, make a function to unpack the table and convert it back into a GUI.

So I can use a table to save data, when I load this back in would I use a loop?

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

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

Before that I would load in the data and set it to false or true depending on their data? If so how would I go abouts doing this? Loading the data and setting the values to the data given to the player?