do local P={Modifiable=function(P)for l=1,#actionButtons,1 do actionButtons[l].Obj.Visible=P and Option.Selectable end cancelReparentDrag()end;Selectable=function(P)for l=1,#actionButtons,1 do actionButtons[l].Obj.Visible=P and Option.Modifiable end cancelSelectDrag()Selection:Set({})end}local l=explorerPanel:FindFirstChild("\083\101\116\079\112\116\105\111\110")if not l then l=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"})l.Parent=explorerPanel end l.OnInvoke=function(l,L)if P[l]then Option[l]=L P[l](L)end end local L=explorerPanel:FindFirstChild("\071\101\116\079\112\116\105\111\110")if not L then L=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"})L.Parent=explorerPanel end L.OnInvoke=function(P)if P then return Option[P]else local P={}for l,L in pairs(Option)do P[l]=L end return P end end end function SelectionVar()return Selection end Input.InputBegan:connect(function(P)if P.KeyCode==Enum.KeyCode.LeftControl then HoldingCtrl=true end if P.KeyCode==Enum.KeyCode.LeftShift then HoldingShift=true end end)Input.InputEnded:connect(function(P)if P.KeyCode==Enum.KeyCode.LeftControl then HoldingCtrl=false end if P.KeyCode==Enum.KeyCode.LeftShift then HoldingShift=false end end)while RbxApi==nil do RbxApi=GetApiRemote:Invoke()wait()end explorerFilter.Changed:connect(function(P)if P=="\084\101\120\116"then rawUpdateList()end end)CurrentInsertObjectWindow=CreateInsertObjectMenu(GetClasses(),"",false,function(P)CurrentInsertObjectWindow.Visible=false local l=(SelectionVar()):Get()for L=1,#l,1 do pcall(function()Instance.new(P,l[L])end)end DestroyRightClick()end)


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
		rawUpdateList()
	end
end)

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