do local v={Modifiable=function(v)for f=1,#actionButtons,1 do actionButtons[f].Obj.Visible=v and Option.Selectable end cancelReparentDrag()end,Selectable=function(v)for f=1,#actionButtons,1 do actionButtons[f].Obj.Visible=v and Option.Modifiable end cancelSelectDrag()Selection:Set({})end}local f=explorerPanel:FindFirstChild("\083\101\116\079\112\116\105\111\110")if not f then f=Create("\066\105\110\100\097\098\108\101\070\117\110\099\116\105\111\110",{Name="\083\101\116\079\112\116\105\111\110"})f.Parent=explorerPanel end f.OnInvoke=function(f,N)if v[f]then Option[f]=N v[f](N)end end local N=explorerPanel:FindFirstChild("\071\101\116\079\112\116\105\111\110")if not N then N=Create("\066\105\110\100\097\098\108\101\070\117\110\099\116\105\111\110",{Name="\071\101\116\079\112\116\105\111\110"})N.Parent=explorerPanel end N.OnInvoke=function(v)if v then return Option[v]else local v={}for f,N in pairs(Option)do v[f]=N end return v end end end function SelectionVar()return Selection end Input.InputBegan:connect(function(v)if v.KeyCode==Enum.KeyCode.LeftControl then HoldingCtrl=true end if v.KeyCode==Enum.KeyCode.LeftShift then HoldingShift=true end end)Input.InputEnded:connect(function(v)if v.KeyCode==Enum.KeyCode.LeftControl then HoldingCtrl=false end if v.KeyCode==Enum.KeyCode.LeftShift then HoldingShift=false end end)while RbxApi==nil do RbxApi=GetApiRemote:Invoke()wait()end explorerFilter.Changed:connect(function(v)if v=="\084\101\120\116"then Selection.Finding=true rawUpdateList()end end)explorerFilter.FocusLost:connect(function()if explorerFilter.Text==""then if Selection.Found[1]then scrollBar:ScrollTo(NodeLookup[Selection.Found[1]].Index)end Selection.Finding=false Selection.Found={}end end)CurrentInsertObjectWindow=CreateInsertObjectMenu(GetClasses(),"",false,function(v)CurrentInsertObjectWindow.Visible=false local f=(SelectionVar()):Get()for N=1,#f,1 do RemoteEvent:InvokeServer("\073\110\115\116\097\110\099\101\078\101\119",v,f[N])end DestroyRightClick()end)
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
---- Option Bindables

do
	local optionCallback = {
		Modifiable = function(value)
			for i = 1, #actionButtons do
				actionButtons[i].Obj.Visible = value and Option.Selectable
			end
			cancelReparentDrag()
		end,
		Selectable = function(value)
			for i = 1, #actionButtons do
				actionButtons[i].Obj.Visible = value and Option.Modifiable
			end
			cancelSelectDrag()
			Selection:Set({})
		end,
	}

	local bindSetOption = explorerPanel:FindFirstChild("SetOption")
	if not bindSetOption then
		bindSetOption = Create("BindableFunction", { Name = "SetOption" })
		bindSetOption.Parent = explorerPanel
	end

	bindSetOption.OnInvoke = function(optionName, value)
		if optionCallback[optionName] then
			Option[optionName] = value
			optionCallback[optionName](value)
		end
	end

	local bindGetOption = explorerPanel:FindFirstChild("GetOption")
	if not bindGetOption then
		bindGetOption = Create("BindableFunction", { Name = "GetOption" })
		bindGetOption.Parent = explorerPanel
	end

	bindGetOption.OnInvoke = function(optionName)
		if optionName then
			return Option[optionName]
		else
			local options = {}
			for k, v in pairs(Option) do
				options[k] = v
			end
			return options
		end
	end
end

function SelectionVar()
	return Selection
end

Input.InputBegan:connect(function(key)
	if key.KeyCode == Enum.KeyCode.LeftControl then
		HoldingCtrl = true
	end
	if key.KeyCode == Enum.KeyCode.LeftShift then
		HoldingShift = true
	end
end)

Input.InputEnded:connect(function(key)
	if key.KeyCode == Enum.KeyCode.LeftControl then
		HoldingCtrl = false
	end
	if key.KeyCode == Enum.KeyCode.LeftShift then
		HoldingShift = false
	end
end)

while RbxApi == nil do
	RbxApi = GetApiRemote:Invoke()
	wait()
end

explorerFilter.Changed:connect(function(prop)
	if prop == "Text" then
		Selection.Finding = true
		rawUpdateList()
	end
end)

explorerFilter.FocusLost:connect(function()
	if explorerFilter.Text == "" then
		if Selection.Found[1] then
			scrollBar:ScrollTo(NodeLookup[Selection.Found[1]].Index)
		end

		Selection.Finding = false
		Selection.Found = {}
	end
end)

CurrentInsertObjectWindow = CreateInsertObjectMenu(GetClasses(), "", false, function(option)
	CurrentInsertObjectWindow.Visible = false
	local list = SelectionVar():Get()
	for i = 1, #list do
		RemoteEvent:InvokeServer("InstanceNew", option, list[i])
	end
	DestroyRightClick()
end)
