Answered by
8 years ago Edited 8 years ago
This can be done by storing each part's individual properties. For example, if you wanted to save a 5x5 part, you could do this:
1 | local Data = game:GetService( "DataStoreService" ):GetDataStore( "~PARTS" ) |
2 | local Part = Instance.new( "Part" ) |
3 | Part.Name = "PartToSave" |
4 | Part.Size = Vector 3. new( 5 , 5 , 1 ) |
5 | Part.CFrame = CFrame.new( 10 , 10 , 10 ) |
7 | DataStore:SetAsync(Part.Name, { Part.Size, Part.CFrame } ) |
and then when you want to load it, you could do:
1 | local Data = game:GetService( "DataStoreService" ):GetDataStore( "~PARTS" ) |
2 | local PartData = DataStore:GetAsync( "PartToSave" ) |
3 | local Piece = Instance.new( "Part" ) |
4 | Piece.Size = PartData [ 1 ] |
5 | Piece.CFrame = PartData [ 2 ] |
6 | Piece.Parent = workspace |
For more information on DataStore, read up on this article: https://scriptinghelpers.org/blog/data-store-why-you-should-get-excited
Please note that I wrote this all in the ScriptingHelper's answer section, and this was only made to give you an idea on how to do it.