local N={}local x=0 local o={}function filteringWorkspace()if explorerFilter.Text~=""and explorerFilter.Text~="\070\105\108\116\101\114 \087\111\114\107\115\112\097\099\101"then return true end return false end function lookForAName(N,x)for N,o in pairs(N:GetChildren())do if string.find(string.lower(o.Name),string.lower(x))then nameScanned=true end lookForAName(o,x)end end function scanName(N)nameScanned=false if string.find(string.lower(N.Name),string.lower(explorerFilter.Text))then nameScanned=true else lookForAName(N,explorerFilter.Text)end return nameScanned end function updateActions()for N,x in pairs(o)do if x.Cond()then x.Toggle(true)else x.Toggle(false)end end end local w,V,K,p do local function o(N)for w=1,#N,1 do if not filteringWorkspace()or scanName(N[w].Object)then TreeList[#TreeList+1]=N[w]local V=((((N[w].Depth*((2+ENTRY_PADDING)+GUI_SIZE)+2)+ENTRY_SIZE)+4)+getTextWidth(N[w].Object.Name))+4 if V>x then x=V end if N[w].Expanded or filteringWorkspace()then o(N[w])end end end end function p()scrollBarH.TotalSpace=x scrollBarH.VisibleSpace=listFrame.AbsoluteSize.x scrollBarH:Update()local N=scrollBarH:CanScrollDown()or scrollBarH:CanScrollUp()scrollBarH.GUI.Visible=N listFrame.Size=UDim2.new(1,-GUI_SIZE,1,-GUI_SIZE*(N and 1 or 0)-HEADER_SIZE)scrollBar.VisibleSpace=math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)scrollBar.GUI.Size=UDim2.new(0,GUI_SIZE,1,-GUI_SIZE*(N and 1 or 0)-HEADER_SIZE)scrollBar.TotalSpace=#TreeList+1 scrollBar:Update()end function V()TreeList={}x=0 o(N[workspace.Parent])if DexStorageEnabled then o(N[DexStorage])end if NilStorageEnabled then o(N[NilStorage])end p()updateActions()end local m=false function w()if m then return end m=true wait(.25)m=false V()end local E=false function K()if E then return end E=true wait(.25)E=false scrollBar:Update()end end local m do local x=explorerPanel:FindFirstChild("\071\101\116\083\101\108\101\099\116\105\111\110")if not x then x=Create("\066\105\110\100\097\098\108\101\070\117\110\099\116\105\111\110",{Name="\071\101\116\083\101\108\101\099\116\105\111\110"})x.Parent=explorerPanel end local o=explorerPanel:FindFirstChild("\083\101\116\083\101\108\101\099\116\105\111\110")if not o then o=Create("\066\105\110\100\097\098\108\101\070\117\110\099\116\105\111\110",{Name="\083\101\116\083\101\108\101\099\116\105\111\110"})o.Parent=explorerPanel end local w=explorerPanel:FindFirstChild("\083\101\108\101\099\116\105\111\110\067\104\097\110\103\101\100")if not w then w=Create("\066\105\110\100\097\098\108\101\069\118\101\110\116",{Name="\083\101\108\101\099\116\105\111\110\067\104\097\110\103\101\100"})w.Parent=explorerPanel end local K={}local p={}local E=true m={Selected=p;List=K}local function r(x)local o=false local w=false if not p[x]then local V=N[x]if V then table.insert(K,x)p[x]=true V.Selected=true V=V.Parent while V do if not V.Expanded then V.Expanded=true o=true end V=V.Parent end w=true end end return o,w end function m.Set(o,x)local E=false local B=false if#K>0 then for x=1,#K,1 do local o=K[x]local w=N[o]if w then w.Selected=false p[o]=nil end end K={}m.List=K B=true end for N=1,#x,1 do local o,w=r(x[N])E=o or E B=w or B end if E then V()B=true elseif B then scrollBar:Update()end if B then w:Fire()updateActions()end end function m.Add(x,N)local o,K=r(N)if o then V()if E then w:Fire()updateActions()end elseif K then scrollBar:Update()if E then w:Fire()updateActions()end end end function m.StopUpdates(N)E=false end function m.ResumeUpdates(N)E=true w:Fire()updateActions()end function m.Remove(V,x,o)if p[x]then local V=N[x]if V then V.Selected=false p[x]=nil for N=1,#K,1 do if K[N]==x then table.remove(K,N)break end end if not o then scrollBar:Update()end w:Fire()updateActions()end end end function m.Get(N)local x={}for N=1,#K,1 do x[N]=K[N]end return x end o.OnInvoke=function(...)m:Set(...)end x.OnInvoke=function()return m:Get()end end function CreateCaution(N,x)local o=CautionWindow:Clone()o.Title.Text=N o.MainWindow.Desc.Text=x o.Parent=explorerPanel.Parent o.Visible=true o.MainWindow.Ok.MouseButton1Up:connect(function()o:Destroy()end)end function CreateTableCaution(N,x)if type(x)~="\116\097\098\108\101"then return CreateCaution(N,tostring(x))end local o=TableCautionWindow:Clone()o.Title.Text=N local w=o.MainWindow.TableResults local V=o.MainWindow.TableTemplate for N,x in pairs(x)do local o=V:Clone()o.Type.Text=type(x)o.Value.Text=tostring(x)o.Position=UDim2.new(0,0,0,#w:GetChildren()*20)o.Parent=w w.CanvasSize=UDim2.new(0,0,0,#w:GetChildren()*20)o.Visible=true end o.Parent=explorerPanel.Parent o.Visible=true o.MainWindow.Ok.MouseButton1Up:connect(function()o:Destroy()end)end local function E(N,x)local o=1 local w={}while true do local V=string.find(N,x,o,true)if not V then break end table.insert(w,string.sub(N,o,V-1))o=V+string.len(x)end table.insert(w,string.sub(N,o))return w end local function r(N,x)if x=="\086\101\099\116\111\114\050"then local x=E(N,"\044")if#x<2 then return nil end local o=tonumber(x[1])or 0 local w=tonumber(x[2])or 0 return Vector2.new(o,w)elseif x=="\086\101\099\116\111\114\051"then local x=E(N,"\044")if#x<3 then return nil end local o=tonumber(x[1])or 0 local w=tonumber(x[2])or 0 local V=tonumber(x[3])or 0 return Vector3.new(o,w,V)elseif x=="\067\111\108\111\114\051"then local x=E(N,"\044")if#x<3 then return nil end local o=tonumber(x[1])or 0 local w=tonumber(x[2])or 0 local V=tonumber(x[3])or 0 return Color3.new(o/255,w/255,V/255)elseif x=="\085\068\105\109\050"then local x=E(string.gsub(string.gsub(N,"\123",""),"\125",""),"\044")if#x<4 then return nil end local o=tonumber(x[1])or 0 local w=tonumber(x[2])or 0 local V=tonumber(x[3])or 0 local K=tonumber(x[4])or 0 return UDim2.new(o,w,V,K)elseif x=="\078\117\109\098\101\114"then return tonumber(N)elseif x=="\083\116\114\105\110\103"then return N elseif x=="\078\117\109\098\101\114\082\097\110\103\101"then local x=E(N,"\044")if#x==1 then if tonumber(x[1])==nil then return nil end local N=tonumber(x[1])or 0 return NumberRange.new(N)end if#x<2 then return nil end local o=tonumber(x[1])or 0 local w=tonumber(x[2])or 0 return NumberRange.new(o,w)elseif x=="\083\099\114\105\112\116"then local x,o=ypcall(function()_G.D_E_X_DONOTUSETHISPLEASE=nil;(loadstring("\095\071\046\068\095\069\095\088\095\068\079\078\079\084\085\083\069\084\072\073\083\080\076\069\065\083\069 \061 "..N))()return _G.D_E_X_DONOTUSETHISPLEASE end)if o then return nil end else return nil end end local function B(N,x)if x=="\086\101\099\116\111\114\050"then local x=E(N,"\044")if#x<2 then return nil end local o=tonumber(x[1])or 0 local w=tonumber(x[2])or 0 return Vector2.new(o,w)elseif x=="\086\101\099\116\111\114\051"then local x=E(N,"\044")if#x<3 then return nil end local o=tonumber(x[1])or 0 local w=tonumber(x[2])or 0 local V=tonumber(x[3])or 0 return Vector3.new(o,w,V)elseif x=="\067\111\108\111\114\051"then local x=E(N,"\044")if#x<3 then return nil end local o=tonumber(x[1])or 0 local w=tonumber(x[2])or 0 local V=tonumber(x[3])or 0 return Color3.new(o/255,w/255,V/255)elseif x=="\085\068\105\109\050"then local x=E(string.gsub(string.gsub(N,"\123",""),"\125",""),"\044")if#x<4 then return nil end local o=tonumber(x[1])or 0 local w=tonumber(x[2])or 0 local V=tonumber(x[3])or 0 local K=tonumber(x[4])or 0 return UDim2.new(o,w,V,K)elseif x=="\067\111\110\116\101\110\116"then return N elseif x=="\102\108\111\097\116"or x=="\105\110\116"or x=="\100\111\117\098\108\101"then return tonumber(N)elseif x=="\115\116\114\105\110\103"then return N elseif x=="\078\117\109\098\101\114\082\097\110\103\101"then local x=E(N,"\044")if#x==1 then if tonumber(x[1])==nil then return nil end local N=tonumber(x[1])or 0 return NumberRange.new(N)end if#x<2 then return nil end local o=tonumber(x[1])or 0 local w=tonumber(x[2])or 0 return NumberRange.new(o,w)elseif string.sub(N,1,4)=="\069\110\117\109"then local x=N while true do local N,o=string.find(x,"\046")if o then x=string.sub(x,o+1)else break end end print(x)return x else return nil end end function PromptRemoteCaller(N)if CurrentRemoteWindow then CurrentRemoteWindow:Destroy()CurrentRemoteWindow=nil end CurrentRemoteWindow=RemoteWindow:Clone()CurrentRemoteWindow.Parent=explorerPanel.Parent CurrentRemoteWindow.Visible=true local x=false local o=CurrentRemoteWindow.MainWindow.Arguments local w=CurrentRemoteWindow.MainWindow.ArgumentTemplate if N:IsA("\082\101\109\111\116\101\069\118\101\110\116")then CurrentRemoteWindow.Title.Text="\070\105\114\101 \069\118\101\110\116"CurrentRemoteWindow.MainWindow.Ok.Text="\070\105\114\101"CurrentRemoteWindow.MainWindow.DisplayReturned.Visible=false CurrentRemoteWindow.MainWindow.Desc2.Visible=false end local V=w:Clone()V.Parent=o V.Visible=true V.Type.MouseButton1Down:connect(function()createDDown(V.Type,function(N)V.Type.Text=N end,"\083\099\114\105\112\116","\078\117\109\098\101\114","\083\116\114\105\110\103","\067\111\108\111\114\051","\086\101\099\116\111\114\051","\086\101\099\116\111\114\050","\085\068\105\109\050","\078\117\109\098\101\114\082\097\110\103\101")end)CurrentRemoteWindow.MainWindow.Ok.MouseButton1Up:connect(function()if CurrentRemoteWindow and N.Parent~=nil then local w={}for N,x in pairs(o:GetChildren())do table.insert(w,r(x.Value.Text,x.Type.Text))end if N:IsA("\082\101\109\111\116\101\070\117\110\099\116\105\111\110")then if x then spawn(function()local x=N:InvokeServer(unpack(w))if x then CreateTableCaution("\082\101\109\111\116\101 \067\097\108\108\101\114",x)else CreateCaution("\082\101\109\111\116\101 \067\097\108\108\101\114","\084\104\105\115 \114\101\109\111\116\101 \100\105\100 \110\111\116 \114\101\116\117\114\110 \097\110\121\116\104\105\110\103\046")end end)else spawn(function()N:InvokeServer(unpack(w))end)end else N:FireServer(unpack(w))end CurrentRemoteWindow:Destroy()CurrentRemoteWindow=nil end end)CurrentRemoteWindow.MainWindow.Add.MouseButton1Up:connect(function()if CurrentRemoteWindow then local N=w:Clone()N.Position=UDim2.new(0,0,0,#o:GetChildren()*20)N.Parent=o o.CanvasSize=UDim2.new(0,0,0,#o:GetChildren()*20)N.Visible=true N.Type.MouseButton1Down:connect(function()createDDown(N.Type,function(x)N.Type.Text=x end,"\083\099\114\105\112\116","\078\117\109\098\101\114","\083\116\114\105\110\103","\067\111\108\111\114\051","\086\101\099\116\111\114\051","\086\101\099\116\111\114\050","\085\068\105\109\050","\078\117\109\098\101\114\082\097\110\103\101")end)end end)CurrentRemoteWindow.MainWindow.Subtract.MouseButton1Up:connect(function()if CurrentRemoteWindow then if#o:GetChildren()>1 then(o:GetChildren())[#o:GetChildren()]:Destroy()o.CanvasSize=UDim2.new(0,0,0,#o:GetChildren()*20)end end end)CurrentRemoteWindow.MainWindow.Cancel.MouseButton1Up:connect(function()if CurrentRemoteWindow then CurrentRemoteWindow:Destroy()CurrentRemoteWindow=nil end end)CurrentRemoteWindow.MainWindow.DisplayReturned.MouseButton1Up:connect(function()if x then x=false CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible=false else x=true CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible=true end end)end function PromptSaveInstance(N)if not SaveInstance and not _G.SaveInstance then CreateCaution("\083\097\118\101\073\110\115\116\097\110\099\101 \077\105\115\115\105\110\103","\089\111\117 \100\111 \110\111\116 \104\097\118\101 \116\104\101 \083\097\118\101\073\110\115\116\097\110\099\101 \102\117\110\099\116\105\111\110 \105\110\115\116\097\108\108\101\100\046 \080\108\101\097\115\101 \103\111 \116\111 \082\097\115\112\098\101\114\114\121\080\105\'\115 \116\104\114\101\097\100 \116\111 \114\101\116\114\105\101\118\101 \105\116\046")return end if CurrentSaveInstanceWindow then CurrentSaveInstanceWindow:Destroy()CurrentSaveInstanceWindow=nil if explorerPanel.Parent:FindFirstChild("\083\097\118\101\073\110\115\116\097\110\099\101\079\118\101\114\119\114\105\116\101\067\097\117\116\105\111\110")then explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()end end CurrentSaveInstanceWindow=SaveInstanceWindow:Clone()CurrentSaveInstanceWindow.Parent=explorerPanel.Parent CurrentSaveInstanceWindow.Visible=true local x=CurrentSaveInstanceWindow.MainWindow.FileName local o=true local w=false CurrentSaveInstanceWindow.MainWindow.Save.MouseButton1Up:connect(function()if readfile and getelysianpath then if readfile(getelysianpath()..(x.Text.."\046\114\098\120\109\120"))then if not w then w=true local V=ConfirmationWindow:Clone()V.Name="\083\097\118\101\073\110\115\116\097\110\099\101\079\118\101\114\119\114\105\116\101\067\097\117\116\105\111\110"V.MainWindow.Desc.Text="\084\104\101 \102\105\108\101\044 "..(x.Text.."\046\114\098\120\109\120\044 \097\108\114\101\097\100\121 \101\120\105\115\116\115\046 \079\118\101\114\119\114\105\116\101\063")V.Parent=explorerPanel.Parent V.Visible=true V.MainWindow.Yes.MouseButton1Up:connect(function()ypcall(function()SaveInstance(N,x.Text.."\046\114\098\120\109\120",not o)end)w=false V:Destroy()if CurrentSaveInstanceWindow then CurrentSaveInstanceWindow:Destroy()CurrentSaveInstanceWindow=nil end end)V.MainWindow.No.MouseButton1Up:connect(function()w=false V:Destroy()end)end else ypcall(function()SaveInstance(N,x.Text.."\046\114\098\120\109\120",not o)end)if CurrentSaveInstanceWindow then CurrentSaveInstanceWindow:Destroy()CurrentSaveInstanceWindow=nil if explorerPanel.Parent:FindFirstChild("\083\097\118\101\073\110\115\116\097\110\099\101\079\118\101\114\119\114\105\116\101\067\097\117\116\105\111\110")then explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()end end end else ypcall(function()if SaveInstance then SaveInstance(N,x.Text.."\046\114\098\120\109\120",not o)else _G.SaveInstance(N,x.Text,not o)end end)if CurrentSaveInstanceWindow then CurrentSaveInstanceWindow:Destroy()CurrentSaveInstanceWindow=nil if explorerPanel.Parent:FindFirstChild("\083\097\118\101\073\110\115\116\097\110\099\101\079\118\101\114\119\114\105\116\101\067\097\117\116\105\111\110")then explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()end end end end)CurrentSaveInstanceWindow.MainWindow.Cancel.MouseButton1Up:connect(function()if CurrentSaveInstanceWindow then CurrentSaveInstanceWindow:Destroy()CurrentSaveInstanceWindow=nil if explorerPanel.Parent:FindFirstChild("\083\097\118\101\073\110\115\116\097\110\099\101\079\118\101\114\119\114\105\116\101\067\097\117\116\105\111\110")then explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()end end end)CurrentSaveInstanceWindow.MainWindow.SaveObjects.MouseButton1Up:connect(function()if o then o=false CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible=false else o=true CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible=true end end)end function DestroyRightClick()if currentRightClickMenu then currentRightClickMenu:Destroy()currentRightClickMenu=nil end if CurrentInsertObjectWindow and CurrentInsertObjectWindow.Visible then CurrentInsertObjectWindow.Visible=false end end function rightClickMenu(N)local x=game.Players.LocalPlayer:GetMouse()currentRightClickMenu=CreateRightClickMenu({"\067\117\116","\067\111\112\121";"\080\097\115\116\101 \073\110\116\111","\068\117\112\108\105\099\097\116\101";"\068\101\108\101\116\101";"\071\114\111\117\112";"\085\110\103\114\111\117\112","\083\101\108\101\099\116 \067\104\105\108\100\114\101\110";"\084\101\108\101\112\111\114\116 \084\111","\073\110\115\101\114\116 \080\097\114\116";"\073\110\115\101\114\116 \079\098\106\101\099\116";"\086\105\101\119 \083\099\114\105\112\116","\083\097\118\101 \073\110\115\116\097\110\099\101";"\067\097\108\108 \070\117\110\099\116\105\111\110";"\067\097\108\108 \082\101\109\111\116\101"},"",false,function(N)if N=="\067\117\116"then if not Option.Modifiable then return end clipboard={}local N=m.List local x={}for o=1,#N,1 do local w=N[o]:Clone()if w then table.insert(clipboard,w)table.insert(x,N[o])end end for N=1,#x,1 do pcall(delete,x[N])end updateActions()elseif N=="\067\111\112\121"then if not Option.Modifiable then return end clipboard={}local N=m.List for x=1,#N,1 do table.insert(clipboard,N[x]:Clone())end updateActions()elseif N=="\080\097\115\116\101 \073\110\116\111"then if not Option.Modifiable then return end local N=m.List[1]or workspace for x=1,#clipboard,1 do(clipboard[x]:Clone()).Parent=N end elseif N=="\068\117\112\108\105\099\097\116\101"then if not Option.Modifiable then return end local N=m:Get()for x=1,#N,1 do(N[x]:Clone()).Parent=m.List[1].Parent or workspace end elseif N=="\068\101\108\101\116\101"then if not Option.Modifiable then return end local N=m:Get()for x=1,#N,1 do pcall(delete,N[x])end m:Set({})elseif N=="\071\114\111\117\112"then if not Option.Modifiable then return end local N=Instance.new("\077\111\100\101\108")local x=m:Get()N.Parent=m.List[1].Parent or workspace for o=1,#x,1 do x[o].Parent=N end m:Set({})elseif N=="\085\110\103\114\111\117\112"then if not Option.Modifiable then return end local N={}local x=m:Get()for o=1,#x,1 do if x[o]:IsA("\077\111\100\101\108")then for w,V in pairs(x[o]:GetChildren())do V.Parent=x[o].Parent or workspace table.insert(N,V)end pcall(delete,x[o])end end m:Set({})if SettingsRemote:Invoke("\083\101\108\101\099\116\085\110\103\114\111\117\112\101\100")then for N,x in pairs(N)do m:Add(x)end end elseif N=="\083\101\108\101\099\116 \067\104\105\108\100\114\101\110"then if not Option.Modifiable then return end local N=m:Get()m:Set({})m:StopUpdates()for x=1,#N,1 do for N,x in pairs(N[x]:GetChildren())do m:Add(x)end end m:ResumeUpdates()elseif N=="\084\101\108\101\112\111\114\116 \084\111"then if not Option.Modifiable then return end local N=m:Get()for x=1,#N,1 do if N[x]:IsA("\066\097\115\101\080\097\114\116")then pcall(function()game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame=N[x].CFrame end)break end end elseif N=="\073\110\115\101\114\116 \080\097\114\116"then if not Option.Modifiable then return end local N={}local x=m:Get()for o=1,#x,1 do pcall(function()local w=Instance.new("\080\097\114\116")w.Parent=x[o]w.CFrame=CFrame.new(game.Players.LocalPlayer.Character.Head.Position)+Vector3.new(0,3,0)table.insert(N,w)end)end elseif N=="\083\097\118\101 \073\110\115\116\097\110\099\101"then if not Option.Modifiable then return end local N=m:Get()if#N==1 then N[1].Archivable=true ypcall(function()PromptSaveInstance(N[1]:Clone())end)elseif#N>1 then local x=Instance.new("\077\111\100\101\108")x.Name="\083\097\118\101\100\073\110\115\116\097\110\099\101\115"for o=1,#N,1 do ypcall(function()N[o].Archivable=true;(N[o]:Clone()).Parent=x end)end PromptSaveInstance(x)end elseif N=="\067\097\108\108 \082\101\109\111\116\101"then if not Option.Modifiable then return end local N=m:Get()for x=1,#N,1 do if N[x]:IsA("\082\101\109\111\116\101\070\117\110\099\116\105\111\110")or N[x]:IsA("\082\101\109\111\116\101\069\118\101\110\116")then PromptRemoteCaller(N[x])break end end elseif N=="\086\105\101\119 \083\099\114\105\112\116"then if not Option.Modifiable then return end local N=m:Get()for x=1,#N,1 do if N[x]:IsA("\076\111\099\097\108\083\099\114\105\112\116")or N[x]:IsA("\077\111\100\117\108\101\083\099\114\105\112\116")then ScriptEditorEvent:Fire(N[x])end end end end)currentRightClickMenu.Parent=explorerPanel.Parent currentRightClickMenu.Position=UDim2.new(0,x.X,0,x.Y)if currentRightClickMenu.AbsolutePosition.X+currentRightClickMenu.AbsoluteSize.X>explorerPanel.AbsolutePosition.X+explorerPanel.AbsoluteSize.X then currentRightClickMenu.Position=UDim2.new(0,(explorerPanel.AbsolutePosition.X+explorerPanel.AbsoluteSize.X)-currentRightClickMenu.AbsoluteSize.X,0,x.Y)end end local function l() end local function U() end do local N={}local o={}local w=Create("\073\109\097\103\101\066\117\116\116\111\110",{Name="\077\111\117\115\101\068\114\097\103";Position=UDim2.new(-0.25,0,-0.25,0);Size=UDim2.new(1.5,0,1.5,0);Transparency=1;AutoButtonColor=false;Active=true;ZIndex=10})local function K(N,x,o)local V local K conDrag=w.MouseMoved:connect(function(o,w)local V=Vector2.new(o,w)-listFrame.AbsolutePosition local K=listFrame.AbsoluteSize if V.x<0 or V.x>K.x or V.y<0 or V.y>K.y then return end local p=math.ceil(V.y/ENTRY_BOUND)+scrollBar.ScrollIndex for N=p<N and p or N,p>N and p or N,1 do local o=TreeList[N]if o then if x then m:Add(o.Object)else m:Remove(o.Object)end end end N=p end)function U()w.Parent=nil conDrag:disconnect()K:disconnect()function U() end end K=w[o]:connect(U)w.Parent=GetScreen(listFrame)end local function E(x,o,V,K)local p local E local r local B=nil local U=false local Q=Create("\070\114\097\109\101",{Transparency=1;Visible=false;Create("\070\114\097\109\101",{BorderSizePixel=0,BackgroundColor3=Color3.new(0,0,0);BackgroundTransparency=.1;Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,1)});Create("\070\114\097\109\101",{BorderSizePixel=0,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=.1,Position=UDim2.new(1,0,0,0);Size=UDim2.new(0,1,1,0)});Create("\070\114\097\109\101",{BorderSizePixel=0,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=.1;Position=UDim2.new(0,0,1,0);Size=UDim2.new(1,0,0,1)});Create("\070\114\097\109\101",{BorderSizePixel=0;BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=.1,Position=UDim2.new(0,0,0,0);Size=UDim2.new(0,1,1,0)})})SetZIndex(Q,9)conDrag=w.MouseMoved:connect(function(w,p)local m=Vector2.new(w,p)if U then local w=m-listFrame.AbsolutePosition local V=listFrame.AbsoluteSize B=nil Q.Visible=false if w.x>=0 and(w.x<=V.x and(w.y>=0 and w.y<=V.y+ENTRY_SIZE*2))then local o=math.ceil(w.y/ENTRY_BOUND-2)local K=TreeList[o+scrollBar.ScrollIndex]if K and(K.Object~=x and not x:IsAncestorOf(K.Object))then B=o local x=N[o]if x then Q.Visible=true Q.Position=UDim2.new(0,1,0,x.AbsolutePosition.y-listFrame.AbsolutePosition.y)Q.Size=UDim2.new(0,V.x-4,0,x.AbsoluteSize.y)end end end o.Position=UDim2.new(0,m.x+K.x,0,m.y+K.y)elseif(V-m).magnitude>8 then U=true SetZIndex(o,9)o.IndentFrame.Transparency=.25 o.IndentFrame.EntryText.TextColor3=GuiColor.TextSelected o.Position=UDim2.new(0,m.x+K.x,0,m.y+K.y)o.Parent=GetScreen(listFrame)Q.Parent=listFrame end end)function l()w.Parent=nil conDrag:disconnect()E:disconnect()r:disconnect()o:Destroy()Q:Destroy()function l() end end local T=m.Selected[x]if not T and Option.Selectable then m:Set({x})end E=w.MouseButton1Up:connect(function()l()if U then if B then local N=TreeList[B+scrollBar.ScrollIndex]if N then N.Expanded=true local o=N.Object local function w(N,x)N.Parent=x end if Option.Selectable then local N=m.List for x=1,#N,1 do pcall(w,N[x],o)end else pcall(w,x,o)end end end else if T and Option.Selectable then m:Set({})end end end)r=w.MouseButton2Down:connect(function()l()end)w.Parent=GetScreen(listFrame)end local r=Create("\073\109\097\103\101\066\117\116\116\111\110",{Name="\069\110\116\114\121",Transparency=1;AutoButtonColor=false;Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,ENTRY_SIZE),Create("\070\114\097\109\101",{Name="\073\110\100\101\110\116\070\114\097\109\101";BackgroundTransparency=1,BackgroundColor3=GuiColor.Selected,BorderColor3=GuiColor.BorderSelected,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0);Create(Icon("\073\109\097\103\101\066\117\116\116\111\110",0),{Name="\069\120\112\097\110\100";AutoButtonColor=false;Position=UDim2.new(0,-GUI_SIZE,.5,-GUI_SIZE/2),Size=UDim2.new(0,GUI_SIZE,0,GUI_SIZE)});Create(Icon(nil,0),{Name="\069\120\112\108\111\114\101\114\073\099\111\110";Position=UDim2.new(0,2+ENTRY_PADDING,.5,-GUI_SIZE/2);Size=UDim2.new(0,GUI_SIZE,0,GUI_SIZE)}),Create("\084\101\120\116\076\097\098\101\108",{Name="\069\110\116\114\121\084\101\120\116",BackgroundTransparency=1,TextColor3=GuiColor.Text,TextXAlignment="\076\101\102\116",TextYAlignment="\067\101\110\116\101\114";Font=FONT;FontSize=FONT_SIZE;Text="";Position=UDim2.new(0,(2+ENTRY_SIZE)+4,0,0);Size=UDim2.new(1,-2,1,0)})})})function scrollBar.UpdateCallback(w)for p=1,w.VisibleSpace,1 do local B=TreeList[p+w.ScrollIndex]if B then local l=N[p]if not l then l=Create(r:Clone(),{Position=UDim2.new(0,2,0,ENTRY_BOUND*(p-1)+2),Size=UDim2.new(0,x,0,ENTRY_SIZE);ZIndex=listFrame.ZIndex})N[p]=l local o=l.IndentFrame.Expand o.MouseEnter:connect(function()local N=TreeList[p+w.ScrollIndex]if#N>0 then if N.Expanded then Icon(o,NODE_EXPANDED_OVER)else Icon(o,NODE_COLLAPSED_OVER)end end end)o.MouseLeave:connect(function()local N=TreeList[p+w.ScrollIndex]if#N>0 then if N.Expanded then Icon(o,NODE_EXPANDED)else Icon(o,NODE_COLLAPSED)end end end)o.MouseButton1Down:connect(function()local N=TreeList[p+w.ScrollIndex]if#N>0 then N.Expanded=not N.Expanded if N.Object==explorerPanel.Parent and N.Expanded then CreateCaution("\087\097\114\110\105\110\103","\080\108\101\097\115\101 \098\101 \099\097\114\101\102\117\108 \119\104\101\110 \101\100\105\116\105\110\103 \105\110\115\116\097\110\099\101\115 \105\110\115\105\100\101 \104\101\114\101\044 \116\104\105\115 \105\115 \108\105\107\101 \116\104\101 \083\121\115\116\101\109\051\050 \111\102 \068\101\120 \097\110\100 \109\111\100\105\102\121\105\110\103 \111\098\106\101\099\116\115 \104\101\114\101 \099\097\110 \098\114\101\097\107 \068\101\120\046")end V()end end)l.MouseButton1Down:connect(function(N,x)local o=TreeList[p+w.ScrollIndex]DestroyRightClick()if GetAwaitRemote:Invoke()then bindSetAwaiting:Fire(o.Object)return end if not HoldingShift then lastSelectedNode=p+w.ScrollIndex end if HoldingShift and not filteringWorkspace()then if lastSelectedNode then if(p+w.ScrollIndex)-lastSelectedNode>0 then m:StopUpdates()for N=1,(p+w.ScrollIndex)-lastSelectedNode,1 do local x=TreeList[lastSelectedNode+N]if x then m:Add(x.Object)end end m:ResumeUpdates()else m:StopUpdates()for N=(p+w.ScrollIndex)-lastSelectedNode,1,1 do local x=TreeList[lastSelectedNode+N]if x then m:Add(x.Object)end end m:ResumeUpdates()end end return end if HoldingCtrl then if m.Selected[o.Object]then m:Remove(o.Object)else m:Add(o.Object)end return end if Option.Modifiable then local w=Vector2.new(N,x)E(o.Object,l:Clone(),w,l.AbsolutePosition-w)elseif Option.Selectable then if m.Selected[o.Object]then m:Set({})else m:Set({o.Object})end K(p+w.ScrollIndex,true,"\077\111\117\115\101\066\117\116\116\111\110\049\085\112")end end)l.MouseButton2Down:connect(function()if not Option.Selectable then return end DestroyRightClick()curSelect=l local N=TreeList[p+w.ScrollIndex]if GetAwaitRemote:Invoke()then bindSetAwaiting:Fire(N.Object)return end if not m.Selected[N.Object]then m:Set({N.Object})end end)l.MouseButton2Up:connect(function()if not Option.Selectable then return end local N=TreeList[p+w.ScrollIndex]if checkMouseInGui(curSelect)then rightClickMenu(N.Object)end end)l.Parent=listFrame end l.Visible=true local U=B.Object if#B==0 then l.IndentFrame.Expand.Visible=false elseif B.Expanded then Icon(l.IndentFrame.Expand,NODE_EXPANDED)l.IndentFrame.Expand.Visible=true else Icon(l.IndentFrame.Expand,NODE_COLLAPSED)l.IndentFrame.Expand.Visible=true end Icon(l.IndentFrame.ExplorerIcon,ExplorerIndex[U.ClassName]or 0)local Q=B.Depth*((2+ENTRY_PADDING)+GUI_SIZE)l.IndentFrame.Position=UDim2.new(0,Q,0,0)l.IndentFrame.Size=UDim2.new(1,-Q,1,0)if o[l]then o[l]:disconnect()end local T=l.IndentFrame.EntryText T.Text=U.Name o[l]=B.Object.Changed:connect(function(N)if N=="\078\097\109\101"then T.Text=U.Name end end)l.IndentFrame.Transparency=B.Selected and 0 or 1 T.TextColor3=GuiColor[B.Selected and"\084\101\120\116\083\101\108\101\099\116\101\100"or"\084\101\120\116"]l.Size=UDim2.new(0,x,0,ENTRY_SIZE)elseif N[p]then N[p].Visible=false end end for x=w.VisibleSpace+1,w.TotalSpace,1 do local o=N[x]if o then N[x]=nil o:Destroy()end end end function scrollBarH.UpdateCallback(x)for x=1,scrollBar.VisibleSpace,1 do local o=TreeList[x+scrollBar.ScrollIndex]if o then local o=N[x]if o then o.Position=UDim2.new(0,2-scrollBarH.ScrollIndex,0,ENTRY_BOUND*(x-1)+2)end end end end Connect(listFrame.Changed,function(N)if N=="\065\098\115\111\108\117\116\101\083\105\122\101"then p()end end)local B=6 explorerPanel.MouseWheelForward:connect(function()if scrollBar.VisibleSpace-1>B then scrollBar:ScrollTo(scrollBar.ScrollIndex-B)else scrollBar:ScrollTo(scrollBar.ScrollIndex-scrollBar.VisibleSpace)end end)explorerPanel.MouseWheelBackward:connect(function()if scrollBar.VisibleSpace-1>B then scrollBar:ScrollTo(scrollBar.ScrollIndex+B)else scrollBar:ScrollTo(scrollBar.ScrollIndex+scrollBar.VisibleSpace)end end)end

local NodeLookup = {}

local nodeWidth = 0

local QuickButtons = {}

function filteringWorkspace()
	if explorerFilter.Text ~= "" and explorerFilter.Text ~= "Filter Workspace" then
		return true
	end
	return false
end

function lookForAName(obj,name)
	for i,v in pairs(obj:GetChildren()) do
		if string.find(string.lower(v.Name),string.lower(name)) then nameScanned = true end
		lookForAName(v,name)
	end
end

function scanName(obj)
	nameScanned = false
	if string.find(string.lower(obj.Name),string.lower(explorerFilter.Text)) then
		nameScanned = true
	else
		lookForAName(obj,explorerFilter.Text)
	end
	return nameScanned
end

function updateActions()
	for i,v in pairs(QuickButtons) do
		if v.Cond() then
			v.Toggle(true)
		else
			v.Toggle(false)
		end
	end
end

local updateList,rawUpdateList,updateScroll,rawUpdateSize do
	local function r(t)
		for i = 1,#t do
			if not filteringWorkspace() or scanName(t[i].Object) then
				TreeList[#TreeList+1] = t[i]

				local w = (t[i].Depth)*(2+ENTRY_PADDING+GUI_SIZE) + 2 + ENTRY_SIZE + 4 + getTextWidth(t[i].Object.Name) + 4
				if w > nodeWidth then
					nodeWidth = w
				end
				if t[i].Expanded or filteringWorkspace() then
					r(t[i])
				end
			end
		end
	end

	function rawUpdateSize()
		scrollBarH.TotalSpace = nodeWidth
		scrollBarH.VisibleSpace = listFrame.AbsoluteSize.x
		scrollBarH:Update()
		local visible = scrollBarH:CanScrollDown() or scrollBarH:CanScrollUp()
		scrollBarH.GUI.Visible = visible

		listFrame.Size = UDim2.new(1,-GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)

		scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
		scrollBar.GUI.Size = UDim2.new(0,GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
		
		scrollBar.TotalSpace = #TreeList+1
		scrollBar:Update()
	end

	function rawUpdateList()
		-- Clear then repopulate the entire list. It appears to be fast enough.
		TreeList = {}
		nodeWidth = 0
		r(NodeLookup[workspace.Parent])
		if DexStorageEnabled then
			r(NodeLookup[DexStorage])
		end
		if NilStorageEnabled then
			r(NodeLookup[NilStorage])
		end
		rawUpdateSize()
		updateActions()
	end

	-- Adding or removing large models will cause many updates to occur. We
	-- can reduce the number of updates by creating a delay, then dropping any
	-- updates that occur during the delay.
	local updatingList = false
	function updateList()
		if updatingList then return end
		updatingList = true
		wait(0.25)
		updatingList = false
		rawUpdateList()
	end

	local updatingScroll = false
	function updateScroll()
		if updatingScroll then return end
		updatingScroll = true
		wait(0.25)
		updatingScroll = false
		scrollBar:Update()
	end
end

local Selection do
	local bindGetSelection = explorerPanel:FindFirstChild("GetSelection")
	if not bindGetSelection then
		bindGetSelection = Create('BindableFunction',{Name = "GetSelection"})
		bindGetSelection.Parent = explorerPanel
	end

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

	local bindSelectionChanged = explorerPanel:FindFirstChild("SelectionChanged")
	if not bindSelectionChanged then
		bindSelectionChanged = Create('BindableEvent',{Name = "SelectionChanged"})
		bindSelectionChanged.Parent = explorerPanel
	end

	local SelectionList = {}
	local SelectionSet = {}
	local Updates = true
	Selection = {
		Selected = SelectionSet;
		List = SelectionList;
	}

	local function addObject(object)
		-- list update
		local lupdate = false
		-- scroll update
		local supdate = false

		if not SelectionSet[object] then
			local node = NodeLookup[object]
			if node then
				table.insert(SelectionList,object)
				SelectionSet[object] = true
				node.Selected = true

				-- expand all ancestors so that selected node becomes visible
				node = node.Parent
				while node do
					if not node.Expanded then
						node.Expanded = true
						lupdate = true
					end
					node = node.Parent
				end
				supdate = true
			end
		end
		return lupdate,supdate
	end

	function Selection:Set(objects)
		local lupdate = false
		local supdate = false

		if #SelectionList > 0 then
			for i = 1,#SelectionList do
				local object = SelectionList[i]
				local node = NodeLookup[object]
				if node then
					node.Selected = false
					SelectionSet[object] = nil
				end
			end

			SelectionList = {}
			Selection.List = SelectionList
			supdate = true
		end

		for i = 1,#objects do
			local l,s = addObject(objects[i])
			lupdate = l or lupdate
			supdate = s or supdate
		end

		if lupdate then
			rawUpdateList()
			supdate = true
		elseif supdate then
			scrollBar:Update()
		end

		if supdate then
			bindSelectionChanged:Fire()
			updateActions()
		end
	end

	function Selection:Add(object)
		local l,s = addObject(object)
		if l then
			rawUpdateList()
			if Updates then
				bindSelectionChanged:Fire()
				updateActions()
			end
		elseif s then
			scrollBar:Update()
			if Updates then
				bindSelectionChanged:Fire()
				updateActions()
			end
		end
	end
	
	function Selection:StopUpdates()
		Updates = false
	end
	
	function Selection:ResumeUpdates()
		Updates = true
		bindSelectionChanged:Fire()
		updateActions()
	end

	function Selection:Remove(object,noupdate)
		if SelectionSet[object] then
			local node = NodeLookup[object]
			if node then
				node.Selected = false
				SelectionSet[object] = nil
				for i = 1,#SelectionList do
					if SelectionList[i] == object then
						table.remove(SelectionList,i)
						break
					end
				end

				if not noupdate then
					scrollBar:Update()
				end
				bindSelectionChanged:Fire()
				updateActions()
			end
		end
	end

	function Selection:Get()
		local list = {}
		for i = 1,#SelectionList do
			list[i] = SelectionList[i]
		end
		return list
	end

	bindSetSelection.OnInvoke = function(...)
		Selection:Set(...)
	end

	bindGetSelection.OnInvoke = function()
		return Selection:Get()
	end
end

function CreateCaution(title,msg)
	local newCaution = CautionWindow:Clone()
	newCaution.Title.Text = title
	newCaution.MainWindow.Desc.Text = msg
	newCaution.Parent = explorerPanel.Parent
	newCaution.Visible = true
	newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
		newCaution:Destroy()
	end)
end

function CreateTableCaution(title,msg)
	if type(msg) ~= "table" then return CreateCaution(title,tostring(msg)) end
	local newCaution = TableCautionWindow:Clone()
	newCaution.Title.Text = title
	
	local TableList = newCaution.MainWindow.TableResults
	local TableTemplate = newCaution.MainWindow.TableTemplate
	
	for i,v in pairs(msg) do
		local newResult = TableTemplate:Clone()
		newResult.Type.Text = type(v)
		newResult.Value.Text = tostring(v)
		newResult.Position = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
		newResult.Parent = TableList
		TableList.CanvasSize = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
		newResult.Visible = true
	end
	newCaution.Parent = explorerPanel.Parent
	newCaution.Visible = true
	newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
		newCaution:Destroy()
	end)
end

local function Split(str, delimiter)
	local start = 1
	local t = {}
	while true do
		local pos = string.find (str, delimiter, start, true)
		if not pos then
			break
		end
		table.insert (t, string.sub (str, start, pos - 1))
		start = pos + string.len (delimiter)
	end
	table.insert (t, string.sub (str, start))
	return t
end

local function ToValue(value,type)
	if type == "Vector2" then
		local list = Split(value,",")
		if #list < 2 then return nil end
		local x = tonumber(list[1]) or 0
		local y = tonumber(list[2]) or 0
		return Vector2.new(x,y)
	elseif type == "Vector3" then
		local list = Split(value,",")
		if #list < 3 then return nil end
		local x = tonumber(list[1]) or 0
		local y = tonumber(list[2]) or 0
		local z = tonumber(list[3]) or 0
		return Vector3.new(x,y,z)
	elseif type == "Color3" then
		local list = Split(value,",")
		if #list < 3 then return nil end
		local r = tonumber(list[1]) or 0
		local g = tonumber(list[2]) or 0
		local b = tonumber(list[3]) or 0
		return Color3.new(r/255,g/255, b/255)
	elseif type == "UDim2" then
		local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
		if #list < 4 then return nil end
		local xScale = tonumber(list[1]) or 0
		local xOffset = tonumber(list[2]) or 0
		local yScale = tonumber(list[3]) or 0
		local yOffset = tonumber(list[4]) or 0
		return UDim2.new(xScale, xOffset, yScale, yOffset)
	elseif type == "Number" then
		return tonumber(value)
	elseif type == "String" then
		return value
	elseif type == "NumberRange" then
		local list = Split(value,",")
		if #list == 1 then
			if tonumber(list[1]) == nil then return nil end
			local newVal = tonumber(list[1]) or 0
			return NumberRange.new(newVal)
		end
		if #list < 2 then return nil end
		local x = tonumber(list[1]) or 0
		local y = tonumber(list[2]) or 0
		return NumberRange.new(x,y)
	elseif type == "Script" then
		local success,err = ypcall(function()
		_G.D_E_X_DONOTUSETHISPLEASE = nil
		loadstring(
			"_G.D_E_X_DONOTUSETHISPLEASE = "..value
		)()
		return _G.D_E_X_DONOTUSETHISPLEASE
		end)
		if err then
			return nil
		end
	else
		return nil
	end
end

local function ToPropValue(value,type)
	if type == "Vector2" then
		local list = Split(value,",")
		if #list < 2 then return nil end
		local x = tonumber(list[1]) or 0
		local y = tonumber(list[2]) or 0
		return Vector2.new(x,y)
	elseif type == "Vector3" then
		local list = Split(value,",")
		if #list < 3 then return nil end
		local x = tonumber(list[1]) or 0
		local y = tonumber(list[2]) or 0
		local z = tonumber(list[3]) or 0
		return Vector3.new(x,y,z)
	elseif type == "Color3" then
		local list = Split(value,",")
		if #list < 3 then return nil end
		local r = tonumber(list[1]) or 0
		local g = tonumber(list[2]) or 0
		local b = tonumber(list[3]) or 0
		return Color3.new(r/255,g/255, b/255)
	elseif type == "UDim2" then
		local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
		if #list < 4 then return nil end
		local xScale = tonumber(list[1]) or 0
		local xOffset = tonumber(list[2]) or 0
		local yScale = tonumber(list[3]) or 0
		local yOffset = tonumber(list[4]) or 0
		return UDim2.new(xScale, xOffset, yScale, yOffset)
	elseif type == "Content" then
		return value
	elseif type == "float" or type == "int" or type == "double" then
		return tonumber(value)
	elseif type == "string" then
		return value
	elseif type == "NumberRange" then
		local list = Split(value,",")
		if #list == 1 then
			if tonumber(list[1]) == nil then return nil end
			local newVal = tonumber(list[1]) or 0
			return NumberRange.new(newVal)
		end
		if #list < 2 then return nil end
		local x = tonumber(list[1]) or 0
		local y = tonumber(list[2]) or 0
		return NumberRange.new(x,y)
	elseif string.sub(value,1,4) == "Enum" then
		local getEnum = value
		while true do
			local x,y = string.find(getEnum,".")
			if y then
				getEnum = string.sub(getEnum,y+1)
			else
				break
			end
		end
		print(getEnum)
		return getEnum
	else
		return nil
	end
end

function PromptRemoteCaller(inst)
	if CurrentRemoteWindow then
		CurrentRemoteWindow:Destroy()
		CurrentRemoteWindow = nil
	end
	CurrentRemoteWindow = RemoteWindow:Clone()
	CurrentRemoteWindow.Parent = explorerPanel.Parent
	CurrentRemoteWindow.Visible = true
	
	local displayValues = false
	
	local ArgumentList = CurrentRemoteWindow.MainWindow.Arguments
	local ArgumentTemplate = CurrentRemoteWindow.MainWindow.ArgumentTemplate
	
	if inst:IsA("RemoteEvent") then
		CurrentRemoteWindow.Title.Text = "Fire Event"
		CurrentRemoteWindow.MainWindow.Ok.Text = "Fire"
		CurrentRemoteWindow.MainWindow.DisplayReturned.Visible = false
		CurrentRemoteWindow.MainWindow.Desc2.Visible = false
	end
	
	local newArgument = ArgumentTemplate:Clone()
	newArgument.Parent = ArgumentList
	newArgument.Visible = true
	newArgument.Type.MouseButton1Down:connect(function()
		createDDown(newArgument.Type,function(choice)
			newArgument.Type.Text = choice
		end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
	end)
	
	CurrentRemoteWindow.MainWindow.Ok.MouseButton1Up:connect(function()
		if CurrentRemoteWindow and inst.Parent ~= nil then
			local MyArguments = {}
			for i,v in pairs(ArgumentList:GetChildren()) do
				table.insert(MyArguments,ToValue(v.Value.Text,v.Type.Text))
			end
			if inst:IsA("RemoteFunction") then
				if displayValues then
					spawn(function()
						local myResults = inst:InvokeServer(unpack(MyArguments))
						if myResults then
							CreateTableCaution("Remote Caller",myResults)
						else
							CreateCaution("Remote Caller","This remote did not return anything.")
						end
					end)
				else
					spawn(function()
						inst:InvokeServer(unpack(MyArguments))
					end)
				end
			else
				inst:FireServer(unpack(MyArguments))
			end
			CurrentRemoteWindow:Destroy()
			CurrentRemoteWindow = nil
		end
	end)
	
	CurrentRemoteWindow.MainWindow.Add.MouseButton1Up:connect(function()
		if CurrentRemoteWindow then
			local newArgument = ArgumentTemplate:Clone()
			newArgument.Position = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
			newArgument.Parent = ArgumentList
			ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
			newArgument.Visible = true
			newArgument.Type.MouseButton1Down:connect(function()
				createDDown(newArgument.Type,function(choice)
					newArgument.Type.Text = choice
				end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
			end)
		end
	end)
	
	CurrentRemoteWindow.MainWindow.Subtract.MouseButton1Up:connect(function()
		if CurrentRemoteWindow then
			if #ArgumentList:GetChildren() > 1 then
				ArgumentList:GetChildren()[#ArgumentList:GetChildren()]:Destroy()
				ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
			end
		end
	end)
	
	CurrentRemoteWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
		if CurrentRemoteWindow then
			CurrentRemoteWindow:Destroy()
			CurrentRemoteWindow = nil
		end
	end)
	
	CurrentRemoteWindow.MainWindow.DisplayReturned.MouseButton1Up:connect(function()
		if displayValues then
			displayValues = false
			CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = false
		else
			displayValues = true
			CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = true
		end
	end)
end

function PromptSaveInstance(inst)
	if not SaveInstance and not _G.SaveInstance then CreateCaution("SaveInstance Missing","You do not have the SaveInstance function installed. Please go to RaspberryPi's thread to retrieve it.") return end
	if CurrentSaveInstanceWindow then
		CurrentSaveInstanceWindow:Destroy()
		CurrentSaveInstanceWindow = nil
		if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
			explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
		end
	end
	CurrentSaveInstanceWindow = SaveInstanceWindow:Clone()
	CurrentSaveInstanceWindow.Parent = explorerPanel.Parent
	CurrentSaveInstanceWindow.Visible = true
	
	local filename = CurrentSaveInstanceWindow.MainWindow.FileName
	local saveObjects = true
	local overwriteCaution = false
	
	CurrentSaveInstanceWindow.MainWindow.Save.MouseButton1Up:connect(function()
		if readfile and getelysianpath then
			if readfile(getelysianpath()..filename.Text..".rbxmx") then
				if not overwriteCaution then
					overwriteCaution = true
					local newCaution = ConfirmationWindow:Clone()
					newCaution.Name = "SaveInstanceOverwriteCaution"
					newCaution.MainWindow.Desc.Text = "The file, "..filename.Text..".rbxmx, already exists. Overwrite?"
					newCaution.Parent = explorerPanel.Parent
					newCaution.Visible = true
					newCaution.MainWindow.Yes.MouseButton1Up:connect(function()
						ypcall(function()
							SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
						end)
						overwriteCaution = false
						newCaution:Destroy()
						if CurrentSaveInstanceWindow then
							CurrentSaveInstanceWindow:Destroy()
							CurrentSaveInstanceWindow = nil
						end
					end)
					newCaution.MainWindow.No.MouseButton1Up:connect(function()
						overwriteCaution = false
						newCaution:Destroy()
					end)
				end
			else
				ypcall(function()
					SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
				end)
				if CurrentSaveInstanceWindow then
					CurrentSaveInstanceWindow:Destroy()
					CurrentSaveInstanceWindow = nil
					if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
						explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
					end
				end
			end
		else
			ypcall(function()
				if SaveInstance then
					SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
				else
					_G.SaveInstance(inst,filename.Text,not saveObjects)
				end
			end)
			if CurrentSaveInstanceWindow then
				CurrentSaveInstanceWindow:Destroy()
				CurrentSaveInstanceWindow = nil
				if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
					explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
				end
			end
		end
	end)
	CurrentSaveInstanceWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
		if CurrentSaveInstanceWindow then
			CurrentSaveInstanceWindow:Destroy()
			CurrentSaveInstanceWindow = nil
			if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
				explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
			end
		end
	end)
	CurrentSaveInstanceWindow.MainWindow.SaveObjects.MouseButton1Up:connect(function()
		if saveObjects then
			saveObjects = false
			CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = false
		else
			saveObjects = true
			CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = true
		end
	end)
end

function DestroyRightClick()
	if currentRightClickMenu then
		currentRightClickMenu:Destroy()
		currentRightClickMenu = nil
	end
	if CurrentInsertObjectWindow and CurrentInsertObjectWindow.Visible then
		CurrentInsertObjectWindow.Visible = false
	end
end

function rightClickMenu(sObj)
	local mouse = game.Players.LocalPlayer:GetMouse()
	
	currentRightClickMenu = CreateRightClickMenu(
		{"Cut","Copy","Paste Into","Duplicate","Delete","Group","Ungroup","Select Children","Teleport To","Insert Part","Insert Object","View Script","Save Instance","Call Function","Call Remote"},
		"",
		false,
		function(option)
			if option == "Cut" then
				if not Option.Modifiable then return end
				clipboard = {}
				local list = Selection.List
				local cut = {}
				for i = 1,#list do
					local obj = list[i]:Clone()
					if obj then
						table.insert(clipboard,obj)
						table.insert(cut,list[i])
					end
				end
				for i = 1,#cut do
					pcall(delete,cut[i])
				end
				updateActions()
			elseif option == "Copy" then
				if not Option.Modifiable then return end
				clipboard = {}
				local list = Selection.List
				for i = 1,#list do
					table.insert(clipboard,list[i]:Clone())
				end
				updateActions()
			elseif option == "Paste Into" then
				if not Option.Modifiable then return end
				local parent = Selection.List[1] or workspace
				for i = 1,#clipboard do
					clipboard[i]:Clone().Parent = parent
				end
			elseif option == "Duplicate" then
				if not Option.Modifiable then return end
				local list = Selection:Get()
				for i = 1,#list do
					list[i]:Clone().Parent = Selection.List[1].Parent or workspace
				end
			elseif option == "Delete" then
				if not Option.Modifiable then return end
				local list = Selection:Get()
				for i = 1,#list do
					pcall(delete,list[i])
				end
				Selection:Set({})
			elseif option == "Group" then
				if not Option.Modifiable then return end
				local newModel = Instance.new("Model")
				local list = Selection:Get()
				newModel.Parent = Selection.List[1].Parent or workspace
				for i = 1,#list do
					list[i].Parent = newModel
				end
				Selection:Set({})
			elseif option == "Ungroup" then
				if not Option.Modifiable then return end
				local ungrouped = {}
				local list = Selection:Get()
				for i = 1,#list do
					if list[i]:IsA("Model") then
						for i2,v2 in pairs(list[i]:GetChildren()) do
							v2.Parent = list[i].Parent or workspace
							table.insert(ungrouped,v2)
						end		
						pcall(delete,list[i])			
					end
				end
				Selection:Set({})
				if SettingsRemote:Invoke("SelectUngrouped") then
					for i,v in pairs(ungrouped) do
						Selection:Add(v)
					end
				end
			elseif option == "Select Children" then
				if not Option.Modifiable then return end
				local list = Selection:Get()
				Selection:Set({})
				Selection:StopUpdates()
				for i = 1,#list do
					for i2,v2 in pairs(list[i]:GetChildren()) do
						Selection:Add(v2)
					end
				end
				Selection:ResumeUpdates()
			elseif option == "Teleport To" then
				if not Option.Modifiable then return end
				local list = Selection:Get()
				for i = 1,#list do
					if list[i]:IsA("BasePart") then
						pcall(function()
							game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = list[i].CFrame
						end)
						break
					end
				end
			elseif option == "Insert Part" then
				if not Option.Modifiable then return end
				local insertedParts = {}
				local list = Selection:Get()
				for i = 1,#list do
					pcall(function()
						local newPart = Instance.new("Part")
						newPart.Parent = list[i]
						newPart.CFrame = CFrame.new(game.Players.LocalPlayer.Character.Head.Position) + Vector3.new(0,3,0)
						table.insert(insertedParts,newPart)
					end)
				end
			elseif option == "Save Instance" then
				if not Option.Modifiable then return end
				local list = Selection:Get()
				if #list == 1 then
					list[1].Archivable = true
					ypcall(function()PromptSaveInstance(list[1]:Clone())end)
				elseif #list > 1 then
					local newModel = Instance.new("Model")
					newModel.Name = "SavedInstances"
					for i = 1,#list do
						ypcall(function()
							list[i].Archivable = true
							list[i]:Clone().Parent = newModel
						end)
					end
					PromptSaveInstance(newModel)
				end
			elseif option == "Call Remote" then
				if not Option.Modifiable then return end
				local list = Selection:Get()
				for i = 1,#list do
					if list[i]:IsA("RemoteFunction") or list[i]:IsA("RemoteEvent") then
						PromptRemoteCaller(list[i])
						break
					end
				end
			elseif option == "View Script" then
				if not Option.Modifiable then return end
				local list = Selection:Get()
				for i = 1,#list do
					if list[i]:IsA("LocalScript") or list[i]:IsA("ModuleScript") then
						ScriptEditorEvent:Fire(list[i])
					end
				end
			end
	end)
	currentRightClickMenu.Parent = explorerPanel.Parent
	currentRightClickMenu.Position = UDim2.new(0,mouse.X,0,mouse.Y)
	if currentRightClickMenu.AbsolutePosition.X + currentRightClickMenu.AbsoluteSize.X > explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X then
		currentRightClickMenu.Position = UDim2.new(0, explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X - currentRightClickMenu.AbsoluteSize.X, 0, mouse.Y)
	end
end

local function cancelReparentDrag()end
local function cancelSelectDrag()end
do
	local listEntries = {}
	local nameConnLookup = {}

	local mouseDrag = Create('ImageButton',{
		Name = "MouseDrag";
		Position = UDim2.new(-0.25,0,-0.25,0);
		Size = UDim2.new(1.5,0,1.5,0);
		Transparency = 1;
		AutoButtonColor = false;
		Active = true;
		ZIndex = 10;
	})
	local function dragSelect(last,add,button)
		local connDrag
		local conUp

		conDrag = mouseDrag.MouseMoved:connect(function(x,y)
			local pos = Vector2.new(x,y) - listFrame.AbsolutePosition
			local size = listFrame.AbsoluteSize
			if pos.x < 0 or pos.x > size.x or pos.y < 0 or pos.y > size.y then return end

			local i = math.ceil(pos.y/ENTRY_BOUND) + scrollBar.ScrollIndex
			-- Mouse may have made a large step, so interpolate between the
			-- last index and the current.
			for n = i<last and i or last, i>last and i or last do
				local node = TreeList[n]
				if node then
					if add then
						Selection:Add(node.Object)
					else
						Selection:Remove(node.Object)
					end
				end
			end
			last = i
		end)

		function cancelSelectDrag()
			mouseDrag.Parent = nil
			conDrag:disconnect()
			conUp:disconnect()
			function cancelSelectDrag()end
		end

		conUp = mouseDrag[button]:connect(cancelSelectDrag)

		mouseDrag.Parent = GetScreen(listFrame)
	end

	local function dragReparent(object,dragGhost,clickPos,ghostOffset)
		local connDrag
		local conUp
		local conUp2

		local parentIndex = nil
		local dragged = false

		local parentHighlight = Create('Frame',{
			Transparency = 1;
			Visible = false;
			Create('Frame',{
				BorderSizePixel = 0;
				BackgroundColor3 = Color3.new(0,0,0);
				BackgroundTransparency = 0.1;
				Position = UDim2.new(0,0,0,0);
				Size = UDim2.new(1,0,0,1);
			});
			Create('Frame',{
				BorderSizePixel = 0;
				BackgroundColor3 = Color3.new(0,0,0);
				BackgroundTransparency = 0.1;
				Position = UDim2.new(1,0,0,0);
				Size = UDim2.new(0,1,1,0);
			});
			Create('Frame',{
				BorderSizePixel = 0;
				BackgroundColor3 = Color3.new(0,0,0);
				BackgroundTransparency = 0.1;
				Position = UDim2.new(0,0,1,0);
				Size = UDim2.new(1,0,0,1);
			});
			Create('Frame',{
				BorderSizePixel = 0;
				BackgroundColor3 = Color3.new(0,0,0);
				BackgroundTransparency = 0.1;
				Position = UDim2.new(0,0,0,0);
				Size = UDim2.new(0,1,1,0);
			});
		})
		SetZIndex(parentHighlight,9)

		conDrag = mouseDrag.MouseMoved:connect(function(x,y)
			local dragPos = Vector2.new(x,y)
			if dragged then
				local pos = dragPos - listFrame.AbsolutePosition
				local size = listFrame.AbsoluteSize

				parentIndex = nil
				parentHighlight.Visible = false
				if pos.x >= 0 and pos.x <= size.x and pos.y >= 0 and pos.y <= size.y + ENTRY_SIZE*2 then
					local i = math.ceil(pos.y/ENTRY_BOUND-2)
					local node = TreeList[i + scrollBar.ScrollIndex]
					if node and node.Object ~= object and not object:IsAncestorOf(node.Object) then
						parentIndex = i
						local entry = listEntries[i]
						if entry then
							parentHighlight.Visible = true
							parentHighlight.Position = UDim2.new(0,1,0,entry.AbsolutePosition.y-listFrame.AbsolutePosition.y)
							parentHighlight.Size = UDim2.new(0,size.x-4,0,entry.AbsoluteSize.y)
						end
					end
				end

				dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
			elseif (clickPos-dragPos).magnitude > 8 then
				dragged = true
				SetZIndex(dragGhost,9)
				dragGhost.IndentFrame.Transparency = 0.25
				dragGhost.IndentFrame.EntryText.TextColor3 = GuiColor.TextSelected
				dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
				dragGhost.Parent = GetScreen(listFrame)
				parentHighlight.Parent = listFrame
			end
		end)

		function cancelReparentDrag()
			mouseDrag.Parent = nil
			conDrag:disconnect()
			conUp:disconnect()
			conUp2:disconnect()
			dragGhost:Destroy()
			parentHighlight:Destroy()
			function cancelReparentDrag()end
		end

		local wasSelected = Selection.Selected[object]
		if not wasSelected and Option.Selectable then
			Selection:Set({object})
		end

		conUp = mouseDrag.MouseButton1Up:connect(function()
			cancelReparentDrag()
			if dragged then
				if parentIndex then
					local parentNode = TreeList[parentIndex + scrollBar.ScrollIndex]
					if parentNode then
						parentNode.Expanded = true

						local parentObj = parentNode.Object
						local function parent(a,b)
							a.Parent = b
						end
						if Option.Selectable then
							local list = Selection.List
							for i = 1,#list do
								pcall(parent,list[i],parentObj)
							end
						else
							pcall(parent,object,parentObj)
						end
					end
				end
			else
				-- do selection click
				if wasSelected and Option.Selectable then
					Selection:Set({})
				end
			end
		end)
		conUp2 = mouseDrag.MouseButton2Down:connect(function()
			cancelReparentDrag()
		end)

		mouseDrag.Parent = GetScreen(listFrame)
	end

	local entryTemplate = Create('ImageButton',{
		Name = "Entry";
		Transparency = 1;
		AutoButtonColor = false;
		Position = UDim2.new(0,0,0,0);
		Size = UDim2.new(1,0,0,ENTRY_SIZE);
		Create('Frame',{
			Name = "IndentFrame";
			BackgroundTransparency = 1;
			BackgroundColor3 = GuiColor.Selected;
			BorderColor3 = GuiColor.BorderSelected;
			Position = UDim2.new(0,0,0,0);
			Size = UDim2.new(1,0,1,0);
			Create(Icon('ImageButton',0),{
				Name = "Expand";
				AutoButtonColor = false;
				Position = UDim2.new(0,-GUI_SIZE,0.5,-GUI_SIZE/2);
				Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
			});
			Create(Icon(nil,0),{
				Name = "ExplorerIcon";
				Position = UDim2.new(0,2+ENTRY_PADDING,0.5,-GUI_SIZE/2);
				Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
			});
			Create('TextLabel',{
				Name = "EntryText";
				BackgroundTransparency = 1;
				TextColor3 = GuiColor.Text;
				TextXAlignment = 'Left';
				TextYAlignment = 'Center';
				Font = FONT;
				FontSize = FONT_SIZE;
				Text = "";
				Position = UDim2.new(0,2+ENTRY_SIZE+4,0,0);
				Size = UDim2.new(1,-2,1,0);
			});
		});
	})

	function scrollBar.UpdateCallback(self)
		for i = 1,self.VisibleSpace do
			local node = TreeList[i + self.ScrollIndex]
			if node then
				local entry = listEntries[i]
				if not entry then
					entry = Create(entryTemplate:Clone(),{
						Position = UDim2.new(0,2,0,ENTRY_BOUND*(i-1)+2);
						Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE);
						ZIndex = listFrame.ZIndex;
					})
					listEntries[i] = entry

					local expand = entry.IndentFrame.Expand
					expand.MouseEnter:connect(function()
						local node = TreeList[i + self.ScrollIndex]
						if #node > 0 then
							if node.Expanded then
								Icon(expand,NODE_EXPANDED_OVER)
							else
								Icon(expand,NODE_COLLAPSED_OVER)
							end
						end
					end)
					expand.MouseLeave:connect(function()
						local node = TreeList[i + self.ScrollIndex]
						if #node > 0 then
							if node.Expanded then
								Icon(expand,NODE_EXPANDED)
							else
								Icon(expand,NODE_COLLAPSED)
							end
						end
					end)
					expand.MouseButton1Down:connect(function()
						local node = TreeList[i + self.ScrollIndex]
						if #node > 0 then
							node.Expanded = not node.Expanded
							if node.Object == explorerPanel.Parent and node.Expanded then
								CreateCaution("Warning","Please be careful when editing instances inside here, this is like the System32 of Dex and modifying objects here can break Dex.")
							end
							-- use raw update so the list updates instantly
							rawUpdateList()
						end
					end)

					entry.MouseButton1Down:connect(function(x,y)
						local node = TreeList[i + self.ScrollIndex]
						DestroyRightClick()
						if GetAwaitRemote:Invoke() then
							bindSetAwaiting:Fire(node.Object)
							return
						end
						
						if not HoldingShift then
							lastSelectedNode = i + self.ScrollIndex
						end
						
						if HoldingShift and not filteringWorkspace() then
							if lastSelectedNode then
								if i + self.ScrollIndex - lastSelectedNode > 0 then
									Selection:StopUpdates()
									for i2 = 1, i + self.ScrollIndex - lastSelectedNode do
										local newNode = TreeList[lastSelectedNode + i2]
										if newNode then
											Selection:Add(newNode.Object)
										end
									end
									Selection:ResumeUpdates()
								else
									Selection:StopUpdates()
									for i2 = i + self.ScrollIndex - lastSelectedNode, 1 do
										local newNode = TreeList[lastSelectedNode + i2]
										if newNode then
											Selection:Add(newNode.Object)
										end
									end
									Selection:ResumeUpdates()
								end
							end
							return
						end
						
						if HoldingCtrl then
							if Selection.Selected[node.Object] then
								Selection:Remove(node.Object)
							else
								Selection:Add(node.Object)
							end
							return
						end
						if Option.Modifiable then
							local pos = Vector2.new(x,y)
							dragReparent(node.Object,entry:Clone(),pos,entry.AbsolutePosition-pos)
						elseif Option.Selectable then
							if Selection.Selected[node.Object] then
								Selection:Set({})
							else
								Selection:Set({node.Object})
							end
							dragSelect(i+self.ScrollIndex,true,'MouseButton1Up')
						end
					end)

					entry.MouseButton2Down:connect(function()
						if not Option.Selectable then return end
						
						DestroyRightClick()
						
						curSelect = entry
						
						local node = TreeList[i + self.ScrollIndex]
						
						if GetAwaitRemote:Invoke() then
							bindSetAwaiting:Fire(node.Object)
							return
						end
						
						if not Selection.Selected[node.Object] then
							Selection:Set({node.Object})
						end
					end)
					
					
					entry.MouseButton2Up:connect(function()
						if not Option.Selectable then return end
						
						local node = TreeList[i + self.ScrollIndex]
						
						if checkMouseInGui(curSelect) then
							rightClickMenu(node.Object)
						end
					end)

					entry.Parent = listFrame
				end

				entry.Visible = true

				local object = node.Object

				-- update expand icon
				if #node == 0 then
					entry.IndentFrame.Expand.Visible = false
				elseif node.Expanded then
					Icon(entry.IndentFrame.Expand,NODE_EXPANDED)
					entry.IndentFrame.Expand.Visible = true
				else
					Icon(entry.IndentFrame.Expand,NODE_COLLAPSED)
					entry.IndentFrame.Expand.Visible = true
				end

				-- update explorer icon
				Icon(entry.IndentFrame.ExplorerIcon,ExplorerIndex[object.ClassName] or 0)

				-- update indentation
				local w = (node.Depth)*(2+ENTRY_PADDING+GUI_SIZE)
				entry.IndentFrame.Position = UDim2.new(0,w,0,0)
				entry.IndentFrame.Size = UDim2.new(1,-w,1,0)

				-- update name change detection
				if nameConnLookup[entry] then
					nameConnLookup[entry]:disconnect()
				end
				local text = entry.IndentFrame.EntryText
				text.Text = object.Name
				nameConnLookup[entry] = node.Object.Changed:connect(function(p)
					if p == 'Name' then
						text.Text = object.Name
					end
				end)

				-- update selection
				entry.IndentFrame.Transparency = node.Selected and 0 or 1
				text.TextColor3 = GuiColor[node.Selected and 'TextSelected' or 'Text']

				entry.Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE)
			elseif listEntries[i] then
				listEntries[i].Visible = false
			end
		end
		for i = self.VisibleSpace+1,self.TotalSpace do
			local entry = listEntries[i]
			if entry then
				listEntries[i] = nil
				entry:Destroy()
			end
		end
	end

	function scrollBarH.UpdateCallback(self)
		for i = 1,scrollBar.VisibleSpace do
			local node = TreeList[i + scrollBar.ScrollIndex]
			if node then
				local entry = listEntries[i]
				if entry then
					entry.Position = UDim2.new(0,2 - scrollBarH.ScrollIndex,0,ENTRY_BOUND*(i-1)+2)
				end
			end
		end
	end

	Connect(listFrame.Changed,function(p)
		if p == 'AbsoluteSize' then
			rawUpdateSize()
		end
	end)

	local wheelAmount = 6
	explorerPanel.MouseWheelForward:connect(function()
		if scrollBar.VisibleSpace - 1 > wheelAmount then
			scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount)
		else
			scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace)
		end
	end)
	explorerPanel.MouseWheelBackward:connect(function()
		if scrollBar.VisibleSpace - 1 > wheelAmount then
			scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount)
		else
			scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace)
		end
	end)
end
