-- Returns topmost ancestor in hierarchy descending from points folder

local function getTopAncestor(part)
	local prevParent = part
	local parent = part.Parent
		
	while not parent:IsA("Folder") do
		prevParent = parent
		parent = parent.Parent
	end
		
	return prevParent
end

local function getPositionRelativetoBase(part, pos)
	local basePlate = workspace:FindFirstChild("Baseplate")
	local basePosition = basePlate:GetChildren()[1].Position
	local baseSize = basePlate:GetChildren()[1].Size
	
	local posY = pos.Y
	local basePosY = basePosition.Y
	local baseSizeY = baseSize.Y
	return Vector3.new(pos.X, (basePosY + baseSizeY/2) + part.Size.Y/2, pos.Z)
end
	
local function breakModel(model)
	local children = model:GetChildren()
		
	for i,child in pairs(children) do
		-- Make part/model non-collidable
		if child:IsA("Model") then
			breakModel(child)
		elseif child:IsA("Part") then
			child.CanCollide = false
		end
	end
end
