How do I copy a part that I have instead of making a new part?
I am trying to make a tycoon with droppers, a specific dropper has the following code inside it:
02 | workspace:WaitForChild( "PartStorage" ) |
06 | local part = Instance.new( "Part" ,workspace.PartStorage) |
07 | part.BrickColor = script.Parent.Parent.Parent.DropColor.Value |
08 | part.Material = script.Parent.Parent.Parent.MaterialValue.Value |
09 | local cash = Instance.new( "IntValue" ,part) |
12 | part.CFrame = script.Parent.Drop.CFrame - Vector 3. new( 0 , 1.4 , 0 ) |
13 | part.FormFactor = "Custom" |
14 | part.Size = Vector 3. new( 1.2 , 1.2 , 1.2 ) |
15 | part.TopSurface = "Smooth" |
16 | part.BottomSurface = "Smooth" |
17 | game.Debris:AddItem(part, 20 ) |
My question is; how would I change this script so that it copies the part located at script.Parent.DropPart instead of creating an entirely new part?
I am new to Roblox lua so explanations in detail would be helpful, thanks!