Need help with scripts

Hello!I wrote two scripts,one creates instance parts, the other removes them.
Script for creating instance parts

local Spawn = script.Parent

Spawn.MouseButton1Click:Connect(function()
	local Part =Instance.new("Part")
	Part.Size=Vector3.new(4, 1, 2)
	Part.Position=Vector3.new(-11.202, 47.42, -81.4)
	Part.CastShadow = false
	Part.Anchored = false
	Part.Parent=workspace.Folder
	
end)

Script to remove instance parts

local Delete = script.Parent

Delete.MouseButton1Click:Connect(function()
	game.Workspace.Folder:Destroy()
	
end)

The problem is that the script deletes the folder in which the parts instance is located. I have no options on how to make the script delete the parts, but not the folder.

Bye! :wave:

eh the instance parent is the folder so the instance should be located on the folder’s childrens

game.Workspace.Folder.Part:Destroy()

or if you want to remove all the instance inserted in da folder

game.Workspace.Folder:ClearAllChildren()
1 Like

Thanks!How could I do not think of this?