Hi there! I am making an open world structure building game, and I would like to know how to save (a wall, for example; which is 1 part) and the CFrame of it.
I know what DataStores are, and I know how to start a function when the player leaves. I have a StringValue inside each part that I want to save that tells the system that the part and it’s CFrame should be saved.
for instance, here is an example:
player1 leaves the game. → Position Saving System starts.
Part and CFrame is put into a table.
player1 joins the game. → Part and CFrame are inserted back into the workspace.
Also, let me know if there is a different way to do this.
You can do this by saving the Part name and position in a dictionary.
local Parts = Model:GetChildren()
local SaveParts = {}
for i,v in pairs (Parts) do
SaveParts[v] = v.CFrame
end
-- Save the SaveParts table to the players key