This isn’t what I meant, I know I can’t save GUI’s. What I wanted to do is have values in a folder named, be saved when a player leaves. And when the player joins again I want it to load those values and get the gui/frame from serverstorage by using the value name.
local ServerStorage = game:GetService("ServerStorage")
for _, value in ipairs(ServerStorage:GetChildren()) do
if inventory[value.Name] then
local GuiClone = value:Clone()
-- set the clone's parent, a basic example
end
end
For loading it back in when the player joins would I make a loop, finding the value name in a folder and cloning it? For example I had like a accessory.
Also, I wanna ask that your values are pre-added and you need to set the value of that values ? I mean like as you save leaderstats, you have an IntValue that you know is gonna be added, so you save the value and load that value in the IntValue.
When a player purchases something it creates a value named by that thing they purchased (this value will be put into that folder). (The thing they purchased will show up on an equip gui or some sort)
When the player leaves it saves that whole folder with the values.
When they join back it loads the data, creates values and puts it into that folder. Then it will find all the items that the player has purchased using the values and puts it onto the gui using :clone (there will be a main folder with all of the item guis.)
Ok, so I was right. Add the value to the folder (String or IntValue because they are objects) when someone purchased something and add it to a table, then if the player leaves, save the table, and after the player joins, loops through the table and insert a new value using Instance.new and the parent should be the folder
I kind of read in the documentation that you can create your own DataStore and you can use this to save each thing in a specific GUI slot like this:
local dss = game:GetService("DataStore")
local 1slot = dss:GetDataStore("FirstSlotDataStore")
-- and further
-- when players leaving:
1slot:SetAsync(Player.UserId, "ItemName")
2slot:SetAsync(Player.UserId, "ItemName")
-- and further
Im not sure exactly about this information, I advise you to check the documentation for reliability
You can’t save many values indivisually, save it using tables and saving it in multiple datastore isn’t the way, he said you can buy many things, so we don’t know how much datastores to make and even if it’s possible, it’ll be too much complicated.