Selection.Changed:Connect(FocusOnLastSelectedPart)function GetCore()return require(script.Parent)end local function K(L,M)local J=M or{}for L,M in pairs(L:GetChildren())do if IsVisible(M)then J[#J+1]=M else K(M,J)end end return J end
-- Listen for changes to the selection and keep the focus updated
Selection.Changed:Connect(FocusOnLastSelectedPart)

function GetCore()
	-- Returns the core API
	return require(script.Parent)
end

local function GetVisibleChildren(Item, Table)
	local Table = Table or {}

	-- Search for visible items recursively
	for _, Item in pairs(Item:GetChildren()) do
		if IsVisible(Item) then
			Table[#Table + 1] = Item
		else
			GetVisibleChildren(Item, Table)
		end
	end

	-- Return visible items
	return Table
end
