LeviTheOtaku

Dex for Synapse

Oct 24th, 2017
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 294.64 KB | None | 0 0
  1. function CreateInstance(cls,props)
  2.     local inst = Instance.new(cls)
  3.     for i,v in pairs(props) do
  4.         inst[i] = v
  5.     end
  6.     return inst
  7. end
  8.  
  9. function createDexWindow()
  10.     local DexWindow = CreateInstance("ScreenGui",{DisplayOrder=0,Enabled=true,ResetOnSpawn=true,Name="Dex",})
  11.     local DexWindow2 = CreateInstance("Frame",{Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.10000000149012,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,0,0.5,36),Rotation=0,Selectable=false,Size=UDim2.new(0,300,0.5,-36),SizeConstraint=0,Visible=true,ZIndex=1,Name="PropertiesFrame",Parent = DexWindow})
  12.     local DexWindow3 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,-36),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,35),SizeConstraint=0,Visible=true,ZIndex=1,Name="Header",Parent = DexWindow2})
  13.     local DexWindow4 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Properties",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,4,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-4,0.5,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="TextLabel",Parent = DexWindow3})
  14.     local DexWindow5 = CreateInstance("TextBox",{ClearTextOnFocus=true,Font=3,FontSize=5,MultiLine=false,Text="Search Properties",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=0.80000001192093,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,4,0.5,0),Rotation=0,Selectable=true,Size=UDim2.new(1,-8,0.5,-3),SizeConstraint=0,Visible=true,ZIndex=1,Name="TextBox",Parent = DexWindow3})
  15.     local DexWindow6 = CreateInstance("BindableFunction",{Name="GetApi",Parent = DexWindow2})
  16.     local DexWindow7 = CreateInstance("BindableFunction",{Name="GetAwaiting",Parent = DexWindow2})
  17.     local DexWindow8 = CreateInstance("BindableEvent",{Name="SetAwaiting",Parent = DexWindow2})
  18.     local DexWindow9 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.10000000149012,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,300,0.5,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="ExplorerPanel",Parent = DexWindow})
  19.     local DexWindow10 = CreateInstance("BindableEvent",{Name="SelectionChanged",Parent = DexWindow9})
  20.     local DexWindow11 = CreateInstance("BindableFunction",{Name="SetOption",Parent = DexWindow9})
  21.     local DexWindow12 = CreateInstance("BindableFunction",{Name="SetSelection",Parent = DexWindow9})
  22.     local DexWindow13 = CreateInstance("BindableFunction",{Name="GetOption",Parent = DexWindow9})
  23.     local DexWindow14 = CreateInstance("BindableFunction",{Name="GetSelection",Parent = DexWindow9})
  24.     local DexWindow15 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=1,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,-330,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,30,0,180),SizeConstraint=0,Visible=false,ZIndex=2,Name="SideMenu",Parent = DexWindow})
  25.     local DexWindow16 = CreateInstance("TextButton",{Font=3,FontSize=7,Text=">",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=1,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=false,Modal=false,Selected=false,Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,60),Rotation=0,Selectable=true,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Toggle",Parent = DexWindow15})
  26.     local DexWindow17 = CreateInstance("TextLabel",{Font=4,FontSize=5,Text="DEX",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,30,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="Title",Parent = DexWindow15})
  27.     local DexWindow18 = CreateInstance("TextLabel",{Font=4,FontSize=4,Text="V1.0.0",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=12,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,15),Rotation=0,Selectable=false,Size=UDim2.new(0,30,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="Version",Parent = DexWindow15})
  28.     local DexWindow19 = CreateInstance("ImageLabel",{Image="rbxassetid://474172996",ImageColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=0,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,90),Rotation=180,Selectable=false,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Slant",Parent = DexWindow15})
  29.     local DexWindow20 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Main",Parent = DexWindow15})
  30.     local DexWindow21 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.86274516582489,0.86274516582489,0.86274516582489),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,0,0,30),Rotation=0,Selectable=false,Size=UDim2.new(0,30,0,150),SizeConstraint=0,Visible=true,ZIndex=1,Name="SlideOut",Parent = DexWindow15})
  31.     local DexWindow22 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.86274516582489,0.86274516582489,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,-150),Rotation=0,Selectable=false,Size=UDim2.new(0,30,0,150),SizeConstraint=0,Visible=true,ZIndex=1,Name="SlideFrame",Parent = DexWindow21})
  32.     local DexWindow23 = CreateInstance("TextButton",{Font=3,FontSize=7,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=false,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,120),Rotation=0,Selectable=true,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=2,Name="Explorer",Parent = DexWindow22})
  33.     local DexWindow24 = CreateInstance("ImageLabel",{Image="rbxassetid://472635937",ImageColor3=Color3.new(0.27450981736183,0.27450981736183,0.27450981736183),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=0,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,5,0,5),Rotation=0,Selectable=false,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="Icon",Parent = DexWindow23})
  34.     local DexWindow25 = CreateInstance("TextButton",{Font=3,FontSize=7,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=false,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,90),Rotation=0,Selectable=true,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=2,Name="SaveMap",Parent = DexWindow22})
  35.     local DexWindow26 = CreateInstance("ImageLabel",{Image="rbxassetid://472636337",ImageColor3=Color3.new(0.27450981736183,0.27450981736183,0.27450981736183),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=0,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,5,0,5),Rotation=0,Selectable=false,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="Icon",Parent = DexWindow25})
  36.     local DexWindow27 = CreateInstance("TextButton",{Font=3,FontSize=7,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=false,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,30),Rotation=0,Selectable=true,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=2,Name="Settings",Parent = DexWindow22})
  37.     local DexWindow28 = CreateInstance("ImageLabel",{Image="rbxassetid://472635774",ImageColor3=Color3.new(0.27450981736183,0.27450981736183,0.27450981736183),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=0,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,5,0,5),Rotation=0,Selectable=false,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="Icon",Parent = DexWindow27})
  38.     local DexWindow29 = CreateInstance("TextButton",{Font=3,FontSize=7,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=false,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,60),Rotation=0,Selectable=true,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=2,Name="Remotes",Parent = DexWindow22})
  39.     local DexWindow30 = CreateInstance("ImageLabel",{Image="rbxassetid://472636187",ImageColor3=Color3.new(0.27450981736183,0.27450981736183,0.27450981736183),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=0,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,5,0,5),Rotation=0,Selectable=false,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="Icon",Parent = DexWindow29})
  40.     local DexWindow31 = CreateInstance("TextButton",{Font=3,FontSize=7,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=false,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=true,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=2,Name="About",Parent = DexWindow22})
  41.     local DexWindow32 = CreateInstance("ImageLabel",{Image="rbxassetid://476354004",ImageColor3=Color3.new(0.27450981736183,0.27450981736183,0.27450981736183),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=0,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,5,0,5),Rotation=0,Selectable=false,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="Icon",Parent = DexWindow31})
  42.     local DexWindow33 = CreateInstance("TextButton",{Font=3,FontSize=7,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=false,Modal=false,Selected=false,Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,30),Rotation=0,Selectable=true,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=2,Name="OpenScriptEditor",Parent = DexWindow15})
  43.     local DexWindow34 = CreateInstance("ImageLabel",{Image="rbxassetid://475456048",ImageColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=1,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,5,0,5),Rotation=0,Selectable=false,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="Icon",Parent = DexWindow33})
  44.     local DexWindow35 = CreateInstance("TextButton",{Font=3,FontSize=7,Text="<",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,0,0,0),Rotation=0,Selectable=true,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Toggle",Parent = DexWindow})
  45.     local DexWindow36 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.10000000149012,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,300,1,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="SettingsPanel",Parent = DexWindow})
  46.     local DexWindow37 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,17),SizeConstraint=0,Visible=true,ZIndex=1,Name="Header",Parent = DexWindow36})
  47.     local DexWindow38 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Settings",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,4,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-4,1,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="TextLabel",Parent = DexWindow37})
  48.     local DexWindow39 = CreateInstance("BindableFunction",{Name="GetSetting",Parent = DexWindow36})
  49.     local DexWindow40 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,18),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,60),SizeConstraint=0,Visible=false,ZIndex=1,Name="SettingTemplate",Parent = DexWindow36})
  50.     local DexWindow41 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="SettingName",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-20,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="SName",Parent = DexWindow40})
  51.     local DexWindow42 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Off",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,60,0,30),Rotation=0,Selectable=false,Size=UDim2.new(0,50,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="Status",Parent = DexWindow40})
  52.     local DexWindow43 = CreateInstance("TextButton",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.86274516582489,0.86274516582489,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,30),Rotation=0,Selectable=true,Size=UDim2.new(0,40,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="Change",Parent = DexWindow40})
  53.     local DexWindow44 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0,0.57647061347961,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,0,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="OnBar",Parent = DexWindow43})
  54.     local DexWindow45 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,-2,0,-2),Rotation=0,Selectable=false,Size=UDim2.new(0,10,0,19),SizeConstraint=0,Visible=true,ZIndex=1,Name="Bar",Parent = DexWindow43})
  55.     local DexWindow46 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,17),Rotation=0,Selectable=false,Size=UDim2.new(1,0,1,-17),SizeConstraint=0,Visible=true,ZIndex=1,Name="SettingList",Parent = DexWindow36})
  56.     local DexWindow47 = CreateInstance("Frame",{Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=true,Position=UDim2.new(0.30000001192093,0,0.30000001192093,0),Rotation=0,Selectable=false,Size=UDim2.new(0,350,0,20),SizeConstraint=0,Visible=false,ZIndex=2,Name="SaveInstance",Parent = DexWindow})
  57.     local DexWindow48 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Save Instance",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,1,0),SizeConstraint=0,Visible=true,ZIndex=2,Name="Title",Parent = DexWindow47})
  58.     local DexWindow49 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.10000000149012,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,200),SizeConstraint=0,Visible=true,ZIndex=1,Name="MainWindow",Parent = DexWindow47})
  59.     local DexWindow50 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="Save",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.075000002980232,0,1,-40),Rotation=0,Selectable=true,Size=UDim2.new(0.40000000596046,0,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Save",Parent = DexWindow49})
  60.     local DexWindow51 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="This will save an instance to your PC. Type in the name for your instance. (.rbxmx will be added automatically.)",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,20),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,40),SizeConstraint=0,Visible=true,ZIndex=1,Name="Desc",Parent = DexWindow49})
  61.     local DexWindow52 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="Cancel",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.52499997615814,0,1,-40),Rotation=0,Selectable=true,Size=UDim2.new(0.40000000596046,0,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Cancel",Parent = DexWindow49})
  62.     local DexWindow53 = CreateInstance("TextBox",{ClearTextOnFocus=true,Font=3,FontSize=6,MultiLine=false,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.20000000298023,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.075000002980232,0,0.40000000596046,0),Rotation=0,Selectable=true,Size=UDim2.new(0.85000002384186,0,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="FileName",Parent = DexWindow49})
  63.     local DexWindow54 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="",TextColor3=Color3.new(1,1,1),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.60000002384186,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.075000002980232,0,0.625,0),Rotation=0,Selectable=true,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="SaveObjects",Parent = DexWindow49})
  64.     local DexWindow55 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.38039219379425,0.38039219379425,0.38039219379425),BackgroundTransparency=0.40000000596046,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,3,0,3),Rotation=0,Selectable=false,Size=UDim2.new(0,14,0,14),SizeConstraint=0,Visible=true,ZIndex=1,Name="enabled",Parent = DexWindow54})
  65.     local DexWindow56 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Save \"Object\" type values",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.075000002980232,30,0.625,0),Rotation=0,Selectable=false,Size=UDim2.new(0.92500001192093,-30,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="Desc2",Parent = DexWindow49})
  66.     local DexWindow57 = CreateInstance("Frame",{Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=true,Position=UDim2.new(0.30000001192093,0,0.34999999403954,0),Rotation=0,Selectable=false,Size=UDim2.new(0,350,0,20),SizeConstraint=0,Visible=false,ZIndex=3,Name="Confirmation",Parent = DexWindow})
  67.     local DexWindow58 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Confirm",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,1,0),SizeConstraint=0,Visible=true,ZIndex=3,Name="Title",Parent = DexWindow57})
  68.     local DexWindow59 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.10000000149012,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,150),SizeConstraint=0,Visible=true,ZIndex=2,Name="MainWindow",Parent = DexWindow57})
  69.     local DexWindow60 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="Yes",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.075000002980232,0,1,-40),Rotation=0,Selectable=true,Size=UDim2.new(0.40000000596046,0,0,30),SizeConstraint=0,Visible=true,ZIndex=2,Name="Yes",Parent = DexWindow59})
  70.     local DexWindow61 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="The file, FILENAME, already exists. Overwrite?",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,20),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,40),SizeConstraint=0,Visible=true,ZIndex=2,Name="Desc",Parent = DexWindow59})
  71.     local DexWindow62 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="No",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.52499997615814,0,1,-40),Rotation=0,Selectable=true,Size=UDim2.new(0.40000000596046,0,0,30),SizeConstraint=0,Visible=true,ZIndex=2,Name="No",Parent = DexWindow59})
  72.     local DexWindow63 = CreateInstance("Frame",{Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=true,Position=UDim2.new(0.30000001192093,0,0.30000001192093,0),Rotation=0,Selectable=false,Size=UDim2.new(0,350,0,20),SizeConstraint=0,Visible=false,ZIndex=5,Name="Caution",Parent = DexWindow})
  73.     local DexWindow64 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Caution",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,1,0),SizeConstraint=0,Visible=true,ZIndex=5,Name="Title",Parent = DexWindow63})
  74.     local DexWindow65 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.10000000149012,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,150),SizeConstraint=0,Visible=true,ZIndex=4,Name="MainWindow",Parent = DexWindow63})
  75.     local DexWindow66 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="The file, FILENAME, already exists. Overwrite?",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,20),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,42),SizeConstraint=0,Visible=true,ZIndex=4,Name="Desc",Parent = DexWindow65})
  76.     local DexWindow67 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="Ok",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.30000001192093,0,1,-40),Rotation=0,Selectable=true,Size=UDim2.new(0.40000000596046,0,0,30),SizeConstraint=0,Visible=true,ZIndex=4,Name="Ok",Parent = DexWindow65})
  77.     local DexWindow68 = CreateInstance("Frame",{Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=true,Position=UDim2.new(0.30000001192093,0,0.30000001192093,0),Rotation=0,Selectable=false,Size=UDim2.new(0,350,0,20),SizeConstraint=0,Visible=false,ZIndex=2,Name="CallRemote",Parent = DexWindow})
  78.     local DexWindow69 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Call Remote",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,1,0),SizeConstraint=0,Visible=true,ZIndex=2,Name="Title",Parent = DexWindow68})
  79.     local DexWindow70 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.10000000149012,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,200),SizeConstraint=0,Visible=true,ZIndex=1,Name="MainWindow",Parent = DexWindow68})
  80.     local DexWindow71 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Arguments",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,20),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="Desc",Parent = DexWindow70})
  81.     local DexWindow72 = CreateInstance("ScrollingFrame",{BottomImage="rbxasset://textures/blackBkg_square.png",CanvasPosition=Vector2.new(0,0),CanvasSize=UDim2.new(0,0,0,0),MidImage="rbxasset://textures/blackBkg_square.png",ScrollBarThickness=12,ScrollingEnabled=true,TopImage="rbxasset://textures/blackBkg_square.png",Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,0,0,40),Rotation=0,Selectable=true,Size=UDim2.new(1,0,0,80),SizeConstraint=0,Visible=true,ZIndex=1,Name="Arguments",Parent = DexWindow70})
  82.     local DexWindow73 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="",TextColor3=Color3.new(1,1,1),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.60000002384186,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.075000002980232,0,0.625,0),Rotation=0,Selectable=true,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="DisplayReturned",Parent = DexWindow70})
  83.     local DexWindow74 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.38039219379425,0.38039219379425,0.38039219379425),BackgroundTransparency=0.40000000596046,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,3,0,3),Rotation=0,Selectable=false,Size=UDim2.new(0,14,0,14),SizeConstraint=0,Visible=false,ZIndex=1,Name="enabled",Parent = DexWindow73})
  84.     local DexWindow75 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Display values returned",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.075000002980232,30,0.625,0),Rotation=0,Selectable=false,Size=UDim2.new(0.92500001192093,-30,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="Desc2",Parent = DexWindow70})
  85.     local DexWindow76 = CreateInstance("TextButton",{Font=4,FontSize=7,Text="+",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.80000001192093,0,0.625,0),Rotation=0,Selectable=true,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="Add",Parent = DexWindow70})
  86.     local DexWindow77 = CreateInstance("TextButton",{Font=4,FontSize=7,Text="-",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=24,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.89999997615814,0,0.625,0),Rotation=0,Selectable=true,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="Subtract",Parent = DexWindow70})
  87.     local DexWindow78 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,20),SizeConstraint=0,Visible=false,ZIndex=1,Name="ArgumentTemplate",Parent = DexWindow70})
  88.     local DexWindow79 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="Script",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.89999997615814,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=true,Size=UDim2.new(0.40000000596046,0,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="Type",Parent = DexWindow78})
  89.     local DexWindow80 = CreateInstance("TextBox",{ClearTextOnFocus=true,Font=3,FontSize=5,MultiLine=false,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.89999997615814,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.40000000596046,0,0,0),Rotation=0,Selectable=true,Size=UDim2.new(0.60000002384186,-12,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="Value",Parent = DexWindow78})
  90.     local DexWindow81 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="Cancel",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.52499997615814,0,1,-40),Rotation=0,Selectable=true,Size=UDim2.new(0.40000000596046,0,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Cancel",Parent = DexWindow70})
  91.     local DexWindow82 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="Call",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.075000002980232,0,1,-40),Rotation=0,Selectable=true,Size=UDim2.new(0.40000000596046,0,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Ok",Parent = DexWindow70})
  92.     local DexWindow83 = CreateInstance("Frame",{Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=true,Position=UDim2.new(0.30000001192093,0,0.30000001192093,0),Rotation=0,Selectable=false,Size=UDim2.new(0,350,0,20),SizeConstraint=0,Visible=false,ZIndex=2,Name="TableCaution",Parent = DexWindow})
  93.     local DexWindow84 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.10000000149012,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,150),SizeConstraint=0,Visible=true,ZIndex=1,Name="MainWindow",Parent = DexWindow83})
  94.     local DexWindow85 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="Ok",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.30000001192093,0,1,-40),Rotation=0,Selectable=true,Size=UDim2.new(0.40000000596046,0,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Ok",Parent = DexWindow84})
  95.     local DexWindow86 = CreateInstance("ScrollingFrame",{BottomImage="rbxasset://textures/blackBkg_square.png",CanvasPosition=Vector2.new(0,0),CanvasSize=UDim2.new(0,0,0,0),MidImage="rbxasset://textures/blackBkg_square.png",ScrollBarThickness=12,ScrollingEnabled=true,TopImage="rbxasset://textures/blackBkg_square.png",Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,0,0,20),Rotation=0,Selectable=true,Size=UDim2.new(1,0,0,80),SizeConstraint=0,Visible=true,ZIndex=1,Name="TableResults",Parent = DexWindow84})
  96.     local DexWindow87 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,20),SizeConstraint=0,Visible=false,ZIndex=1,Name="TableTemplate",Parent = DexWindow84})
  97.     local DexWindow88 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Script",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.89999997615814,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0.40000000596046,0,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="Type",Parent = DexWindow87})
  98.     local DexWindow89 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Script",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.89999997615814,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.40000000596046,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0.60000002384186,-12,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="Value",Parent = DexWindow87})
  99.     local DexWindow90 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Caution",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,1,0),SizeConstraint=0,Visible=true,ZIndex=2,Name="Title",Parent = DexWindow83})
  100.     local DexWindow91 = CreateInstance("Frame",{Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=true,Position=UDim2.new(0.30000001192093,0,0.30000001192093,0),Rotation=0,Selectable=false,Size=UDim2.new(0,516,0,20),SizeConstraint=0,Visible=false,ZIndex=5,Name="ScriptEditor",Parent = DexWindow})
  101.     local DexWindow92 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Script Viewer",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,1,0),SizeConstraint=0,Visible=true,ZIndex=5,Name="Title",Parent = DexWindow91})
  102.     local DexWindow93 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,3,0),Rotation=0,Selectable=false,Size=UDim2.new(0,516,0,416),SizeConstraint=0,Visible=true,ZIndex=1,Name="Cover",Parent = DexWindow91})
  103.     local DexWindow94 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,3,0),Rotation=0,Selectable=false,Size=UDim2.new(0,500,0,400),SizeConstraint=0,Visible=true,ZIndex=1,Name="EditorGrid",Parent = DexWindow91})
  104.     local DexWindow95 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.94117653369904,0.94117653369904,0.94117653369904),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,3,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="TopBar",Parent = DexWindow91})
  105.     local DexWindow96 = CreateInstance("ImageButton",{Image="",ImageColor3=Color3.new(1,1,1),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=0,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),AutoButtonColor=false,Modal=false,Selected=false,Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.8666667342186,0.8666667342186,0.8666667342186),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,-32,0,40),Rotation=0,Selectable=true,Size=UDim2.new(0,16,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="ScriptBarLeft",Parent = DexWindow95})
  106.     local DexWindow97 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.5,-4,0.5,-4),Rotation=0,Selectable=false,Size=UDim2.new(0,8,0,8),SizeConstraint=0,Visible=true,ZIndex=1,Name="Arrow Graphic",Parent = DexWindow96})
  107.     local DexWindow98 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BackgroundTransparency=0.69999998807907,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.25,0,0.375,0),Rotation=0,Selectable=false,Size=UDim2.new(0.125,0,0.25,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="Graphic",Parent = DexWindow97})
  108.     local DexWindow99 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BackgroundTransparency=0.69999998807907,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.375,0,0.25,0),Rotation=0,Selectable=false,Size=UDim2.new(0.125,0,0.5,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="Graphic",Parent = DexWindow97})
  109.     local DexWindow100 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BackgroundTransparency=0.69999998807907,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.5,0,0.125,0),Rotation=0,Selectable=false,Size=UDim2.new(0.125,0,0.75,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="Graphic",Parent = DexWindow97})
  110.     local DexWindow101 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BackgroundTransparency=0.69999998807907,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.625,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0.125,0,1,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="Graphic",Parent = DexWindow97})
  111.     local DexWindow102 = CreateInstance("ImageButton",{Image="",ImageColor3=Color3.new(1,1,1),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=0,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),AutoButtonColor=false,Modal=false,Selected=false,Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.8666667342186,0.8666667342186,0.8666667342186),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,-16,0,40),Rotation=0,Selectable=true,Size=UDim2.new(0,16,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="ScriptBarRight",Parent = DexWindow95})
  112.     local DexWindow103 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.5,-4,0.5,-4),Rotation=0,Selectable=false,Size=UDim2.new(0,8,0,8),SizeConstraint=0,Visible=true,ZIndex=1,Name="Arrow Graphic",Parent = DexWindow102})
  113.     local DexWindow104 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BackgroundTransparency=0.69999998807907,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.625,0,0.375,0),Rotation=0,Selectable=false,Size=UDim2.new(0.125,0,0.25,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="Graphic",Parent = DexWindow103})
  114.     local DexWindow105 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BackgroundTransparency=0.69999998807907,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.5,0,0.25,0),Rotation=0,Selectable=false,Size=UDim2.new(0.125,0,0.5,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="Graphic",Parent = DexWindow103})
  115.     local DexWindow106 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BackgroundTransparency=0.69999998807907,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.375,0,0.125,0),Rotation=0,Selectable=false,Size=UDim2.new(0.125,0,0.75,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="Graphic",Parent = DexWindow103})
  116.     local DexWindow107 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BackgroundTransparency=0.69999998807907,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0.25,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0.125,0,1,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="Graphic",Parent = DexWindow103})
  117.     local DexWindow108 = CreateInstance("TextButton",{Font=3,FontSize=5,Text="To Clipboard",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,20),Rotation=0,Selectable=true,Size=UDim2.new(0,80,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="Clipboard",Parent = DexWindow95})
  118.     local DexWindow109 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.82352948188782,0.82352948188782,0.82352948188782),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,0,0,40),Rotation=0,Selectable=false,Size=UDim2.new(1,-32,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="ScriptBar",Parent = DexWindow95})
  119.     local DexWindow110 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,100,1,0),SizeConstraint=0,Visible=false,ZIndex=1,Name="Entry",Parent = DexWindow95})
  120.     local DexWindow111 = CreateInstance("TextButton",{Font=3,FontSize=4,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=12,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.60000002384186,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=true,Size=UDim2.new(1,0,1,0),SizeConstraint=0,Visible=true,ZIndex=4,Name="Button",Parent = DexWindow110})
  121.     local DexWindow112 = CreateInstance("TextButton",{Font=3,FontSize=5,Text="X",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,-20,0,0),Rotation=0,Selectable=true,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=4,Name="Close",Parent = DexWindow110})
  122.     local DexWindow113 = CreateInstance("BindableEvent",{Name="OpenScript",Parent = DexWindow91})
  123.     local DexWindow114 = CreateInstance("TextButton",{Font=3,FontSize=5,Text="X",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,-20,0,0),Rotation=0,Selectable=true,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=5,Name="Close",Parent = DexWindow91})
  124.     local DexWindow115 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.96078437566757,0.96078437566757,0.96078437566757),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,30,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,300,1,0),SizeConstraint=0,Visible=true,ZIndex=2,Name="IntroFrame",Parent = DexWindow})
  125.     local DexWindow116 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.96078437566757,0.96078437566757,0.96078437566757),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,-30,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,30,0,90),SizeConstraint=0,Visible=true,ZIndex=2,Name="Main",Parent = DexWindow115})
  126.     local DexWindow117 = CreateInstance("TextLabel",{Font=4,FontSize=13,Text="DEX",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=60,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,100,0,150),Rotation=0,Selectable=false,Size=UDim2.new(0,100,0,60),SizeConstraint=0,Visible=true,ZIndex=2,Name="Title",Parent = DexWindow115})
  127.     local DexWindow118 = CreateInstance("TextLabel",{Font=4,FontSize=10,Text="V1.0.0",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=28,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,100,0,210),Rotation=0,Selectable=false,Size=UDim2.new(0,100,0,30),SizeConstraint=0,Visible=true,ZIndex=2,Name="Version",Parent = DexWindow115})
  128.     local DexWindow119 = CreateInstance("TextLabel",{Font=4,FontSize=10,Text="Raspberry Pi  &  Moon",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=28,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,80,0,300),Rotation=0,Selectable=true,Size=UDim2.new(0,140,0,50),SizeConstraint=0,Visible=true,ZIndex=2,Name="Creator",Parent = DexWindow115})
  129.     local DexWindow120 = CreateInstance("ImageLabel",{Image="rbxassetid://474172996",ImageColor3=Color3.new(0.96078437566757,0.96078437566757,0.96078437566757),ImageRectOffset=Vector2.new(0,0),ImageRectSize=Vector2.new(0,0),ImageTransparency=0,ScaleType=0,SliceCenter=Rect.new(0,0,0,0),Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,-30,0,90),Rotation=180,Selectable=false,Size=UDim2.new(0,30,0,30),SizeConstraint=0,Visible=true,ZIndex=2,Name="Slant",Parent = DexWindow115})
  130.     local DexWindow121 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.10000000149012,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,300,1,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="SaveMapWindow",Parent = DexWindow})
  131.     local DexWindow122 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,17),SizeConstraint=0,Visible=true,ZIndex=1,Name="Header",Parent = DexWindow121})
  132.     local DexWindow123 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Map Downloader",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,4,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-4,1,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="TextLabel",Parent = DexWindow122})
  133.     local DexWindow124 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,200),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,240),SizeConstraint=0,Visible=true,ZIndex=1,Name="MapSettings",Parent = DexWindow121})
  134.     local DexWindow125 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,60),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,60),SizeConstraint=0,Visible=true,ZIndex=1,Name="Terrain",Parent = DexWindow124})
  135.     local DexWindow126 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Save Terrain",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-20,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="SName",Parent = DexWindow125})
  136.     local DexWindow127 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Off",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,60,0,30),Rotation=0,Selectable=false,Size=UDim2.new(0,50,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="Status",Parent = DexWindow125})
  137.     local DexWindow128 = CreateInstance("TextButton",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.86274516582489,0.86274516582489,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,30),Rotation=0,Selectable=true,Size=UDim2.new(0,40,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="Change",Parent = DexWindow125})
  138.     local DexWindow129 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0,0.57647061347961,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,0,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="OnBar",Parent = DexWindow128})
  139.     local DexWindow130 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,-2,0,-2),Rotation=0,Selectable=false,Size=UDim2.new(0,10,0,19),SizeConstraint=0,Visible=true,ZIndex=1,Name="Bar",Parent = DexWindow128})
  140.     local DexWindow131 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,120),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,60),SizeConstraint=0,Visible=true,ZIndex=1,Name="Lighting",Parent = DexWindow124})
  141.     local DexWindow132 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Lighting Properties",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-20,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="SName",Parent = DexWindow131})
  142.     local DexWindow133 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Off",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,60,0,30),Rotation=0,Selectable=false,Size=UDim2.new(0,50,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="Status",Parent = DexWindow131})
  143.     local DexWindow134 = CreateInstance("TextButton",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.86274516582489,0.86274516582489,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,30),Rotation=0,Selectable=true,Size=UDim2.new(0,40,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="Change",Parent = DexWindow131})
  144.     local DexWindow135 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0,0.57647061347961,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,0,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="OnBar",Parent = DexWindow134})
  145.     local DexWindow136 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,-2,0,-2),Rotation=0,Selectable=false,Size=UDim2.new(0,10,0,19),SizeConstraint=0,Visible=true,ZIndex=1,Name="Bar",Parent = DexWindow134})
  146.     local DexWindow137 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,180),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,60),SizeConstraint=0,Visible=true,ZIndex=1,Name="CameraInstances",Parent = DexWindow124})
  147.     local DexWindow138 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Camera Instances",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-20,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="SName",Parent = DexWindow137})
  148.     local DexWindow139 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Off",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,60,0,30),Rotation=0,Selectable=false,Size=UDim2.new(0,50,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="Status",Parent = DexWindow137})
  149.     local DexWindow140 = CreateInstance("TextButton",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.86274516582489,0.86274516582489,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,30),Rotation=0,Selectable=true,Size=UDim2.new(0,40,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="Change",Parent = DexWindow137})
  150.     local DexWindow141 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0,0.57647061347961,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,0,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="OnBar",Parent = DexWindow140})
  151.     local DexWindow142 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,-2,0,-2),Rotation=0,Selectable=false,Size=UDim2.new(0,10,0,19),SizeConstraint=0,Visible=true,ZIndex=1,Name="Bar",Parent = DexWindow140})
  152.     local DexWindow143 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,60),SizeConstraint=0,Visible=true,ZIndex=1,Name="Scripts",Parent = DexWindow124})
  153.     local DexWindow144 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Save Scripts",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-20,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="SName",Parent = DexWindow143})
  154.     local DexWindow145 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Off",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,60,0,30),Rotation=0,Selectable=false,Size=UDim2.new(0,50,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="Status",Parent = DexWindow143})
  155.     local DexWindow146 = CreateInstance("TextButton",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.86274516582489,0.86274516582489,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,30),Rotation=0,Selectable=true,Size=UDim2.new(0,40,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="Change",Parent = DexWindow143})
  156.     local DexWindow147 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0,0.57647061347961,0.86274516582489),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,0,0,15),SizeConstraint=0,Visible=true,ZIndex=1,Name="OnBar",Parent = DexWindow146})
  157.     local DexWindow148 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=true,Draggable=false,Position=UDim2.new(0,-2,0,-2),Rotation=0,Selectable=false,Size=UDim2.new(0,10,0,19),SizeConstraint=0,Visible=true,ZIndex=1,Name="Bar",Parent = DexWindow146})
  158.     local DexWindow149 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="To Save",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,17),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,20),SizeConstraint=0,Visible=true,ZIndex=1,Name="ToSave",Parent = DexWindow121})
  159.     local DexWindow150 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.80000001192093,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,37),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,163),SizeConstraint=0,Visible=true,ZIndex=1,Name="CopyList",Parent = DexWindow121})
  160.     local DexWindow151 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,1,-50),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,50),SizeConstraint=0,Visible=true,ZIndex=1,Name="Bottom",Parent = DexWindow121})
  161.     local DexWindow152 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="After the map saves, open a new place on studio, then right click Lighting and \"Insert from file...\", then select your file and run the unpacker script inside the folder.",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=0,TextYAlignment=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,4,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-4,1,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="TextLabel",Parent = DexWindow151})
  162.     local DexWindow153 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="Save",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.94117653369904,0.94117653369904,0.94117653369904),BackgroundTransparency=0.80000001192093,BorderColor3=Color3.new(0,0,0),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,1,-80),Rotation=0,Selectable=true,Size=UDim2.new(1,0,0,30),SizeConstraint=0,Visible=true,ZIndex=1,Name="Save",Parent = DexWindow121})
  163.     local DexWindow154 = CreateInstance("TextBox",{ClearTextOnFocus=true,Font=3,FontSize=6,MultiLine=false,Text="PlaceName",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.94117653369904,0.94117653369904,0.94117653369904),BackgroundTransparency=0.60000002384186,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,1,-105),Rotation=0,Selectable=true,Size=UDim2.new(1,0,0,25),SizeConstraint=0,Visible=true,ZIndex=1,Name="FileName",Parent = DexWindow121})
  164.     local DexWindow155 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,22),SizeConstraint=0,Visible=false,ZIndex=1,Name="Entry",Parent = DexWindow121})
  165.     local DexWindow156 = CreateInstance("TextButton",{Font=3,FontSize=6,Text="",TextColor3=Color3.new(1,1,1),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,AutoButtonColor=true,Modal=false,Selected=false,Style=0,Active=true,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.60000002384186,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,10,0,1),Rotation=0,Selectable=true,Size=UDim2.new(0,20,0,20),SizeConstraint=0,Visible=true,ZIndex=2,Name="Change",Parent = DexWindow155})
  166.     local DexWindow157 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.38039219379425,0.38039219379425,0.38039219379425),BackgroundTransparency=0.40000000596046,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=0,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,3,0,3),Rotation=0,Selectable=false,Size=UDim2.new(0,14,0,14),SizeConstraint=0,Visible=true,ZIndex=1,Name="enabled",Parent = DexWindow156})
  167.     local DexWindow158 = CreateInstance("TextLabel",{Font=3,FontSize=6,Text="Workspace",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=18,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,40,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-40,0,22),SizeConstraint=0,Visible=true,ZIndex=1,Name="Info",Parent = DexWindow155})
  168.     local DexWindow159 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.10000000149012,BorderColor3=Color3.new(0.74901962280273,0.74901962280273,0.74901962280273),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(1,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(0,300,1,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="RemoteDebugWindow",Parent = DexWindow})
  169.     local DexWindow160 = CreateInstance("Frame",{Style=0,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.91372555494308,0.91372555494308,0.91372555494308),BackgroundTransparency=0,BorderColor3=Color3.new(0.58431375026703,0.58431375026703,0.58431375026703),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,17),SizeConstraint=0,Visible=true,ZIndex=1,Name="Header",Parent = DexWindow159})
  170.     local DexWindow161 = CreateInstance("TextLabel",{Font=3,FontSize=5,Text="Remote Debugger",TextColor3=Color3.new(0,0,0),TextScaled=false,TextSize=14,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=false,TextXAlignment=0,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(0.63921570777893,0.63529413938522,0.64705884456635),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,4,0,0),Rotation=0,Selectable=false,Size=UDim2.new(1,-4,1,0),SizeConstraint=0,Visible=true,ZIndex=1,Name="TextLabel",Parent = DexWindow160})
  171.     local DexWindow162 = CreateInstance("BindableFunction",{Name="GetSetting",Parent = DexWindow159})
  172.     local DexWindow163 = CreateInstance("TextLabel",{Font=3,FontSize=11,Text="Have fun with remotes",TextColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),TextScaled=false,TextSize=32,TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=1,TextTransparency=0,TextWrapped=true,TextXAlignment=2,TextYAlignment=1,Active=false,AnchorPoint=Vector2.new(0,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.10588236153126,0.16470588743687,0.20784315466881),BorderSizePixel=1,ClipsDescendants=false,Draggable=false,Position=UDim2.new(0,0,0,20),Rotation=0,Selectable=false,Size=UDim2.new(1,0,0,40),SizeConstraint=0,Visible=true,ZIndex=1,Name="Desc",Parent = DexWindow159})
  173.     return DexWindow
  174. end
  175.  
  176. function placeGui()
  177.     if pcall(function() local d = game:GetService("CoreGui").Name end) then
  178.         return game:GetService("CoreGui")
  179.     else
  180.         return game:GetService("Players").LocalPlayer:FindFirstChildOfClass("PlayerGui")
  181.     end
  182. end
  183.  
  184. local D_E_X = createDexWindow()
  185. D_E_X.ResetOnSpawn = false
  186. D_E_X.Parent = placeGui()
  187.  
  188. spawn(function()
  189.     local Gui = D_E_X
  190.  
  191. local IntroFrame = Gui:WaitForChild("IntroFrame")
  192.  
  193. local SideMenu = Gui:WaitForChild("SideMenu")
  194. local OpenToggleButton = Gui:WaitForChild("Toggle")
  195. local CloseToggleButton = SideMenu:WaitForChild("Toggle")
  196. local OpenScriptEditorButton = SideMenu:WaitForChild("OpenScriptEditor")
  197.  
  198. local ScriptEditor = Gui:WaitForChild("ScriptEditor")
  199.  
  200. local SlideOut = SideMenu:WaitForChild("SlideOut")
  201. local SlideFrame = SlideOut:WaitForChild("SlideFrame")
  202. local Slant = SideMenu:WaitForChild("Slant")
  203.  
  204. local ExplorerButton = SlideFrame:WaitForChild("Explorer")
  205. local SettingsButton = SlideFrame:WaitForChild("Settings")
  206.  
  207. local SelectionBox = Instance.new("SelectionBox")
  208. SelectionBox.Parent = Gui
  209.  
  210. local ExplorerPanel = Gui:WaitForChild("ExplorerPanel")
  211. local PropertiesFrame = Gui:WaitForChild("PropertiesFrame")
  212. local SaveMapWindow = Gui:WaitForChild("SaveMapWindow")
  213. local RemoteDebugWindow = Gui:WaitForChild("RemoteDebugWindow")
  214.  
  215. local SettingsPanel = Gui:WaitForChild("SettingsPanel")
  216. local SettingsListener = SettingsPanel:WaitForChild("GetSetting")
  217. local SettingTemplate = SettingsPanel:WaitForChild("SettingTemplate")
  218. local SettingList = SettingsPanel:WaitForChild("SettingList")
  219.  
  220. local SaveMapCopyList = SaveMapWindow:WaitForChild("CopyList")
  221. local SaveMapSettingFrame = SaveMapWindow:WaitForChild("MapSettings")
  222. local SaveMapName = SaveMapWindow:WaitForChild("FileName")
  223. local SaveMapButton = SaveMapWindow:WaitForChild("Save")
  224. local SaveMapCopyTemplate = SaveMapWindow:WaitForChild("Entry")
  225. local SaveMapSettings = {
  226.     CopyWhat = {
  227.         Workspace = true,
  228.         Lighting = true,
  229.         ReplicatedStorage = true,
  230.         ReplicatedFirst = true,
  231.         StarterPack = true,
  232.         StarterGui = true,
  233.         StarterPlayer = true
  234.     },
  235.     SaveScripts = true,
  236.     SaveTerrain = true,
  237.     LightingProperties = true,
  238.     CameraInstances = true
  239. }
  240.  
  241. --[[
  242. local ClickSelectOption = SettingsPanel:WaitForChild("ClickSelect"):WaitForChild("Change")
  243. local SelectionBoxOption = SettingsPanel:WaitForChild("SelectionBox"):WaitForChild("Change")
  244. local ClearPropsOption = SettingsPanel:WaitForChild("ClearProperties"):WaitForChild("Change")
  245. local SelectUngroupedOption = SettingsPanel:WaitForChild("SelectUngrouped"):WaitForChild("Change")
  246. --]]
  247.  
  248. local SelectionChanged = ExplorerPanel:WaitForChild("SelectionChanged")
  249. local GetSelection = ExplorerPanel:WaitForChild("GetSelection")
  250. local SetSelection = ExplorerPanel:WaitForChild("SetSelection")
  251.  
  252. local Player = game:GetService("Players").LocalPlayer
  253. local Mouse = Player:GetMouse()
  254.  
  255. local CurrentWindow = "Nothing c:"
  256. local Windows = {
  257.     Explorer = {
  258.         ExplorerPanel,
  259.         PropertiesFrame
  260.     },
  261.     Settings = {SettingsPanel},
  262.     SaveMap = {SaveMapWindow},
  263.     Remotes = {RemoteDebugWindow}
  264. }
  265.  
  266. function switchWindows(wName,over)
  267.     if CurrentWindow == wName and not over then return end
  268.    
  269.     local count = 0
  270.    
  271.     for i,v in pairs(Windows) do
  272.         count = 0
  273.         if i ~= wName then
  274.             for _,c in pairs(v) do c:TweenPosition(UDim2.new(1, 30, count * 0.5, count * 36), "Out", "Quad", 0.5, true) count = count + 1 end
  275.         end
  276.     end
  277.    
  278.     count = 0
  279.    
  280.     if Windows[wName] then
  281.         for _,c in pairs(Windows[wName]) do c:TweenPosition(UDim2.new(1, -300, count * 0.5, count * 36), "Out", "Quad", 0.5, true) count = count + 1 end
  282.     end
  283.    
  284.     if wName ~= "Nothing c:" then
  285.         CurrentWindow = wName
  286.         for i,v in pairs(SlideFrame:GetChildren()) do
  287.             v.BackgroundTransparency = 1
  288.             v.Icon.ImageColor3 = Color3.new(70/255, 70/255, 70/255)
  289.         end
  290.         if SlideFrame:FindFirstChild(wName) then
  291.             SlideFrame[wName].BackgroundTransparency = 0.5
  292.             SlideFrame[wName].Icon.ImageColor3 = Color3.new(0,0,0)
  293.         end
  294.     end
  295. end
  296.  
  297. function toggleDex(on)
  298.     if on then
  299.         SideMenu:TweenPosition(UDim2.new(1, -330, 0, 0), "Out", "Quad", 0.5, true)
  300.         OpenToggleButton:TweenPosition(UDim2.new(1,0,0,0), "Out", "Quad", 0.5, true)
  301.         switchWindows(CurrentWindow,true)
  302.     else
  303.         SideMenu:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Quad", 0.5, true)
  304.         OpenToggleButton:TweenPosition(UDim2.new(1,-30,0,0), "Out", "Quad", 0.5, true)
  305.         switchWindows("Nothing c:")
  306.     end
  307. end
  308.  
  309. local Settings = {
  310.     ClickSelect = false,
  311.     SelBox = false,
  312.     ClearProps = false,
  313.     SelectUngrouped = true,
  314.     SaveInstanceScripts = true
  315. }
  316.  
  317. function ReturnSetting(set)
  318.     if set == "ClearProps" then
  319.         return Settings.ClearProps
  320.     elseif set == "SelectUngrouped" then
  321.         return Settings.SelectUngrouped
  322.     end
  323. end
  324.  
  325. OpenToggleButton.MouseButton1Up:connect(function()
  326.     toggleDex(true)
  327. end)
  328.  
  329. OpenScriptEditorButton.MouseButton1Up:connect(function()
  330.     if OpenScriptEditorButton.Active then
  331.         ScriptEditor.Visible = true
  332.     end
  333. end)
  334.  
  335. CloseToggleButton.MouseButton1Up:connect(function()
  336.     if CloseToggleButton.Active then
  337.         toggleDex(false)
  338.     end
  339. end)
  340.  
  341. --[[
  342. OpenToggleButton.MouseButton1Up:connect(function()
  343.     SideMenu:TweenPosition(UDim2.new(1, -330, 0, 0), "Out", "Quad", 0.5, true)
  344.    
  345.     if CurrentWindow == "Explorer" then
  346.         ExplorerPanel:TweenPosition(UDim2.new(1, -300, 0, 0), "Out", "Quad", 0.5, true)
  347.         PropertiesFrame:TweenPosition(UDim2.new(1, -300, 0.5, 36), "Out", "Quad", 0.5, true)
  348.     else
  349.         SettingsPanel:TweenPosition(UDim2.new(1, -300, 0, 0), "Out", "Quad", 0.5, true)
  350.     end
  351.    
  352.     OpenToggleButton:TweenPosition(UDim2.new(1,0,0,0), "Out", "Quad", 0.5, true)
  353. end)
  354.  
  355. CloseToggleButton.MouseButton1Up:connect(function()
  356.     SideMenu:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Quad", 0.5, true)
  357.    
  358.     ExplorerPanel:TweenPosition(UDim2.new(1, 30, 0, 0), "Out", "Quad", 0.5, true)
  359.     PropertiesFrame:TweenPosition(UDim2.new(1, 30, 0.5, 36), "Out", "Quad", 0.5, true)
  360.     SettingsPanel:TweenPosition(UDim2.new(1, 30, 0, 0), "Out", "Quad", 0.5, true)
  361.    
  362.     OpenToggleButton:TweenPosition(UDim2.new(1,-30,0,0), "Out", "Quad", 0.5, true)
  363. end)
  364. --]]
  365.  
  366. --[[
  367. ExplorerButton.MouseButton1Up:connect(function()
  368.     switchWindows("Explorer")
  369. end)
  370.  
  371. SettingsButton.MouseButton1Up:connect(function()
  372.     switchWindows("Settings")
  373. end)
  374. --]]
  375.  
  376. for i,v in pairs(SlideFrame:GetChildren()) do
  377.     v.MouseButton1Click:connect(function()
  378.         switchWindows(v.Name)
  379.     end)
  380.    
  381.     v.MouseEnter:connect(function()v.BackgroundTransparency = 0.5 end)
  382.     v.MouseLeave:connect(function()if CurrentWindow~=v.Name then v.BackgroundTransparency = 1 end end)
  383. end
  384.  
  385. --[[
  386. ExplorerButton.MouseButton1Up:connect(function()
  387.     if CurrentWindow ~= "Explorer" then
  388.         CurrentWindow = "Explorer"
  389.        
  390.         ExplorerPanel:TweenPosition(UDim2.new(1, -300, 0, 0), "Out", "Quad", 0.5, true)
  391.         PropertiesFrame:TweenPosition(UDim2.new(1, -300, 0.5, 36), "Out", "Quad", 0.5, true)
  392.         SettingsPanel:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Quad", 0.5, true)
  393.     end
  394. end)
  395.  
  396. SettingsButton.MouseButton1Up:connect(function()
  397.     if CurrentWindow ~= "Settings" then
  398.         CurrentWindow = "Settings"
  399.        
  400.         ExplorerPanel:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Quad", 0.5, true)
  401.         PropertiesFrame:TweenPosition(UDim2.new(1, 0, 0.5, 36), "Out", "Quad", 0.5, true)
  402.         SettingsPanel:TweenPosition(UDim2.new(1, -300, 0, 0), "Out", "Quad", 0.5, true)
  403.     end
  404. end)
  405. --]]
  406.  
  407. function createSetting(name,interName,defaultOn)
  408.     local newSetting = SettingTemplate:Clone()
  409.     newSetting.Position = UDim2.new(0,0,0,#SettingList:GetChildren() * 60)
  410.     newSetting.SName.Text = name
  411.    
  412.     local function toggle(on)
  413.         if on then
  414.             newSetting.Change.Bar:TweenPosition(UDim2.new(0,32,0,-2),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
  415.             newSetting.Change.OnBar:TweenSize(UDim2.new(0,34,0,15),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
  416.             newSetting.Status.Text = "On"
  417.             Settings[interName] = true
  418.         else
  419.             newSetting.Change.Bar:TweenPosition(UDim2.new(0,-2,0,-2),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
  420.             newSetting.Change.OnBar:TweenSize(UDim2.new(0,0,0,15),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
  421.             newSetting.Status.Text = "Off"
  422.             Settings[interName] = false
  423.         end
  424.     end
  425.    
  426.     newSetting.Change.MouseButton1Click:connect(function()
  427.         toggle(not Settings[interName])
  428.     end)
  429.    
  430.     newSetting.Visible = true
  431.     newSetting.Parent = SettingList
  432.    
  433.     if defaultOn then
  434.         toggle(true)
  435.     end
  436. end
  437.  
  438. createSetting("Click part to select","ClickSelect",false)
  439. createSetting("Selection Box","SelBox",false)
  440. createSetting("Clear property value on focus","ClearProps",false)
  441. createSetting("Select ungrouped models","SelectUngrouped",true)
  442. createSetting("SaveInstance decompiles scripts","SaveInstanceScripts",true)
  443.  
  444. --[[
  445. ClickSelectOption.MouseButton1Up:connect(function()
  446.     if Settings.ClickSelect then
  447.         Settings.ClickSelect = false
  448.         ClickSelectOption.Text = "OFF"
  449.     else
  450.         Settings.ClickSelect = true
  451.         ClickSelectOption.Text = "ON"
  452.     end
  453. end)
  454.  
  455. SelectionBoxOption.MouseButton1Up:connect(function()
  456.     if Settings.SelBox then
  457.         Settings.SelBox = false
  458.         SelectionBox.Adornee = nil
  459.         SelectionBoxOption.Text = "OFF"
  460.     else
  461.         Settings.SelBox = true
  462.         SelectionBoxOption.Text = "ON"
  463.     end
  464. end)
  465.  
  466. ClearPropsOption.MouseButton1Up:connect(function()
  467.     if Settings.ClearProps then
  468.         Settings.ClearProps = false
  469.         ClearPropsOption.Text = "OFF"
  470.     else
  471.         Settings.ClearProps = true
  472.         ClearPropsOption.Text = "ON"
  473.     end
  474. end)
  475.  
  476. SelectUngroupedOption.MouseButton1Up:connect(function()
  477.     if Settings.SelectUngrouped then
  478.         Settings.SelectUngrouped = false
  479.         SelectUngroupedOption.Text = "OFF"
  480.     else
  481.         Settings.SelectUngrouped = true
  482.         SelectUngroupedOption.Text = "ON"
  483.     end
  484. end)
  485. --]]
  486.  
  487. local function getSelection()
  488.     local t = GetSelection:Invoke()
  489.     if t and #t > 0 then
  490.         return t[1]
  491.     else
  492.         return nil
  493.     end
  494. end
  495.  
  496. Mouse.Button1Down:connect(function()
  497.     if CurrentWindow == "Explorer" and Settings.ClickSelect then
  498.         local target = Mouse.Target
  499.         if target then
  500.             SetSelection:Invoke({target})
  501.         end
  502.     end
  503. end)
  504.  
  505. SelectionChanged.Event:connect(function()
  506.     if Settings.SelBox then
  507.         local success = pcall(function()
  508.             local selection = getSelection()
  509.             SelectionBox.Adornee = selection
  510.         end)
  511.         if not success then
  512.             SelectionBox.Adornee = nil
  513.         end
  514.     end
  515. end)
  516.  
  517. SettingsListener.OnInvoke = ReturnSetting
  518.  
  519. -- Map Copier
  520.  
  521. function createMapSetting(obj,interName,defaultOn)
  522.     local function toggle(on)
  523.         if on then
  524.             obj.Change.Bar:TweenPosition(UDim2.new(0,32,0,-2),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
  525.             obj.Change.OnBar:TweenSize(UDim2.new(0,34,0,15),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
  526.             obj.Status.Text = "On"
  527.             SaveMapSettings[interName] = true
  528.         else
  529.             obj.Change.Bar:TweenPosition(UDim2.new(0,-2,0,-2),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
  530.             obj.Change.OnBar:TweenSize(UDim2.new(0,0,0,15),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
  531.             obj.Status.Text = "Off"
  532.             SaveMapSettings[interName] = false
  533.         end
  534.     end
  535.    
  536.     obj.Change.MouseButton1Click:connect(function()
  537.         toggle(not SaveMapSettings[interName])
  538.     end)
  539.    
  540.     obj.Visible = true
  541.     obj.Parent = SaveMapSettingFrame
  542.    
  543.     if defaultOn then
  544.         toggle(true)
  545.     end
  546. end
  547.  
  548. function createCopyWhatSetting(serv)
  549.     if SaveMapSettings.CopyWhat[serv] then
  550.         local newSetting = SaveMapCopyTemplate:Clone()
  551.         newSetting.Position = UDim2.new(0,0,0,#SaveMapCopyList:GetChildren() * 22 + 5)
  552.         newSetting.Info.Text = serv
  553.        
  554.         local function toggle(on)
  555.             if on then
  556.                 newSetting.Change.enabled.Visible = true
  557.                 SaveMapSettings.CopyWhat[serv] = true
  558.             else
  559.                 newSetting.Change.enabled.Visible = false
  560.                 SaveMapSettings.CopyWhat[serv] = false
  561.             end
  562.         end
  563.    
  564.         newSetting.Change.MouseButton1Click:connect(function()
  565.             toggle(not SaveMapSettings.CopyWhat[serv])
  566.         end)
  567.        
  568.         newSetting.Visible = true
  569.         newSetting.Parent = SaveMapCopyList
  570.     end
  571. end
  572.  
  573. createMapSetting(SaveMapSettingFrame.Scripts,"SaveScripts",true)
  574. createMapSetting(SaveMapSettingFrame.Terrain,"SaveTerrain",true)
  575. createMapSetting(SaveMapSettingFrame.Lighting,"LightingProperties",true)
  576. createMapSetting(SaveMapSettingFrame.CameraInstances,"CameraInstances",true)
  577.  
  578. createCopyWhatSetting("Workspace")
  579. createCopyWhatSetting("Lighting")
  580. createCopyWhatSetting("ReplicatedStorage")
  581. createCopyWhatSetting("ReplicatedFirst")
  582. createCopyWhatSetting("StarterPack")
  583. createCopyWhatSetting("StarterGui")
  584. createCopyWhatSetting("StarterPlayer")
  585.  
  586. SaveMapName.Text = tostring(game.PlaceId).."MapCopy"
  587.  
  588. SaveMapButton.MouseButton1Click:connect(function()
  589.     local copyWhat = {}
  590.  
  591.     local copyGroup = Instance.new("Model",game.ReplicatedStorage)
  592.  
  593.     local copyScripts = SaveMapSettings.SaveScripts
  594.  
  595.     local copyTerrain = SaveMapSettings.SaveTerrain
  596.  
  597.     local lightingProperties = SaveMapSettings.LightingProperties
  598.  
  599.     local cameraInstances = SaveMapSettings.CameraInstances
  600.  
  601.     -----------------------------------------------------------------------------------
  602.  
  603.     for i,v in pairs(SaveMapSettings.CopyWhat) do
  604.         if v then
  605.             table.insert(copyWhat,i)
  606.         end
  607.     end
  608.  
  609.     local consoleFunc = printconsole or writeconsole
  610.  
  611.     if consoleFunc then
  612.         consoleFunc("Raspberry Pi's place copier loaded.")
  613.         consoleFunc("Copying map of game "..tostring(game.PlaceId)..".")
  614.     end
  615.  
  616.     function archivable(root)
  617.         for i,v in pairs(root:GetChildren()) do
  618.             if not game.Players:GetPlayerFromCharacter(v) then
  619.                 v.Archivable = true
  620.                 archivable(v)
  621.             end
  622.         end
  623.     end
  624.  
  625.     function decompileS(root)
  626.         for i,v in pairs(root:GetChildren()) do
  627.             pcall(function()
  628.                 if v:IsA("LocalScript") then
  629.                     local isDisabled = v.Disabled
  630.                     v.Disabled = true
  631.                     v.Source = decompile(v)
  632.                     v.Disabled = isDisabled
  633.                
  634.                     if v.Source == "" then
  635.                         if consoleFunc then consoleFunc("LocalScript "..v.Name.." had a problem decompiling.") end
  636.                     else
  637.                         if consoleFunc then consoleFunc("LocalScript "..v.Name.." decompiled.") end
  638.                     end
  639.                 elseif v:IsA("ModuleScript") then
  640.                     v.Source = decompile(v)
  641.                
  642.                     if v.Source == "" then
  643.                         if consoleFunc then consoleFunc("ModuleScript "..v.Name.." had a problem decompiling.") end
  644.                     else
  645.                         if consoleFunc then consoleFunc("ModuleScript "..v.Name.." decompiled.") end
  646.                     end
  647.                 end
  648.             end)
  649.             decompileS(v)
  650.         end
  651.     end
  652.  
  653.     for i,v in pairs(copyWhat) do archivable(game[v]) end
  654.  
  655.     for j,obj in pairs(copyWhat) do
  656.         if obj ~= "StarterPlayer" then
  657.             local newFolder = Instance.new("Folder",copyGroup)
  658.             newFolder.Name = obj
  659.             for i,v in pairs(game[obj]:GetChildren()) do
  660.                 if v ~= copyGroup then
  661.                     pcall(function()
  662.                         v:Clone().Parent = newFolder
  663.                     end)
  664.                 end
  665.             end
  666.         else
  667.             local newFolder = Instance.new("Model",copyGroup)
  668.             newFolder.Name = "StarterPlayer"
  669.             for i,v in pairs(game[obj]:GetChildren()) do
  670.                 local newObj = Instance.new("Folder",newFolder)
  671.                 newObj.Name = v.Name
  672.                 for _,c in pairs(v:GetChildren()) do
  673.                     if c.Name ~= "ControlScript" and c.Name ~= "CameraScript" then
  674.                         c:Clone().Parent = newObj
  675.                     end
  676.                 end
  677.             end
  678.         end
  679.     end
  680.  
  681.     if workspace.CurrentCamera and cameraInstances then
  682.         local cameraFolder = Instance.new("Model",copyGroup)
  683.         cameraFolder.Name = "CameraItems"
  684.         for i,v in pairs(workspace.CurrentCamera:GetChildren()) do v:Clone().Parent = cameraFolder end
  685.     end
  686.  
  687.     if copyTerrain then
  688.         local myTerrain = workspace.Terrain:CopyRegion(workspace.Terrain.MaxExtents)
  689.         myTerrain.Parent = copyGroup
  690.     end
  691.  
  692.     function saveProp(obj,prop,par)
  693.         local myProp = obj[prop]
  694.         if type(myProp) == "boolean" then
  695.             local newProp = Instance.new("BoolValue",par)
  696.             newProp.Name = prop
  697.             newProp.Value = myProp
  698.         elseif type(myProp) == "number" then
  699.             local newProp = Instance.new("IntValue",par)
  700.             newProp.Name = prop
  701.             newProp.Value = myProp
  702.         elseif type(myProp) == "string" then
  703.             local newProp = Instance.new("StringValue",par)
  704.             newProp.Name = prop
  705.             newProp.Value = myProp
  706.         elseif type(myProp) == "userdata" then -- Assume Color3
  707.             pcall(function()
  708.                 local newProp = Instance.new("Color3Value",par)
  709.                 newProp.Name = prop
  710.                 newProp.Value = myProp
  711.             end)
  712.         end
  713.     end
  714.  
  715.     if lightingProperties then
  716.         local lightingProps = Instance.new("Model",copyGroup)
  717.         lightingProps.Name = "LightingProperties"
  718.    
  719.         saveProp(game.Lighting,"Ambient",lightingProps)
  720.         saveProp(game.Lighting,"Brightness",lightingProps)
  721.         saveProp(game.Lighting,"ColorShift_Bottom",lightingProps)
  722.         saveProp(game.Lighting,"ColorShift_Top",lightingProps)
  723.         saveProp(game.Lighting,"GlobalShadows",lightingProps)
  724.         saveProp(game.Lighting,"OutdoorAmbient",lightingProps)
  725.         saveProp(game.Lighting,"Outlines",lightingProps)
  726.         saveProp(game.Lighting,"GeographicLatitude",lightingProps)
  727.         saveProp(game.Lighting,"TimeOfDay",lightingProps)
  728.         saveProp(game.Lighting,"FogColor",lightingProps)
  729.         saveProp(game.Lighting,"FogEnd",lightingProps)
  730.         saveProp(game.Lighting,"FogStart",lightingProps)
  731.     end
  732.  
  733.     if decompile and copyScripts then
  734.         decompileS(copyGroup)
  735.     end
  736.  
  737.     if SaveInstance then
  738.         SaveInstance(copyGroup,SaveMapName.Text..".rbxm")
  739.     elseif saveinstance then
  740.         saveinstance(getelysianpath()..SaveMapName.Text..".rbxm",copyGroup)
  741.     end
  742.     --print("Saved!")
  743.     if consoleFunc then
  744.         consoleFunc("The map has been copied.")
  745.     end
  746.     SaveMapButton.Text = "The map has been saved"
  747.     wait(5)
  748.     SaveMapButton.Text = "Save"
  749. end)
  750.  
  751. -- End Copier
  752.  
  753. wait()
  754.  
  755. IntroFrame:TweenPosition(UDim2.new(1,-300,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
  756.  
  757. switchWindows("Explorer")
  758.  
  759. wait(1)
  760.  
  761. SideMenu.Visible = true
  762.  
  763. for i = 0,1,0.1 do
  764.     IntroFrame.BackgroundTransparency = i
  765.     IntroFrame.Main.BackgroundTransparency = i
  766.     IntroFrame.Slant.ImageTransparency = i
  767.     IntroFrame.Title.TextTransparency = i
  768.     IntroFrame.Version.TextTransparency = i
  769.     IntroFrame.Creator.TextTransparency = i
  770.     wait()
  771. end
  772.  
  773. IntroFrame.Visible = false
  774.  
  775. SlideFrame:TweenPosition(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
  776. OpenScriptEditorButton:TweenPosition(UDim2.new(0,0,0,180),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
  777. CloseToggleButton:TweenPosition(UDim2.new(0,0,0,210),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
  778. Slant:TweenPosition(UDim2.new(0,0,0,240),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
  779.  
  780. wait(0.5)
  781.  
  782. for i = 1,0,-0.1 do
  783.     OpenScriptEditorButton.Icon.ImageTransparency = i
  784.     CloseToggleButton.TextTransparency = i
  785.     wait()
  786. end
  787.  
  788. CloseToggleButton.Active = true
  789. CloseToggleButton.AutoButtonColor = true
  790.  
  791. OpenScriptEditorButton.Active = true
  792. OpenScriptEditorButton.AutoButtonColor = true
  793. end)
  794.  
  795. spawn(function()
  796.     -- initial states
  797. local Option = {
  798.     -- can modify object parents in the hierarchy
  799.     Modifiable = false;
  800.     -- can select objects
  801.     Selectable = true;
  802. }
  803.  
  804. -- MERELY
  805.  
  806. Option.Modifiable = true
  807.  
  808. -- END MERELY
  809.  
  810. -- general size of GUI objects, in pixels
  811. local GUI_SIZE = 16
  812. -- padding between items within each entry
  813. local ENTRY_PADDING = 1
  814. -- padding between each entry
  815. local ENTRY_MARGIN = 1
  816.  
  817. local Input = game:GetService("UserInputService")
  818. local HoldingCtrl = false
  819. local HoldingShift = false
  820.  
  821. --[[
  822.  
  823. # Explorer Panel
  824.  
  825. A GUI panel that displays the game hierarchy.
  826.  
  827.  
  828. ## Selection Bindables
  829.  
  830. - `Function GetSelection ( )`
  831.  
  832.     Returns an array of objects representing the objects currently
  833.     selected in the panel.
  834.  
  835. - `Function SetSelection ( Objects selection )`
  836.  
  837.     Sets the objects that are selected in the panel. `selection` is an array
  838.     of objects.
  839.  
  840. - `Event SelectionChanged ( )`
  841.  
  842.     Fired after the selection changes.
  843.  
  844.  
  845. ## Option Bindables
  846.  
  847. - `Function GetOption ( string optionName )`
  848.  
  849.     If `optionName` is given, returns the value of that option. Otherwise,
  850.     returns a table of options and their current values.
  851.  
  852. - `Function SetOption ( string optionName, bool value )`
  853.  
  854.     Sets `optionName` to `value`.
  855.  
  856.     Options:
  857.  
  858.     - Modifiable
  859.  
  860.         Whether objects can be modified by the panel.
  861.  
  862.         Note that modifying objects depends on being able to select them. If
  863.         Selectable is false, then Actions will not be available. Reparenting
  864.         is still possible, but only for the dragged object.
  865.  
  866.     - Selectable
  867.  
  868.         Whether objects can be selected.
  869.  
  870.         If Modifiable is false, then left-clicking will perform a drag
  871.         selection.
  872.  
  873. ## Updates
  874.  
  875. - 2013-09-18
  876.     - Fixed explorer icons to match studio explorer.
  877.  
  878. - 2013-09-14
  879.     - Added GetOption and SetOption bindables.
  880.         - Option: Modifiable; sets whether objects can be modified by the panel.
  881.         - Option: Selectable; sets whether objects can be selected.
  882.     - Slight modification to left-click selection behavior.
  883.     - Improved layout and scaling.
  884.  
  885. - 2013-09-13
  886.     - Added drag to reparent objects.
  887.         - Left-click to select/deselect object.
  888.         - Left-click and drag unselected object to reparent single object.
  889.         - Left-click and drag selected object to move reparent entire selection.
  890.         - Right-click while dragging to cancel.
  891.  
  892. - 2013-09-11
  893.     - Added explorer panel header with actions.
  894.         - Added Cut action.
  895.         - Added Copy action.
  896.         - Added Paste action.
  897.         - Added Delete action.
  898.     - Added drag selection.
  899.         - Left-click: Add to selection on drag.
  900.         - Right-click: Add to or remove from selection on drag.
  901.     - Ensured SelectionChanged fires only when the selection actually changes.
  902.     - Added documentation and change log.
  903.     - Fixed thread issue.
  904.  
  905. - 2013-09-09
  906.     - Added basic multi-selection.
  907.         - Left-click to set selection.
  908.         - Right-click to add to or remove from selection.
  909.     - Removed "Selection" ObjectValue.
  910.         - Added GetSelection BindableFunction.
  911.         - Added SetSelection BindableFunction.
  912.         - Added SelectionChanged BindableEvent.
  913.     - Changed font to SourceSans.
  914.  
  915. - 2013-08-31
  916.     - Improved GUI sizing based off of `GUI_SIZE` constant.
  917.     - Automatic font size detection.
  918.  
  919. - 2013-08-27
  920.     - Initial explorer panel.
  921.  
  922.  
  923. ## Todo
  924.  
  925. - Sorting
  926.     - by ExplorerOrder
  927.     - by children
  928.     - by name
  929. - Drag objects to reparent
  930.  
  931. ]]
  932.  
  933. local ENTRY_SIZE = GUI_SIZE + ENTRY_PADDING*2
  934. local ENTRY_BOUND = ENTRY_SIZE + ENTRY_MARGIN
  935. local HEADER_SIZE = ENTRY_SIZE*2
  936.  
  937. local FONT = 'SourceSans'
  938. local FONT_SIZE do
  939.     local size = {8,9,10,11,12,14,18,24,36,48}
  940.     local s
  941.     local n = math.huge
  942.     for i = 1,#size do
  943.         if size[i] <= GUI_SIZE then
  944.             FONT_SIZE = i - 1
  945.         end
  946.     end
  947. end
  948.  
  949. local GuiColor = {
  950.     Background      = Color3.new(233/255, 233/255, 233/255);
  951.     Border          = Color3.new(149/255, 149/255, 149/255);
  952.     Selected        = Color3.new( 96/255, 140/255, 211/255);
  953.     BorderSelected  = Color3.new( 86/255, 125/255, 188/255);
  954.     Text            = Color3.new(  0/255,   0/255,   0/255);
  955.     TextDisabled    = Color3.new(128/255, 128/255, 128/255);
  956.     TextSelected    = Color3.new(255/255, 255/255, 255/255);
  957.     Button          = Color3.new(221/255, 221/255, 221/255);
  958.     ButtonBorder    = Color3.new(149/255, 149/255, 149/255);
  959.     ButtonSelected  = Color3.new(255/255,   0/255,   0/255);
  960.     Field           = Color3.new(255/255, 255/255, 255/255);
  961.     FieldBorder     = Color3.new(191/255, 191/255, 191/255);
  962.     TitleBackground = Color3.new(178/255, 178/255, 178/255);
  963. }
  964.  
  965. ----------------------------------------------------------------
  966. ----------------------------------------------------------------
  967. ----------------------------------------------------------------
  968. ----------------------------------------------------------------
  969. ---- Icon map constants
  970.  
  971. local MAP_ID = 483448923
  972.  
  973. -- Indices based on implementation of Icon function.
  974. local ACTION_CUT             = 160
  975. local ACTION_COPY            = 161
  976. local ACTION_PASTE           = 162
  977. local ACTION_DELETE          = 163
  978. local ACTION_SORT            = 164
  979. local ACTION_CUT_OVER        = 174
  980. local ACTION_COPY_OVER       = 175
  981. local ACTION_PASTE_OVER      = 176
  982. local ACTION_DELETE_OVER     = 177
  983. local ACTION_SORT_OVER       = 178
  984. local ACTION_EDITQUICKACCESS = 190
  985. local ACTION_FREEZE          = 188
  986. local ACTION_STARRED         = 189
  987. local ACTION_ADDSTAR         = 184
  988. local ACTION_ADDSTAR_OVER    = 187
  989.  
  990. local NODE_COLLAPSED      = 165
  991. local NODE_EXPANDED       = 166
  992. local NODE_COLLAPSED_OVER = 179
  993. local NODE_EXPANDED_OVER  = 180
  994.  
  995. local ExplorerIndex = {
  996.     ["Accessory"] = 32;
  997.     ["Accoutrement"] = 32;
  998.     ["AdService"] = 73;
  999.     ["Animation"] = 60;
  1000.     ["AnimationController"] = 60;
  1001.     ["AnimationTrack"] = 60;
  1002.     ["Animator"] = 60;
  1003.     ["ArcHandles"] = 56;
  1004.     ["AssetService"] = 72;
  1005.     ["Attachment"] = 34;
  1006.     ["Backpack"] = 20;
  1007.     ["BadgeService"] = 75;
  1008.     ["BallSocketConstraint"] = 89;
  1009.     ["BillboardGui"] = 64;
  1010.     ["BinaryStringValue"] = 4;
  1011.     ["BindableEvent"] = 67;
  1012.     ["BindableFunction"] = 66;
  1013.     ["BlockMesh"] = 8;
  1014.     ["BloomEffect"] = 90;
  1015.     ["BlurEffect"] = 90;
  1016.     ["BodyAngularVelocity"] = 14;
  1017.     ["BodyForce"] = 14;
  1018.     ["BodyGyro"] = 14;
  1019.     ["BodyPosition"] = 14;
  1020.     ["BodyThrust"] = 14;
  1021.     ["BodyVelocity"] = 14;
  1022.     ["BoolValue"] = 4;
  1023.     ["BoxHandleAdornment"] = 54;
  1024.     ["BrickColorValue"] = 4;
  1025.     ["Camera"] = 5;
  1026.     ["CFrameValue"] = 4;
  1027.     ["CharacterMesh"] = 60;
  1028.     ["Chat"] = 33;
  1029.     ["ClickDetector"] = 41;
  1030.     ["CollectionService"] = 30;
  1031.     ["Color3Value"] = 4;
  1032.     ["ColorCorrectionEffect"] = 90;
  1033.     ["ConeHandleAdornment"] = 54;
  1034.     ["Configuration"] = 58;
  1035.     ["ContentProvider"] = 72;
  1036.     ["ContextActionService"] = 41;
  1037.     ["CoreGui"] = 46;
  1038.     ["CoreScript"] = 18;
  1039.     ["CornerWedgePart"] = 1;
  1040.     ["CustomEvent"] = 4;
  1041.     ["CustomEventReceiver"] = 4;
  1042.     ["CylinderHandleAdornment"] = 54;
  1043.     ["CylinderMesh"] = 8;
  1044.     ["CylindricalConstraint"] = 89;
  1045.     ["Debris"] = 30;
  1046.     ["Decal"] = 7;
  1047.     ["Dialog"] = 62;
  1048.     ["DialogChoice"] = 63;
  1049.     ["DoubleConstrainedValue"] = 4;
  1050.     ["Explosion"] = 36;
  1051.     ["FileMesh"] = 8;
  1052.     ["Fire"] = 61;
  1053.     ["Flag"] = 38;
  1054.     ["FlagStand"] = 39;
  1055.     ["FloorWire"] = 4;
  1056.     ["Folder"] = 70;
  1057.     ["ForceField"] = 37;
  1058.     ["Frame"] = 48;
  1059.     ["GamePassService"] = 19;
  1060.     ["Glue"] = 34;
  1061.     ["GuiButton"] = 52;
  1062.     ["GuiMain"] = 47;
  1063.     ["GuiService"] = 47;
  1064.     ["Handles"] = 53;
  1065.     ["HapticService"] = 84;
  1066.     ["Hat"] = 45;
  1067.     ["HingeConstraint"] = 89;
  1068.     ["Hint"] = 33;
  1069.     ["HopperBin"] = 22;
  1070.     ["HttpService"] = 76;
  1071.     ["Humanoid"] = 9;
  1072.     ["ImageButton"] = 52;
  1073.     ["ImageLabel"] = 49;
  1074.     ["InsertService"] = 72;
  1075.     ["IntConstrainedValue"] = 4;
  1076.     ["IntValue"] = 4;
  1077.     ["JointInstance"] = 34;
  1078.     ["JointsService"] = 34;
  1079.     ["Keyframe"] = 60;
  1080.     ["KeyframeSequence"] = 60;
  1081.     ["KeyframeSequenceProvider"] = 60;
  1082.     ["Lighting"] = 13;
  1083.     ["LineHandleAdornment"] = 54;
  1084.     ["LocalScript"] = 18;
  1085.     ["LogService"] = 87;
  1086.     ["MarketplaceService"] = 46;
  1087.     ["Message"] = 33;
  1088.     ["Model"] = 2;
  1089.     ["ModuleScript"] = 71;
  1090.     ["Motor"] = 34;
  1091.     ["Motor6D"] = 34;
  1092.     ["MoveToConstraint"] = 89;
  1093.     ["NegateOperation"] = 78;
  1094.     ["NetworkClient"] = 16;
  1095.     ["NetworkReplicator"] = 29;
  1096.     ["NetworkServer"] = 15;
  1097.     ["NumberValue"] = 4;
  1098.     ["ObjectValue"] = 4;
  1099.     ["Pants"] = 44;
  1100.     ["ParallelRampPart"] = 1;
  1101.     ["Part"] = 1;
  1102.     ["ParticleEmitter"] = 69;
  1103.     ["PartPairLasso"] = 57;
  1104.     ["PathfindingService"] = 37;
  1105.     ["Platform"] = 35;
  1106.     ["Player"] = 12;
  1107.     ["PlayerGui"] = 46;
  1108.     ["Players"] = 21;
  1109.     ["PlayerScripts"] = 82;
  1110.     ["PointLight"] = 13;
  1111.     ["PointsService"] = 83;
  1112.     ["Pose"] = 60;
  1113.     ["PrismaticConstraint"] = 89;
  1114.     ["PrismPart"] = 1;
  1115.     ["PyramidPart"] = 1;
  1116.     ["RayValue"] = 4;
  1117.     ["ReflectionMetadata"] = 86;
  1118.     ["ReflectionMetadataCallbacks"] = 86;
  1119.     ["ReflectionMetadataClass"] = 86;
  1120.     ["ReflectionMetadataClasses"] = 86;
  1121.     ["ReflectionMetadataEnum"] = 86;
  1122.     ["ReflectionMetadataEnumItem"] = 86;
  1123.     ["ReflectionMetadataEnums"] = 86;
  1124.     ["ReflectionMetadataEvents"] = 86;
  1125.     ["ReflectionMetadataFunctions"] = 86;
  1126.     ["ReflectionMetadataMember"] = 86;
  1127.     ["ReflectionMetadataProperties"] = 86;
  1128.     ["ReflectionMetadataYieldFunctions"] = 86;
  1129.     ["RemoteEvent"] = 80;
  1130.     ["RemoteFunction"] = 79;
  1131.     ["ReplicatedFirst"] = 72;
  1132.     ["ReplicatedStorage"] = 72;
  1133.     ["RightAngleRampPart"] = 1;
  1134.     ["RocketPropulsion"] = 14;
  1135.     ["RodConstraint"] = 89;
  1136.     ["RopeConstraint"] = 89;
  1137.     ["Rotate"] = 34;
  1138.     ["RotateP"] = 34;
  1139.     ["RotateV"] = 34;
  1140.     ["RunService"] = 66;
  1141.     ["ScreenGui"] = 47;
  1142.     ["Script"] = 6;
  1143.     ["ScrollingFrame"] = 48;
  1144.     ["Seat"] = 35;
  1145.     ["Selection"] = 55;
  1146.     ["SelectionBox"] = 54;
  1147.     ["SelectionPartLasso"] = 57;
  1148.     ["SelectionPointLasso"] = 57;
  1149.     ["SelectionSphere"] = 54;
  1150.     ["ServerScriptService"] = 0;
  1151.     ["ServerStorage"] = 74;
  1152.     ["Shirt"] = 43;
  1153.     ["ShirtGraphic"] = 40;
  1154.     ["SkateboardPlatform"] = 35;
  1155.     ["Sky"] = 28;
  1156.     ["SlidingBallConstraint"] = 89;
  1157.     ["Smoke"] = 59;
  1158.     ["Snap"] = 34;
  1159.     ["Sound"] = 11;
  1160.     ["SoundService"] = 31;
  1161.     ["Sparkles"] = 42;
  1162.     ["SpawnLocation"] = 25;
  1163.     ["SpecialMesh"] = 8;
  1164.     ["SphereHandleAdornment"] = 54;
  1165.     ["SpotLight"] = 13;
  1166.     ["SpringConstraint"] = 89;
  1167.     ["StarterCharacterScripts"] = 82;
  1168.     ["StarterGear"] = 20;
  1169.     ["StarterGui"] = 46;
  1170.     ["StarterPack"] = 20;
  1171.     ["StarterPlayer"] = 88;
  1172.     ["StarterPlayerScripts"] = 82;
  1173.     ["Status"] = 2;
  1174.     ["StringValue"] = 4;
  1175.     ["SunRaysEffect"] = 90;
  1176.     ["SurfaceGui"] = 64;
  1177.     ["SurfaceLight"] = 13;
  1178.     ["SurfaceSelection"] = 55;
  1179.     ["Team"] = 24;
  1180.     ["Teams"] = 23;
  1181.     ["TeleportService"] = 81;
  1182.     ["Terrain"] = 65;
  1183.     ["TerrainRegion"] = 65;
  1184.     ["TestService"] = 68;
  1185.     ["TextBox"] = 51;
  1186.     ["TextButton"] = 51;
  1187.     ["TextLabel"] = 50;
  1188.     ["Texture"] = 10;
  1189.     ["TextureTrail"] = 4;
  1190.     ["Tool"] = 17;
  1191.     ["TouchTransmitter"] = 37;
  1192.     ["TrussPart"] = 1;
  1193.     ["UnionOperation"] = 77;
  1194.     ["UserInputService"] = 84;
  1195.     ["Vector3Value"] = 4;
  1196.     ["VehicleSeat"] = 35;
  1197.     ["VelocityMotor"] = 34;
  1198.     ["WedgePart"] = 1;
  1199.     ["Weld"] = 34;
  1200.     ["Workspace"] = 19;
  1201. }
  1202.  
  1203. ----------------------------------------------------------------
  1204. ----------------------------------------------------------------
  1205. ----------------------------------------------------------------
  1206. ----------------------------------------------------------------
  1207. ----------------------------------------------------------------
  1208.  
  1209. function Create(ty,data)
  1210.     local obj
  1211.     if type(ty) == 'string' then
  1212.         obj = Instance.new(ty)
  1213.     else
  1214.         obj = ty
  1215.     end
  1216.     for k, v in pairs(data) do
  1217.         if type(k) == 'number' then
  1218.             v.Parent = obj
  1219.         else
  1220.             obj[k] = v
  1221.         end
  1222.     end
  1223.     return obj
  1224. end
  1225.  
  1226. local barActive = false
  1227. local activeOptions = {}
  1228.  
  1229. function createDDown(dBut, callback,...)
  1230.     if barActive then
  1231.         for i,v in pairs(activeOptions) do
  1232.             v:Destroy()
  1233.         end
  1234.         activeOptions = {}
  1235.         barActive = false
  1236.         return
  1237.     else
  1238.         barActive = true
  1239.     end
  1240.     local slots = {...}
  1241.     local base = dBut
  1242.     for i,v in pairs(slots) do
  1243.         local newOption = base:Clone()
  1244.         newOption.ZIndex = 5
  1245.         newOption.Name = "Option "..tostring(i)
  1246.         newOption.Parent = base.Parent.Parent.Parent
  1247.         newOption.BackgroundTransparency = 0
  1248.         newOption.ZIndex = 2
  1249.         table.insert(activeOptions,newOption)
  1250.         newOption.Position = UDim2.new(-0.4, dBut.Position.X.Offset, dBut.Position.Y.Scale, dBut.Position.Y.Offset + (#activeOptions * dBut.Size.Y.Offset))
  1251.         newOption.Text = slots[i]
  1252.         newOption.MouseButton1Down:connect(function()
  1253.             dBut.Text = slots[i]
  1254.             callback(slots[i])
  1255.             for i,v in pairs(activeOptions) do
  1256.                 v:Destroy()
  1257.             end
  1258.             activeOptions = {}
  1259.             barActive = false
  1260.         end)
  1261.     end
  1262. end
  1263.  
  1264. -- Connects a function to an event such that it fires asynchronously
  1265. function Connect(event,func)
  1266.     return event:connect(function(...)
  1267.         local a = {...}
  1268.         spawn(function() func(unpack(a)) end)
  1269.     end)
  1270. end
  1271.  
  1272. -- returns the ascendant ScreenGui of an object
  1273. function GetScreen(screen)
  1274.     if screen == nil then return nil end
  1275.     while not screen:IsA("ScreenGui") do
  1276.         screen = screen.Parent
  1277.         if screen == nil then return nil end
  1278.     end
  1279.     return screen
  1280. end
  1281.  
  1282. do
  1283.     local ZIndexLock = {}
  1284.     -- Sets the ZIndex of an object and its descendants. Objects are locked so
  1285.     -- that SetZIndexOnChanged doesn't spawn multiple threads that set the
  1286.     -- ZIndex of the same object.
  1287.     function SetZIndex(object,z)
  1288.         if not ZIndexLock[object] then
  1289.             ZIndexLock[object] = true
  1290.             if object:IsA'GuiObject' then
  1291.                 object.ZIndex = z
  1292.             end
  1293.             local children = object:GetChildren()
  1294.             for i = 1,#children do
  1295.                 SetZIndex(children[i],z)
  1296.             end
  1297.             ZIndexLock[object] = nil
  1298.         end
  1299.     end
  1300.  
  1301.     function SetZIndexOnChanged(object)
  1302.         return object.Changed:connect(function(p)
  1303.             if p == "ZIndex" then
  1304.                 SetZIndex(object,object.ZIndex)
  1305.             end
  1306.         end)
  1307.     end
  1308. end
  1309.  
  1310. ---- IconMap ----
  1311. -- Image size: 256px x 256px
  1312. -- Icon size: 16px x 16px
  1313. -- Padding between each icon: 2px
  1314. -- Padding around image edge: 1px
  1315. -- Total icons: 14 x 14 (196)
  1316. local Icon do
  1317.     local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID
  1318.     game:GetService('ContentProvider'):Preload(iconMap)
  1319.     local iconDehash do
  1320.         -- 14 x 14, 0-based input, 0-based output
  1321.         local f=math.floor
  1322.         function iconDehash(h)
  1323.             return f(h/14%14),f(h%14)
  1324.         end
  1325.     end
  1326.  
  1327.     function Icon(IconFrame,index)
  1328.         local row,col = iconDehash(index)
  1329.         local mapSize = Vector2.new(256,256)
  1330.         local pad,border = 2,1
  1331.         local iconSize = 16
  1332.  
  1333.         local class = 'Frame'
  1334.         if type(IconFrame) == 'string' then
  1335.             class = IconFrame
  1336.             IconFrame = nil
  1337.         end
  1338.  
  1339.         if not IconFrame then
  1340.             IconFrame = Create(class,{
  1341.                 Name = "Icon";
  1342.                 BackgroundTransparency = 1;
  1343.                 ClipsDescendants = true;
  1344.                 Create('ImageLabel',{
  1345.                     Name = "IconMap";
  1346.                     Active = false;
  1347.                     BackgroundTransparency = 1;
  1348.                     Image = iconMap;
  1349.                     Size = UDim2.new(mapSize.x/iconSize,0,mapSize.y/iconSize,0);
  1350.                 });
  1351.             })
  1352.         end
  1353.  
  1354.         IconFrame.IconMap.Position = UDim2.new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0)
  1355.         return IconFrame
  1356.     end
  1357. end
  1358.  
  1359. ----------------------------------------------------------------
  1360. ----------------------------------------------------------------
  1361. ----------------------------------------------------------------
  1362. ----------------------------------------------------------------
  1363. ---- ScrollBar
  1364. do
  1365.     -- AutoButtonColor doesn't always reset properly
  1366.     local function ResetButtonColor(button)
  1367.         local active = button.Active
  1368.         button.Active = not active
  1369.         button.Active = active
  1370.     end
  1371.  
  1372.     local function ArrowGraphic(size,dir,scaled,template)
  1373.         local Frame = Create('Frame',{
  1374.             Name = "Arrow Graphic";
  1375.             BorderSizePixel = 0;
  1376.             Size = UDim2.new(0,size,0,size);
  1377.             Transparency = 1;
  1378.         })
  1379.         if not template then
  1380.             template = Instance.new("Frame")
  1381.             template.BorderSizePixel = 0
  1382.         end
  1383.  
  1384.         local transform
  1385.         if dir == nil or dir == 'Up' then
  1386.             function transform(p,s) return p,s end
  1387.         elseif dir == 'Down' then
  1388.             function transform(p,s) return UDim2.new(0,p.X.Offset,0,size-p.Y.Offset-1),s end
  1389.         elseif dir == 'Left' then
  1390.             function transform(p,s) return UDim2.new(0,p.Y.Offset,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
  1391.         elseif dir == 'Right' then
  1392.             function transform(p,s) return UDim2.new(0,size-p.Y.Offset-1,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
  1393.         end
  1394.  
  1395.         local scale
  1396.         if scaled then
  1397.             function scale(p,s) return UDim2.new(p.X.Offset/size,0,p.Y.Offset/size,0),UDim2.new(s.X.Offset/size,0,s.Y.Offset/size,0) end
  1398.         else
  1399.             function scale(p,s) return p,s end
  1400.         end
  1401.  
  1402.         local o = math.floor(size/4)
  1403.         if size%2 == 0 then
  1404.             local n = size/2-1
  1405.             for i = 0,n do
  1406.                 local t = template:Clone()
  1407.                 local p,s = scale(transform(
  1408.                     UDim2.new(0,n-i,0,o+i),
  1409.                     UDim2.new(0,(i+1)*2,0,1)
  1410.                 ))
  1411.                 t.Position = p
  1412.                 t.Size = s
  1413.                 t.Parent = Frame
  1414.             end
  1415.         else
  1416.             local n = (size-1)/2
  1417.             for i = 0,n do
  1418.                 local t = template:Clone()
  1419.                 local p,s = scale(transform(
  1420.                     UDim2.new(0,n-i,0,o+i),
  1421.                     UDim2.new(0,i*2+1,0,1)
  1422.                 ))
  1423.                 t.Position = p
  1424.                 t.Size = s
  1425.                 t.Parent = Frame
  1426.             end
  1427.         end
  1428.         if size%4 > 1 then
  1429.             local t = template:Clone()
  1430.             local p,s = scale(transform(
  1431.                 UDim2.new(0,0,0,size-o-1),
  1432.                 UDim2.new(0,size,0,1)
  1433.             ))
  1434.             t.Position = p
  1435.             t.Size = s
  1436.             t.Parent = Frame
  1437.         end
  1438.         return Frame
  1439.     end
  1440.  
  1441.  
  1442.     local function GripGraphic(size,dir,spacing,scaled,template)
  1443.         local Frame = Create('Frame',{
  1444.             Name = "Grip Graphic";
  1445.             BorderSizePixel = 0;
  1446.             Size = UDim2.new(0,size.x,0,size.y);
  1447.             Transparency = 1;
  1448.         })
  1449.         if not template then
  1450.             template = Instance.new("Frame")
  1451.             template.BorderSizePixel = 0
  1452.         end
  1453.  
  1454.         spacing = spacing or 2
  1455.  
  1456.         local scale
  1457.         if scaled then
  1458.             function scale(p) return UDim2.new(p.X.Offset/size.x,0,p.Y.Offset/size.y,0) end
  1459.         else
  1460.             function scale(p) return p end
  1461.         end
  1462.  
  1463.         if dir == 'Vertical' then
  1464.             for i=0,size.x-1,spacing do
  1465.                 local t = template:Clone()
  1466.                 t.Size = scale(UDim2.new(0,1,0,size.y))
  1467.                 t.Position = scale(UDim2.new(0,i,0,0))
  1468.                 t.Parent = Frame
  1469.             end
  1470.         elseif dir == nil or dir == 'Horizontal' then
  1471.             for i=0,size.y-1,spacing do
  1472.                 local t = template:Clone()
  1473.                 t.Size = scale(UDim2.new(0,size.x,0,1))
  1474.                 t.Position = scale(UDim2.new(0,0,0,i))
  1475.                 t.Parent = Frame
  1476.             end
  1477.         end
  1478.  
  1479.         return Frame
  1480.     end
  1481.  
  1482.     local mt = {
  1483.         __index = {
  1484.             GetScrollPercent = function(self)
  1485.                 return self.ScrollIndex/(self.TotalSpace-self.VisibleSpace)
  1486.             end;
  1487.             CanScrollDown = function(self)
  1488.                 return self.ScrollIndex + self.VisibleSpace < self.TotalSpace
  1489.             end;
  1490.             CanScrollUp = function(self)
  1491.                 return self.ScrollIndex > 0
  1492.             end;
  1493.             ScrollDown = function(self)
  1494.                 self.ScrollIndex = self.ScrollIndex + self.PageIncrement
  1495.                 self:Update()
  1496.             end;
  1497.             ScrollUp = function(self)
  1498.                 self.ScrollIndex = self.ScrollIndex - self.PageIncrement
  1499.                 self:Update()
  1500.             end;
  1501.             ScrollTo = function(self,index)
  1502.                 self.ScrollIndex = index
  1503.                 self:Update()
  1504.             end;
  1505.             SetScrollPercent = function(self,percent)
  1506.                 self.ScrollIndex = math.floor((self.TotalSpace - self.VisibleSpace)*percent + 0.5)
  1507.                 self:Update()
  1508.             end;
  1509.         };
  1510.     }
  1511.     mt.__index.CanScrollRight = mt.__index.CanScrollDown
  1512.     mt.__index.CanScrollLeft = mt.__index.CanScrollUp
  1513.     mt.__index.ScrollLeft = mt.__index.ScrollUp
  1514.     mt.__index.ScrollRight = mt.__index.ScrollDown
  1515.  
  1516.     function ScrollBar(horizontal)
  1517.         -- create row scroll bar
  1518.         local ScrollFrame = Create('Frame',{
  1519.             Name = "ScrollFrame";
  1520.             Position = horizontal and UDim2.new(0,0,1,-GUI_SIZE) or UDim2.new(1,-GUI_SIZE,0,0);
  1521.             Size = horizontal and UDim2.new(1,0,0,GUI_SIZE) or UDim2.new(0,GUI_SIZE,1,0);
  1522.             BackgroundTransparency = 1;
  1523.             Create('ImageButton',{
  1524.                 Name = "ScrollDown";
  1525.                 Position = horizontal and UDim2.new(1,-GUI_SIZE,0,0) or UDim2.new(0,0,1,-GUI_SIZE);
  1526.                 Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
  1527.                 BackgroundColor3 = GuiColor.Button;
  1528.                 BorderColor3 = GuiColor.Border;
  1529.                 --BorderSizePixel = 0;
  1530.             });
  1531.             Create('ImageButton',{
  1532.                 Name = "ScrollUp";
  1533.                 Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
  1534.                 BackgroundColor3 = GuiColor.Button;
  1535.                 BorderColor3 = GuiColor.Border;
  1536.                 --BorderSizePixel = 0;
  1537.             });
  1538.             Create('ImageButton',{
  1539.                 Name = "ScrollBar";
  1540.                 Size = horizontal and UDim2.new(1,-GUI_SIZE*2,1,0) or UDim2.new(1,0,1,-GUI_SIZE*2);
  1541.                 Position = horizontal and UDim2.new(0,GUI_SIZE,0,0) or UDim2.new(0,0,0,GUI_SIZE);
  1542.                 AutoButtonColor = false;
  1543.                 BackgroundColor3 = Color3.new(0.94902, 0.94902, 0.94902);
  1544.                 BorderColor3 = GuiColor.Border;
  1545.                 --BorderSizePixel = 0;
  1546.                 Create('ImageButton',{
  1547.                     Name = "ScrollThumb";
  1548.                     AutoButtonColor = false;
  1549.                     Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
  1550.                     BackgroundColor3 = GuiColor.Button;
  1551.                     BorderColor3 = GuiColor.Border;
  1552.                     --BorderSizePixel = 0;
  1553.                 });
  1554.             });
  1555.         })
  1556.  
  1557.         local graphicTemplate = Create('Frame',{
  1558.             Name="Graphic";
  1559.             BorderSizePixel = 0;
  1560.             BackgroundColor3 = GuiColor.Border;
  1561.         })
  1562.         local graphicSize = GUI_SIZE/2
  1563.  
  1564.         local ScrollDownFrame = ScrollFrame.ScrollDown
  1565.             local ScrollDownGraphic = ArrowGraphic(graphicSize,horizontal and 'Right' or 'Down',true,graphicTemplate)
  1566.             ScrollDownGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
  1567.             ScrollDownGraphic.Parent = ScrollDownFrame
  1568.         local ScrollUpFrame = ScrollFrame.ScrollUp
  1569.             local ScrollUpGraphic = ArrowGraphic(graphicSize,horizontal and 'Left' or 'Up',true,graphicTemplate)
  1570.             ScrollUpGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
  1571.             ScrollUpGraphic.Parent = ScrollUpFrame
  1572.         local ScrollBarFrame = ScrollFrame.ScrollBar
  1573.         local ScrollThumbFrame = ScrollBarFrame.ScrollThumb
  1574.         do
  1575.             local size = GUI_SIZE*3/8
  1576.             local Decal = GripGraphic(Vector2.new(size,size),horizontal and 'Vertical' or 'Horizontal',2,graphicTemplate)
  1577.             Decal.Position = UDim2.new(0.5,-size/2,0.5,-size/2)
  1578.             Decal.Parent = ScrollThumbFrame
  1579.         end
  1580.  
  1581.         local Class = setmetatable({
  1582.             GUI = ScrollFrame;
  1583.             ScrollIndex = 0;
  1584.             VisibleSpace = 0;
  1585.             TotalSpace = 0;
  1586.             PageIncrement = 1;
  1587.         },mt)
  1588.  
  1589.         local UpdateScrollThumb
  1590.         if horizontal then
  1591.             function UpdateScrollThumb()
  1592.                 ScrollThumbFrame.Size = UDim2.new(Class.VisibleSpace/Class.TotalSpace,0,0,GUI_SIZE)
  1593.                 if ScrollThumbFrame.AbsoluteSize.x < GUI_SIZE then
  1594.                     ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
  1595.                 end
  1596.                 local barSize = ScrollBarFrame.AbsoluteSize.x
  1597.                 ScrollThumbFrame.Position = UDim2.new(Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.x)/barSize,0,0,0)
  1598.             end
  1599.         else
  1600.             function UpdateScrollThumb()
  1601.                 ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,Class.VisibleSpace/Class.TotalSpace,0)
  1602.                 if ScrollThumbFrame.AbsoluteSize.y < GUI_SIZE then
  1603.                     ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
  1604.                 end
  1605.                 local barSize = ScrollBarFrame.AbsoluteSize.y
  1606.                 ScrollThumbFrame.Position = UDim2.new(0,0,Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.y)/barSize,0)
  1607.             end
  1608.         end
  1609.  
  1610.         local lastDown
  1611.         local lastUp
  1612.         local scrollStyle = {BackgroundColor3=GuiColor.Border,BackgroundTransparency=0}
  1613.         local scrollStyle_ds = {BackgroundColor3=GuiColor.Border,BackgroundTransparency=0.7}
  1614.  
  1615.         local function Update()
  1616.             local t = Class.TotalSpace
  1617.             local v = Class.VisibleSpace
  1618.             local s = Class.ScrollIndex
  1619.             if v <= t then
  1620.                 if s > 0 then
  1621.                     if s + v > t then
  1622.                         Class.ScrollIndex = t - v
  1623.                     end
  1624.                 else
  1625.                     Class.ScrollIndex = 0
  1626.                 end
  1627.             else
  1628.                 Class.ScrollIndex = 0
  1629.             end
  1630.  
  1631.             if Class.UpdateCallback then
  1632.                 if Class.UpdateCallback(Class) == false then
  1633.                     return
  1634.                 end
  1635.             end
  1636.  
  1637.             local down = Class:CanScrollDown()
  1638.             local up = Class:CanScrollUp()
  1639.             if down ~= lastDown then
  1640.                 lastDown = down
  1641.                 ScrollDownFrame.Active = down
  1642.                 ScrollDownFrame.AutoButtonColor = down
  1643.                 local children = ScrollDownGraphic:GetChildren()
  1644.                 local style = down and scrollStyle or scrollStyle_ds
  1645.                 for i = 1,#children do
  1646.                     Create(children[i],style)
  1647.                 end
  1648.             end
  1649.             if up ~= lastUp then
  1650.                 lastUp = up
  1651.                 ScrollUpFrame.Active = up
  1652.                 ScrollUpFrame.AutoButtonColor = up
  1653.                 local children = ScrollUpGraphic:GetChildren()
  1654.                 local style = up and scrollStyle or scrollStyle_ds
  1655.                 for i = 1,#children do
  1656.                     Create(children[i],style)
  1657.                 end
  1658.             end
  1659.             ScrollThumbFrame.Visible = down or up
  1660.             UpdateScrollThumb()
  1661.         end
  1662.         Class.Update = Update
  1663.  
  1664.         SetZIndexOnChanged(ScrollFrame)
  1665.  
  1666.         local MouseDrag = Create('ImageButton',{
  1667.             Name = "MouseDrag";
  1668.             Position = UDim2.new(-0.25,0,-0.25,0);
  1669.             Size = UDim2.new(1.5,0,1.5,0);
  1670.             Transparency = 1;
  1671.             AutoButtonColor = false;
  1672.             Active = true;
  1673.             ZIndex = 10;
  1674.         })
  1675.  
  1676.         local scrollEventID = 0
  1677.         ScrollDownFrame.MouseButton1Down:connect(function()
  1678.             scrollEventID = tick()
  1679.             local current = scrollEventID
  1680.             local up_con
  1681.             up_con = MouseDrag.MouseButton1Up:connect(function()
  1682.                 scrollEventID = tick()
  1683.                 MouseDrag.Parent = nil
  1684.                 ResetButtonColor(ScrollDownFrame)
  1685.                 up_con:disconnect(); drag = nil
  1686.             end)
  1687.             MouseDrag.Parent = GetScreen(ScrollFrame)
  1688.             Class:ScrollDown()
  1689.             wait(0.2) -- delay before auto scroll
  1690.             while scrollEventID == current do
  1691.                 Class:ScrollDown()
  1692.                 if not Class:CanScrollDown() then break end
  1693.                 wait()
  1694.             end
  1695.         end)
  1696.  
  1697.         ScrollDownFrame.MouseButton1Up:connect(function()
  1698.             scrollEventID = tick()
  1699.         end)
  1700.  
  1701.         ScrollUpFrame.MouseButton1Down:connect(function()
  1702.             scrollEventID = tick()
  1703.             local current = scrollEventID
  1704.             local up_con
  1705.             up_con = MouseDrag.MouseButton1Up:connect(function()
  1706.                 scrollEventID = tick()
  1707.                 MouseDrag.Parent = nil
  1708.                 ResetButtonColor(ScrollUpFrame)
  1709.                 up_con:disconnect(); drag = nil
  1710.             end)
  1711.             MouseDrag.Parent = GetScreen(ScrollFrame)
  1712.             Class:ScrollUp()
  1713.             wait(0.2)
  1714.             while scrollEventID == current do
  1715.                 Class:ScrollUp()
  1716.                 if not Class:CanScrollUp() then break end
  1717.                 wait()
  1718.             end
  1719.         end)
  1720.  
  1721.         ScrollUpFrame.MouseButton1Up:connect(function()
  1722.             scrollEventID = tick()
  1723.         end)
  1724.  
  1725.         if horizontal then
  1726.             ScrollBarFrame.MouseButton1Down:connect(function(x,y)
  1727.                 scrollEventID = tick()
  1728.                 local current = scrollEventID
  1729.                 local up_con
  1730.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  1731.                     scrollEventID = tick()
  1732.                     MouseDrag.Parent = nil
  1733.                     ResetButtonColor(ScrollUpFrame)
  1734.                     up_con:disconnect(); drag = nil
  1735.                 end)
  1736.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  1737.                 if x > ScrollThumbFrame.AbsolutePosition.x then
  1738.                     Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1739.                     wait(0.2)
  1740.                     while scrollEventID == current do
  1741.                         if x < ScrollThumbFrame.AbsolutePosition.x + ScrollThumbFrame.AbsoluteSize.x then break end
  1742.                         Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1743.                         wait()
  1744.                     end
  1745.                 else
  1746.                     Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1747.                     wait(0.2)
  1748.                     while scrollEventID == current do
  1749.                         if x > ScrollThumbFrame.AbsolutePosition.x then break end
  1750.                         Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1751.                         wait()
  1752.                     end
  1753.                 end
  1754.             end)
  1755.         else
  1756.             ScrollBarFrame.MouseButton1Down:connect(function(x,y)
  1757.                 scrollEventID = tick()
  1758.                 local current = scrollEventID
  1759.                 local up_con
  1760.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  1761.                     scrollEventID = tick()
  1762.                     MouseDrag.Parent = nil
  1763.                     ResetButtonColor(ScrollUpFrame)
  1764.                     up_con:disconnect(); drag = nil
  1765.                 end)
  1766.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  1767.                 if y > ScrollThumbFrame.AbsolutePosition.y then
  1768.                     Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1769.                     wait(0.2)
  1770.                     while scrollEventID == current do
  1771.                         if y < ScrollThumbFrame.AbsolutePosition.y + ScrollThumbFrame.AbsoluteSize.y then break end
  1772.                         Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1773.                         wait()
  1774.                     end
  1775.                 else
  1776.                     Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1777.                     wait(0.2)
  1778.                     while scrollEventID == current do
  1779.                         if y > ScrollThumbFrame.AbsolutePosition.y then break end
  1780.                         Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1781.                         wait()
  1782.                     end
  1783.                 end
  1784.             end)
  1785.         end
  1786.  
  1787.         if horizontal then
  1788.             ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
  1789.                 scrollEventID = tick()
  1790.                 local mouse_offset = x - ScrollThumbFrame.AbsolutePosition.x
  1791.                 local drag_con
  1792.                 local up_con
  1793.                 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
  1794.                     local bar_abs_pos = ScrollBarFrame.AbsolutePosition.x
  1795.                     local bar_drag = ScrollBarFrame.AbsoluteSize.x - ScrollThumbFrame.AbsoluteSize.x
  1796.                     local bar_abs_one = bar_abs_pos + bar_drag
  1797.                     x = x - mouse_offset
  1798.                     x = x < bar_abs_pos and bar_abs_pos or x > bar_abs_one and bar_abs_one or x
  1799.                     x = x - bar_abs_pos
  1800.                     Class:SetScrollPercent(x/(bar_drag))
  1801.                 end)
  1802.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  1803.                     scrollEventID = tick()
  1804.                     MouseDrag.Parent = nil
  1805.                     ResetButtonColor(ScrollThumbFrame)
  1806.                     drag_con:disconnect(); drag_con = nil
  1807.                     up_con:disconnect(); drag = nil
  1808.                 end)
  1809.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  1810.             end)
  1811.         else
  1812.             ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
  1813.                 scrollEventID = tick()
  1814.                 local mouse_offset = y - ScrollThumbFrame.AbsolutePosition.y
  1815.                 local drag_con
  1816.                 local up_con
  1817.                 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
  1818.                     local bar_abs_pos = ScrollBarFrame.AbsolutePosition.y
  1819.                     local bar_drag = ScrollBarFrame.AbsoluteSize.y - ScrollThumbFrame.AbsoluteSize.y
  1820.                     local bar_abs_one = bar_abs_pos + bar_drag
  1821.                     y = y - mouse_offset
  1822.                     y = y < bar_abs_pos and bar_abs_pos or y > bar_abs_one and bar_abs_one or y
  1823.                     y = y - bar_abs_pos
  1824.                     Class:SetScrollPercent(y/(bar_drag))
  1825.                 end)
  1826.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  1827.                     scrollEventID = tick()
  1828.                     MouseDrag.Parent = nil
  1829.                     ResetButtonColor(ScrollThumbFrame)
  1830.                     drag_con:disconnect(); drag_con = nil
  1831.                     up_con:disconnect(); drag = nil
  1832.                 end)
  1833.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  1834.             end)
  1835.         end
  1836.  
  1837.         function Class:Destroy()
  1838.             ScrollFrame:Destroy()
  1839.             MouseDrag:Destroy()
  1840.             for k in pairs(Class) do
  1841.                 Class[k] = nil
  1842.             end
  1843.             setmetatable(Class,nil)
  1844.         end
  1845.  
  1846.         Update()
  1847.  
  1848.         return Class
  1849.     end
  1850. end
  1851.  
  1852. ----------------------------------------------------------------
  1853. ----------------------------------------------------------------
  1854. ----------------------------------------------------------------
  1855. ----------------------------------------------------------------
  1856. ---- Explorer panel
  1857.  
  1858. local explorerPanel = D_E_X.ExplorerPanel
  1859. Create(explorerPanel,{
  1860.     BackgroundColor3 = GuiColor.Field;
  1861.     BorderColor3 = GuiColor.Border;
  1862.     Active = true;
  1863. })
  1864.  
  1865. local SettingsRemote = explorerPanel.Parent:WaitForChild("SettingsPanel"):WaitForChild("GetSetting")
  1866. local GetApiRemote = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("GetApi")
  1867. local GetAwaitRemote = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("GetAwaiting")
  1868. local bindSetAwaiting = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("SetAwaiting")
  1869.  
  1870. local SaveInstanceWindow = explorerPanel.Parent:WaitForChild("SaveInstance")
  1871. local ConfirmationWindow = explorerPanel.Parent:WaitForChild("Confirmation")
  1872. local CautionWindow = explorerPanel.Parent:WaitForChild("Caution")
  1873. local TableCautionWindow = explorerPanel.Parent:WaitForChild("TableCaution")
  1874.  
  1875. local RemoteWindow = explorerPanel.Parent:WaitForChild("CallRemote")
  1876.  
  1877. local ScriptEditor = explorerPanel.Parent:WaitForChild("ScriptEditor")
  1878. local ScriptEditorEvent = ScriptEditor:WaitForChild("OpenScript")
  1879.  
  1880. local CurrentSaveInstanceWindow
  1881. local CurrentRemoteWindow
  1882.  
  1883. local lastSelectedNode
  1884.  
  1885. local DexStorage
  1886. local DexStorageMain
  1887. local DexStorageEnabled
  1888.  
  1889. if saveinstance then DexStorageEnabled = true end
  1890.  
  1891. if DexStorageEnabled then
  1892.     DexStorage = Instance.new("Folder")
  1893.     DexStorage.Name = "Dex"
  1894.     DexStorageMain = Instance.new("Folder",DexStorage)
  1895.     DexStorageMain.Name = "DexStorage"
  1896. end
  1897.  
  1898. local NilStorage
  1899. local NilStorageMain
  1900. local NilStorageEnabled
  1901.  
  1902. if get_nil_instances and IfThisFunctionWasStableEnough then NilStorageEnabled = true end
  1903.  
  1904. if NilStorageEnabled then
  1905.     NilStorage = Instance.new("Folder")
  1906.     NilStorage.Name = "Dex Internal Storage"
  1907.     NilStorageMain = Instance.new("Folder",NilStorage)
  1908.     NilStorageMain.Name = "Nil Instances"
  1909. end
  1910.  
  1911. local listFrame = Create('Frame',{
  1912.     Name = "List";
  1913.     BackgroundTransparency = 1;
  1914.     ClipsDescendants = true;
  1915.     Position = UDim2.new(0,0,0,HEADER_SIZE);
  1916.     Size = UDim2.new(1,-GUI_SIZE,1,-HEADER_SIZE);
  1917.     Parent = explorerPanel;
  1918. })
  1919.  
  1920. local scrollBar = ScrollBar(false)
  1921. scrollBar.PageIncrement = 1
  1922. Create(scrollBar.GUI,{
  1923.     Position = UDim2.new(1,-GUI_SIZE,0,HEADER_SIZE);
  1924.     Size = UDim2.new(0,GUI_SIZE,1,-HEADER_SIZE);
  1925.     Parent = explorerPanel;
  1926. })
  1927.  
  1928. local scrollBarH = ScrollBar(true)
  1929. scrollBarH.PageIncrement = GUI_SIZE
  1930. Create(scrollBarH.GUI,{
  1931.     Position = UDim2.new(0,0,1,-GUI_SIZE);
  1932.     Size = UDim2.new(1,-GUI_SIZE,0,GUI_SIZE);
  1933.     Visible = false;
  1934.     Parent = explorerPanel;
  1935. })
  1936.  
  1937. local headerFrame = Create('Frame',{
  1938.     Name = "Header";
  1939.     BackgroundColor3 = GuiColor.Background;
  1940.     BorderColor3 = GuiColor.Border;
  1941.     Position = UDim2.new(0,0,0,0);
  1942.     Size = UDim2.new(1,0,0,HEADER_SIZE);
  1943.     Parent = explorerPanel;
  1944.     Create('TextLabel',{
  1945.         Text = "Explorer";
  1946.         BackgroundTransparency = 1;
  1947.         TextColor3 = GuiColor.Text;
  1948.         TextXAlignment = 'Left';
  1949.         Font = FONT;
  1950.         FontSize = FONT_SIZE;
  1951.         Position = UDim2.new(0,4,0,0);
  1952.         Size = UDim2.new(1,-4,0.5,0);
  1953.     });
  1954. })
  1955.  
  1956. local explorerFilter =  Create('TextBox',{
  1957.     Text = "Filter Workspace";
  1958.     BackgroundTransparency = 0.8;
  1959.     TextColor3 = GuiColor.Text;
  1960.     TextXAlignment = 'Left';
  1961.     Font = FONT;
  1962.     FontSize = FONT_SIZE;
  1963.     Position = UDim2.new(0,4,0.5,0);
  1964.     Size = UDim2.new(1,-8,0.5,-2);
  1965. });
  1966. explorerFilter.Parent = headerFrame
  1967.  
  1968. SetZIndexOnChanged(explorerPanel)
  1969.  
  1970. local function CreateColor3(r, g, b) return Color3.new(r/255,g/255,b/255) end
  1971.  
  1972. local Styles = {
  1973.     Font = Enum.Font.Arial;
  1974.     Margin = 5;
  1975.     Black = CreateColor3(0,0,0);
  1976.     White = CreateColor3(255,255,255);
  1977. }
  1978.  
  1979. local DropDown = {
  1980.     Font = Styles.Font;
  1981.     FontSize = Enum.FontSize.Size14;
  1982.     TextColor = CreateColor3(0,0,0);
  1983.     TextColorOver = Styles.White;
  1984.     TextXAlignment = Enum.TextXAlignment.Left;
  1985.     Height = 20;
  1986.     BackColor = Styles.White;
  1987.     BackColorOver = CreateColor3(86,125,188);
  1988.     BorderColor = CreateColor3(216,216,216);
  1989.     BorderSizePixel = 2;
  1990.     ArrowColor = CreateColor3(160,160,160);
  1991.     ArrowColorOver = Styles.Black;
  1992. }
  1993.  
  1994. local Row = {
  1995.     Font = Styles.Font;
  1996.     FontSize = Enum.FontSize.Size14;
  1997.     TextXAlignment = Enum.TextXAlignment.Left;
  1998.     TextColor = Styles.Black;
  1999.     TextColorOver = Styles.White;
  2000.     TextLockedColor = CreateColor3(120,120,120);
  2001.     Height = 24;
  2002.     BorderColor = CreateColor3(216,216,216);
  2003.     BackgroundColor = Styles.White;
  2004.     BackgroundColorAlternate = CreateColor3(246,246,246);
  2005.     BackgroundColorMouseover = CreateColor3(211,224,244);
  2006.     TitleMarginLeft = 15;
  2007. }
  2008.  
  2009. local currentRightClickMenu
  2010. local CurrentInsertObjectWindow
  2011. local CurrentFunctionCallerWindow
  2012.  
  2013. local RbxApi
  2014.  
  2015. function ClassCanCreate(IName)
  2016.     local success = pcall(function() Instance.new(IName) end)
  2017.     if not success then
  2018.         return false
  2019.     else
  2020.         return true
  2021.     end
  2022. end
  2023.  
  2024. function GetClasses()
  2025.     if RbxApi == nil then return {} end
  2026.     local classTable = {}
  2027.     for i,v in pairs(RbxApi.Classes) do
  2028.         if ClassCanCreate(v.Name) then
  2029.             table.insert(classTable,v.Name)
  2030.         end
  2031.     end
  2032.     return classTable
  2033. end
  2034.  
  2035. local function sortAlphabetic(t, property)
  2036.     table.sort(t,
  2037.         function(x,y) return x[property] < y[property]
  2038.     end)
  2039. end
  2040.  
  2041. local function FunctionIsHidden(functionData)
  2042.     local tags = functionData["tags"]
  2043.     for _,name in pairs(tags) do
  2044.         if name == "deprecated"
  2045.             or name == "hidden"
  2046.             or name == "writeonly" then
  2047.             return true
  2048.         end
  2049.     end
  2050.     return false
  2051. end
  2052.  
  2053. local function GetAllFunctions(className)
  2054.     local class = RbxApi.Classes[className]
  2055.     local functions = {}
  2056.    
  2057.     if not class then return functions end
  2058.    
  2059.     while class do
  2060.         if class.Name == "Instance" then break end
  2061.         for _,nextFunction in pairs(class.Functions) do
  2062.             if not FunctionIsHidden(nextFunction) then
  2063.                 table.insert(functions, nextFunction)
  2064.             end
  2065.         end
  2066.         class = RbxApi.Classes[class.Superclass]
  2067.     end
  2068.    
  2069.     sortAlphabetic(functions, "Name")
  2070.  
  2071.     return functions
  2072. end
  2073.  
  2074. function GetFunctions()
  2075.     if RbxApi == nil then return {} end
  2076.     local List = SelectionVar():Get()
  2077.    
  2078.     if #List == 0 then return end
  2079.    
  2080.     local MyObject = List[1]
  2081.    
  2082.     local functionTable = {}
  2083.     for i,v in pairs(GetAllFunctions(MyObject.ClassName)) do
  2084.         table.insert(functionTable,v)
  2085.     end
  2086.     return functionTable
  2087. end
  2088.  
  2089. function CreateInsertObjectMenu(choices, currentChoice, readOnly, onClick)
  2090.     local mouse = game.Players.LocalPlayer:GetMouse()
  2091.     local totalSize = explorerPanel.Parent.AbsoluteSize.y
  2092.     if #choices == 0 then return end
  2093.    
  2094.     table.sort(choices, function(a,b) return a < b end)
  2095.  
  2096.     local frame = Instance.new("Frame")
  2097.     frame.Name = "InsertObject"
  2098.     frame.Size = UDim2.new(0, 200, 1, 0)
  2099.     frame.BackgroundTransparency = 1
  2100.     frame.Active = true
  2101.    
  2102.     local menu = nil
  2103.     local arrow = nil
  2104.     local expanded = false
  2105.     local margin = DropDown.BorderSizePixel;
  2106.    
  2107.     --[[
  2108.     local button = Instance.new("TextButton")
  2109.     button.Font = Row.Font
  2110.     button.FontSize = Row.FontSize
  2111.     button.TextXAlignment = Row.TextXAlignment
  2112.     button.BackgroundTransparency = 1
  2113.     button.TextColor3 = Row.TextColor
  2114.     if readOnly then
  2115.         button.TextColor3 = Row.TextLockedColor
  2116.     end
  2117.     button.Text = currentChoice
  2118.     button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
  2119.     button.Position = UDim2.new(0, Styles.Margin, 0, 0)
  2120.     button.Parent = frame
  2121.     --]]
  2122.    
  2123.     local function hideMenu()
  2124.         expanded = false
  2125.         --showArrow(DropDown.ArrowColor)
  2126.         if frame then
  2127.             --frame:Destroy()
  2128.             CurrentInsertObjectWindow.Visible = false
  2129.         end
  2130.     end
  2131.    
  2132.     local function showMenu()
  2133.         expanded = true
  2134.         menu = Instance.new("ScrollingFrame")
  2135.         menu.Size = UDim2.new(0,200,1,0)
  2136.         menu.CanvasSize = UDim2.new(0, 200, 0, #choices * DropDown.Height)
  2137.         menu.Position = UDim2.new(0, margin, 0, 0)
  2138.         menu.BackgroundTransparency = 0
  2139.         menu.BackgroundColor3 = DropDown.BackColor
  2140.         menu.BorderColor3 = DropDown.BorderColor
  2141.         menu.BorderSizePixel = DropDown.BorderSizePixel
  2142.         menu.TopImage = "rbxasset://textures/blackBkg_square.png"
  2143.         menu.MidImage = "rbxasset://textures/blackBkg_square.png"
  2144.         menu.BottomImage = "rbxasset://textures/blackBkg_square.png"
  2145.         menu.Active = true
  2146.         menu.ZIndex = 5
  2147.         menu.Parent = frame
  2148.        
  2149.         --local parentFrameHeight = script.Parent.List.Size.Y.Offset
  2150.         --local rowHeight = mouse.Y
  2151.         --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
  2152.         --  menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
  2153.         --end
  2154.            
  2155.         local function choice(name)
  2156.             onClick(name)
  2157.             hideMenu()
  2158.         end
  2159.        
  2160.         for i,name in pairs(choices) do
  2161.             local option = CreateRightClickMenuItem(name, function()
  2162.                 choice(name)
  2163.             end,1)
  2164.             option.Size = UDim2.new(1, 0, 0, 20)
  2165.             option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
  2166.             option.ZIndex = menu.ZIndex
  2167.             option.Parent = menu
  2168.         end
  2169.     end
  2170.  
  2171.  
  2172.     showMenu()
  2173.  
  2174.    
  2175.     return frame
  2176. end
  2177.  
  2178. function CreateFunctionCallerMenu(choices, currentChoice, readOnly, onClick)
  2179.     local mouse = game.Players.LocalPlayer:GetMouse()
  2180.     local totalSize = explorerPanel.Parent.AbsoluteSize.y
  2181.     if #choices == 0 then return end
  2182.    
  2183.     table.sort(choices, function(a,b) return a.Name < b.Name end)
  2184.  
  2185.     local frame = Instance.new("Frame")
  2186.     frame.Name = "InsertObject"
  2187.     frame.Size = UDim2.new(0, 200, 1, 0)
  2188.     frame.BackgroundTransparency = 1
  2189.     frame.Active = true
  2190.    
  2191.     local menu = nil
  2192.     local arrow = nil
  2193.     local expanded = false
  2194.     local margin = DropDown.BorderSizePixel;
  2195.    
  2196.     local function hideMenu()
  2197.         expanded = false
  2198.         --showArrow(DropDown.ArrowColor)
  2199.         if frame then
  2200.             --frame:Destroy()
  2201.             CurrentInsertObjectWindow.Visible = false
  2202.         end
  2203.     end
  2204.    
  2205.     local function showMenu()
  2206.         expanded = true
  2207.         menu = Instance.new("ScrollingFrame")
  2208.         menu.Size = UDim2.new(0,300,1,0)
  2209.         menu.CanvasSize = UDim2.new(0, 300, 0, #choices * DropDown.Height)
  2210.         menu.Position = UDim2.new(0, margin, 0, 0)
  2211.         menu.BackgroundTransparency = 0
  2212.         menu.BackgroundColor3 = DropDown.BackColor
  2213.         menu.BorderColor3 = DropDown.BorderColor
  2214.         menu.BorderSizePixel = DropDown.BorderSizePixel
  2215.         menu.TopImage = "rbxasset://textures/blackBkg_square.png"
  2216.         menu.MidImage = "rbxasset://textures/blackBkg_square.png"
  2217.         menu.BottomImage = "rbxasset://textures/blackBkg_square.png"
  2218.         menu.Active = true
  2219.         menu.ZIndex = 5
  2220.         menu.Parent = frame
  2221.        
  2222.         --local parentFrameHeight = script.Parent.List.Size.Y.Offset
  2223.         --local rowHeight = mouse.Y
  2224.         --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
  2225.         --  menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
  2226.         --end
  2227.        
  2228.         local function GetParameters(functionData)
  2229.             local paraString = ""
  2230.             paraString = paraString.."("
  2231.             for i,v in pairs(functionData.Arguments) do
  2232.                 paraString = paraString..v.Type.." "..v.Name
  2233.                 if i < #functionData.Arguments then
  2234.                     paraString = paraString..", "
  2235.                 end
  2236.             end
  2237.             paraString = paraString..")"
  2238.             return paraString
  2239.         end
  2240.            
  2241.         local function choice(name)
  2242.             onClick(name)
  2243.             hideMenu()
  2244.         end
  2245.        
  2246.         for i,name in pairs(choices) do
  2247.             local option = CreateRightClickMenuItem(name.ReturnType.." "..name.Name..GetParameters(name), function()
  2248.                 choice(name)
  2249.             end,2)
  2250.             option.Size = UDim2.new(1, 0, 0, 20)
  2251.             option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
  2252.             option.ZIndex = menu.ZIndex
  2253.             option.Parent = menu
  2254.         end
  2255.     end
  2256.  
  2257.  
  2258.     showMenu()
  2259.  
  2260.    
  2261.     return frame
  2262. end
  2263.  
  2264. function CreateInsertObject()
  2265.     if not CurrentInsertObjectWindow then return end
  2266.     CurrentInsertObjectWindow.Visible = true
  2267.     if currentRightClickMenu and CurrentInsertObjectWindow.Visible then
  2268.         CurrentInsertObjectWindow.Position = UDim2.new(0,currentRightClickMenu.Position.X.Offset-currentRightClickMenu.Size.X.Offset-2,0,0)
  2269.     end
  2270.     if CurrentInsertObjectWindow.Visible then
  2271.         CurrentInsertObjectWindow.Parent = explorerPanel.Parent
  2272.     end
  2273. end
  2274.  
  2275. function CreateFunctionCaller()
  2276.     if CurrentFunctionCallerWindow then
  2277.         CurrentFunctionCallerWindow:Destroy()
  2278.         CurrentFunctionCallerWindow = nil
  2279.     end
  2280.     CurrentFunctionCallerWindow = CreateFunctionCallerMenu(
  2281.         GetFunctions(),
  2282.         "",
  2283.         false,
  2284.         function(option)
  2285.             CurrentFunctionCallerWindow:Destroy()
  2286.             CurrentFunctionCallerWindow = nil
  2287.             local list = SelectionVar():Get()
  2288.             for i = 1,#list do
  2289.                 pcall(function() Instance.new(option,list[i]) end)
  2290.             end
  2291.             print(option.Name .. " selected to be called. Function caller being added soon, please wait!")
  2292.             --CallFunction()
  2293.             DestroyRightClick()
  2294.         end
  2295.     )
  2296.     if currentRightClickMenu and CurrentFunctionCallerWindow then
  2297.         CurrentFunctionCallerWindow.Position = UDim2.new(0,currentRightClickMenu.Position.X.Offset-currentRightClickMenu.Size.X.Offset*1.5-2,0,0)
  2298.     end
  2299.     if CurrentFunctionCallerWindow then
  2300.         CurrentFunctionCallerWindow.Parent = explorerPanel.Parent
  2301.     end
  2302. end
  2303.  
  2304. function CreateRightClickMenuItem(text, onClick, insObj)
  2305.     local button = Instance.new("TextButton")
  2306.     button.Font = DropDown.Font
  2307.     button.FontSize = DropDown.FontSize
  2308.     button.TextColor3 = DropDown.TextColor
  2309.     button.TextXAlignment = DropDown.TextXAlignment
  2310.     button.BackgroundColor3 = DropDown.BackColor
  2311.     button.AutoButtonColor = false
  2312.     button.BorderSizePixel = 0
  2313.     button.Active = true
  2314.     button.Text = text
  2315.    
  2316.     if insObj == 1 then
  2317.         local newIcon = Icon(nil,ExplorerIndex[text] or 0)
  2318.         newIcon.Position = UDim2.new(0,0,0,2)
  2319.         newIcon.Size = UDim2.new(0,16,0,16)
  2320.         newIcon.IconMap.ZIndex = 5
  2321.         newIcon.Parent = button
  2322.         button.Text = "\t\t"..button.Text
  2323.     elseif insObj == 2 then
  2324.         button.FontSize = Enum.FontSize.Size11
  2325.     end
  2326.    
  2327.     button.MouseEnter:connect(function()
  2328.         button.TextColor3 = DropDown.TextColorOver
  2329.         button.BackgroundColor3 = DropDown.BackColorOver
  2330.         if not insObj and CurrentInsertObjectWindow then
  2331.             if CurrentInsertObjectWindow.Visible == false and button.Text == "Insert Object" then
  2332.                 CreateInsertObject()
  2333.             elseif CurrentInsertObjectWindow.Visible and button.Text ~= "Insert Object" then
  2334.                 CurrentInsertObjectWindow.Visible = false
  2335.             end
  2336.         end
  2337.         if not insObj then
  2338.             if CurrentFunctionCallerWindow and button.Text ~= "Call Function" then
  2339.                 CurrentFunctionCallerWindow:Destroy()
  2340.                 CurrentFunctionCallerWindow = nil
  2341.             elseif button.Text == "Call Function" then
  2342.                 CreateFunctionCaller()
  2343.             end
  2344.         end
  2345.     end)
  2346.     button.MouseLeave:connect(function()
  2347.         button.TextColor3 = DropDown.TextColor
  2348.         button.BackgroundColor3 = DropDown.BackColor
  2349.     end)
  2350.     button.MouseButton1Click:connect(function()
  2351.         button.TextColor3 = DropDown.TextColor
  2352.         button.BackgroundColor3 = DropDown.BackColor
  2353.         onClick(text)
  2354.     end)   
  2355.     return button
  2356. end
  2357.  
  2358. function CreateRightClickMenu(choices, currentChoice, readOnly, onClick)
  2359.     local mouse = game.Players.LocalPlayer:GetMouse()
  2360.  
  2361.     local frame = Instance.new("Frame")
  2362.     frame.Name = "DropDown"
  2363.     frame.Size = UDim2.new(0, 200, 1, 0)
  2364.     frame.BackgroundTransparency = 1
  2365.     frame.Active = true
  2366.    
  2367.     local menu = nil
  2368.     local arrow = nil
  2369.     local expanded = false
  2370.     local margin = DropDown.BorderSizePixel;
  2371.    
  2372.     --[[
  2373.     local button = Instance.new("TextButton")
  2374.     button.Font = Row.Font
  2375.     button.FontSize = Row.FontSize
  2376.     button.TextXAlignment = Row.TextXAlignment
  2377.     button.BackgroundTransparency = 1
  2378.     button.TextColor3 = Row.TextColor
  2379.     if readOnly then
  2380.         button.TextColor3 = Row.TextLockedColor
  2381.     end
  2382.     button.Text = currentChoice
  2383.     button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
  2384.     button.Position = UDim2.new(0, Styles.Margin, 0, 0)
  2385.     button.Parent = frame
  2386.     --]]
  2387.    
  2388.     local function hideMenu()
  2389.         expanded = false
  2390.         --showArrow(DropDown.ArrowColor)
  2391.         if frame then
  2392.             frame:Destroy()
  2393.             DestroyRightClick()
  2394.         end
  2395.     end
  2396.    
  2397.     local function showMenu()
  2398.         expanded = true
  2399.         menu = Instance.new("Frame")
  2400.         menu.Size = UDim2.new(0, 200, 0, #choices * DropDown.Height)
  2401.         menu.Position = UDim2.new(0, margin, 0, 5)
  2402.         menu.BackgroundTransparency = 0
  2403.         menu.BackgroundColor3 = DropDown.BackColor
  2404.         menu.BorderColor3 = DropDown.BorderColor
  2405.         menu.BorderSizePixel = DropDown.BorderSizePixel
  2406.         menu.Active = true
  2407.         menu.ZIndex = 5
  2408.         menu.Parent = frame
  2409.        
  2410.         --local parentFrameHeight = script.Parent.List.Size.Y.Offset
  2411.         --local rowHeight = mouse.Y
  2412.         --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
  2413.         --  menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
  2414.         --end
  2415.            
  2416.         local function choice(name)
  2417.             onClick(name)
  2418.             hideMenu()
  2419.         end
  2420.        
  2421.         for i,name in pairs(choices) do
  2422.             local option = CreateRightClickMenuItem(name, function()
  2423.                 choice(name)
  2424.             end)
  2425.             option.Size = UDim2.new(1, 0, 0, 20)
  2426.             option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
  2427.             option.ZIndex = menu.ZIndex
  2428.             option.Parent = menu
  2429.         end
  2430.     end
  2431.  
  2432.  
  2433.     showMenu()
  2434.  
  2435.    
  2436.     return frame
  2437. end
  2438.  
  2439. function checkMouseInGui(gui)
  2440.     if gui == nil then return false end
  2441.     local plrMouse = game.Players.LocalPlayer:GetMouse()
  2442.     local guiPosition = gui.AbsolutePosition
  2443.     local guiSize = gui.AbsoluteSize   
  2444.    
  2445.     if plrMouse.X >= guiPosition.x and plrMouse.X <= guiPosition.x + guiSize.x and plrMouse.Y >= guiPosition.y and plrMouse.Y <= guiPosition.y + guiSize.y then
  2446.         return true
  2447.     else
  2448.         return false
  2449.     end
  2450. end
  2451.  
  2452. local clipboard = {}
  2453. local function delete(o)
  2454.     o.Parent = nil
  2455. end
  2456.  
  2457. local getTextWidth do
  2458.     local text = Create('TextLabel',{
  2459.         Name = "TextWidth";
  2460.         TextXAlignment = 'Left';
  2461.         TextYAlignment = 'Center';
  2462.         Font = FONT;
  2463.         FontSize = FONT_SIZE;
  2464.         Text = "";
  2465.         Position = UDim2.new(0,0,0,0);
  2466.         Size = UDim2.new(1,0,1,0);
  2467.         Visible = false;
  2468.         Parent = explorerPanel;
  2469.     })
  2470.     function getTextWidth(s)
  2471.         text.Text = s
  2472.         return text.TextBounds.x
  2473.     end
  2474. end
  2475.  
  2476. local nameScanned = false
  2477. -- Holds the game tree converted to a list.
  2478. local TreeList = {}
  2479. -- Matches objects to their tree node representation.
  2480. local NodeLookup = {}
  2481.  
  2482. local nodeWidth = 0
  2483.  
  2484. local QuickButtons = {}
  2485.  
  2486. function filteringWorkspace()
  2487.     if explorerFilter.Text ~= "" and explorerFilter.Text ~= "Filter Workspace" then
  2488.         return true
  2489.     end
  2490.     return false
  2491. end
  2492.  
  2493. function lookForAName(obj,name)
  2494.     for i,v in pairs(obj:GetChildren()) do
  2495.         if string.find(string.lower(v.Name),string.lower(name)) then nameScanned = true end
  2496.         lookForAName(v,name)
  2497.     end
  2498. end
  2499.  
  2500. function scanName(obj)
  2501.     nameScanned = false
  2502.     if string.find(string.lower(obj.Name),string.lower(explorerFilter.Text)) then
  2503.         nameScanned = true
  2504.     else
  2505.         lookForAName(obj,explorerFilter.Text)
  2506.     end
  2507.     return nameScanned
  2508. end
  2509.  
  2510. function updateActions()
  2511.     for i,v in pairs(QuickButtons) do
  2512.         if v.Cond() then
  2513.             v.Toggle(true)
  2514.         else
  2515.             v.Toggle(false)
  2516.         end
  2517.     end
  2518. end
  2519.  
  2520. local updateList,rawUpdateList,updateScroll,rawUpdateSize do
  2521.     local function r(t)
  2522.         for i = 1,#t do
  2523.             if not filteringWorkspace() or scanName(t[i].Object) then
  2524.                 TreeList[#TreeList+1] = t[i]
  2525.  
  2526.                 local w = (t[i].Depth)*(2+ENTRY_PADDING+GUI_SIZE) + 2 + ENTRY_SIZE + 4 + getTextWidth(t[i].Object.Name) + 4
  2527.                 if w > nodeWidth then
  2528.                     nodeWidth = w
  2529.                 end
  2530.                 if t[i].Expanded or filteringWorkspace() then
  2531.                     r(t[i])
  2532.                 end
  2533.             end
  2534.         end
  2535.     end
  2536.  
  2537.     function rawUpdateSize()
  2538.         scrollBarH.TotalSpace = nodeWidth
  2539.         scrollBarH.VisibleSpace = listFrame.AbsoluteSize.x
  2540.         scrollBarH:Update()
  2541.         local visible = scrollBarH:CanScrollDown() or scrollBarH:CanScrollUp()
  2542.         scrollBarH.GUI.Visible = visible
  2543.  
  2544.         listFrame.Size = UDim2.new(1,-GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
  2545.  
  2546.         scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
  2547.         scrollBar.GUI.Size = UDim2.new(0,GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
  2548.        
  2549.         scrollBar.TotalSpace = #TreeList+1
  2550.         scrollBar:Update()
  2551.     end
  2552.  
  2553.     function rawUpdateList()
  2554.         -- Clear then repopulate the entire list. It appears to be fast enough.
  2555.         TreeList = {}
  2556.         nodeWidth = 0
  2557.         r(NodeLookup[workspace.Parent:GetDebugId(10)])
  2558.         if DexStorageEnabled then
  2559.             r(NodeLookup[DexStorage:GetDebugId(10)])
  2560.         end
  2561.         if NilStorageEnabled then
  2562.             r(NodeLookup[NilStorage:GetDebugId(10)])
  2563.         end
  2564.         rawUpdateSize()
  2565.         updateActions()
  2566.     end
  2567.  
  2568.     -- Adding or removing large models will cause many updates to occur. We
  2569.     -- can reduce the number of updates by creating a delay, then dropping any
  2570.     -- updates that occur during the delay.
  2571.     local updatingList = false
  2572.     function updateList()
  2573.         if updatingList then return end
  2574.         updatingList = true
  2575.         wait(0.25)
  2576.         updatingList = false
  2577.         rawUpdateList()
  2578.     end
  2579.  
  2580.     local updatingScroll = false
  2581.     function updateScroll()
  2582.         if updatingScroll then return end
  2583.         updatingScroll = true
  2584.         wait(0.25)
  2585.         updatingScroll = false
  2586.         scrollBar:Update()
  2587.     end
  2588. end
  2589.  
  2590. local Selection do
  2591.     local bindGetSelection = explorerPanel:FindFirstChild("GetSelection")
  2592.     if not bindGetSelection then
  2593.         bindGetSelection = Create('BindableFunction',{Name = "GetSelection"})
  2594.         bindGetSelection.Parent = explorerPanel
  2595.     end
  2596.  
  2597.     local bindSetSelection = explorerPanel:FindFirstChild("SetSelection")
  2598.     if not bindSetSelection then
  2599.         bindSetSelection = Create('BindableFunction',{Name = "SetSelection"})
  2600.         bindSetSelection.Parent = explorerPanel
  2601.     end
  2602.  
  2603.     local bindSelectionChanged = explorerPanel:FindFirstChild("SelectionChanged")
  2604.     if not bindSelectionChanged then
  2605.         bindSelectionChanged = Create('BindableEvent',{Name = "SelectionChanged"})
  2606.         bindSelectionChanged.Parent = explorerPanel
  2607.     end
  2608.  
  2609.     local SelectionList = {}
  2610.     local SelectionSet = {}
  2611.     local Updates = true
  2612.     Selection = {
  2613.         Selected = SelectionSet;
  2614.         List = SelectionList;
  2615.     }
  2616.  
  2617.     local function addObject(object)
  2618.         -- list update
  2619.         local lupdate = false
  2620.         -- scroll update
  2621.         local supdate = false
  2622.  
  2623.         if not SelectionSet[object] then
  2624.             local node = NodeLookup[object:GetDebugId(10)]
  2625.             if node then
  2626.                 table.insert(SelectionList,object)
  2627.                 SelectionSet[object] = true
  2628.                 node.Selected = true
  2629.  
  2630.                 -- expand all ancestors so that selected node becomes visible
  2631.                 node = node.Parent
  2632.                 while node do
  2633.                     if not node.Expanded then
  2634.                         node.Expanded = true
  2635.                         lupdate = true
  2636.                     end
  2637.                     node = node.Parent
  2638.                 end
  2639.                 supdate = true
  2640.             end
  2641.         end
  2642.         return lupdate,supdate
  2643.     end
  2644.  
  2645.     function Selection:Set(objects)
  2646.         local lupdate = false
  2647.         local supdate = false
  2648.  
  2649.         if #SelectionList > 0 then
  2650.             for i = 1,#SelectionList do
  2651.                 local object = SelectionList[i]
  2652.                 local node = NodeLookup[object:GetDebugId(10)]
  2653.                 if node then
  2654.                     node.Selected = false
  2655.                     SelectionSet[object] = nil
  2656.                 end
  2657.             end
  2658.  
  2659.             SelectionList = {}
  2660.             Selection.List = SelectionList
  2661.             supdate = true
  2662.         end
  2663.  
  2664.         for i = 1,#objects do
  2665.             local l,s = addObject(objects[i])
  2666.             lupdate = l or lupdate
  2667.             supdate = s or supdate
  2668.         end
  2669.  
  2670.         if lupdate then
  2671.             rawUpdateList()
  2672.             supdate = true
  2673.         elseif supdate then
  2674.             scrollBar:Update()
  2675.         end
  2676.  
  2677.         if supdate then
  2678.             bindSelectionChanged:Fire()
  2679.             updateActions()
  2680.         end
  2681.     end
  2682.  
  2683.     function Selection:Add(object)
  2684.         local l,s = addObject(object)
  2685.         if l then
  2686.             rawUpdateList()
  2687.             if Updates then
  2688.                 bindSelectionChanged:Fire()
  2689.                 updateActions()
  2690.             end
  2691.         elseif s then
  2692.             scrollBar:Update()
  2693.             if Updates then
  2694.                 bindSelectionChanged:Fire()
  2695.                 updateActions()
  2696.             end
  2697.         end
  2698.     end
  2699.    
  2700.     function Selection:StopUpdates()
  2701.         Updates = false
  2702.     end
  2703.    
  2704.     function Selection:ResumeUpdates()
  2705.         Updates = true
  2706.         bindSelectionChanged:Fire()
  2707.         updateActions()
  2708.     end
  2709.  
  2710.     function Selection:Remove(object,noupdate)
  2711.         if SelectionSet[object] then
  2712.             local node = NodeLookup[object:GetDebugId(10)]
  2713.             if node then
  2714.                 node.Selected = false
  2715.                 SelectionSet[object] = nil
  2716.                 for i = 1,#SelectionList do
  2717.                     if SelectionList[i] == object then
  2718.                         table.remove(SelectionList,i)
  2719.                         break
  2720.                     end
  2721.                 end
  2722.  
  2723.                 if not noupdate then
  2724.                     scrollBar:Update()
  2725.                 end
  2726.                 bindSelectionChanged:Fire()
  2727.                 updateActions()
  2728.             end
  2729.         end
  2730.     end
  2731.  
  2732.     function Selection:Get()
  2733.         local list = {}
  2734.         for i = 1,#SelectionList do
  2735.             list[i] = SelectionList[i]
  2736.         end
  2737.         return list
  2738.     end
  2739.  
  2740.     bindSetSelection.OnInvoke = function(...)
  2741.         Selection:Set(...)
  2742.     end
  2743.  
  2744.     bindGetSelection.OnInvoke = function()
  2745.         return Selection:Get()
  2746.     end
  2747. end
  2748.  
  2749. function CreateCaution(title,msg)
  2750.     local newCaution = CautionWindow:Clone()
  2751.     newCaution.Title.Text = title
  2752.     newCaution.MainWindow.Desc.Text = msg
  2753.     newCaution.Parent = explorerPanel.Parent
  2754.     newCaution.Visible = true
  2755.     newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
  2756.         newCaution:Destroy()
  2757.     end)
  2758. end
  2759.  
  2760. function CreateTableCaution(title,msg)
  2761.     if type(msg) ~= "table" then return CreateCaution(title,tostring(msg)) end
  2762.     local newCaution = TableCautionWindow:Clone()
  2763.     newCaution.Title.Text = title
  2764.    
  2765.     local TableList = newCaution.MainWindow.TableResults
  2766.     local TableTemplate = newCaution.MainWindow.TableTemplate
  2767.    
  2768.     for i,v in pairs(msg) do
  2769.         local newResult = TableTemplate:Clone()
  2770.         newResult.Type.Text = type(v)
  2771.         newResult.Value.Text = tostring(v)
  2772.         newResult.Position = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
  2773.         newResult.Parent = TableList
  2774.         TableList.CanvasSize = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
  2775.         newResult.Visible = true
  2776.     end
  2777.     newCaution.Parent = explorerPanel.Parent
  2778.     newCaution.Visible = true
  2779.     newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
  2780.         newCaution:Destroy()
  2781.     end)
  2782. end
  2783.  
  2784. local function Split(str, delimiter)
  2785.     local start = 1
  2786.     local t = {}
  2787.     while true do
  2788.         local pos = string.find (str, delimiter, start, true)
  2789.         if not pos then
  2790.             break
  2791.         end
  2792.         table.insert (t, string.sub (str, start, pos - 1))
  2793.         start = pos + string.len (delimiter)
  2794.     end
  2795.     table.insert (t, string.sub (str, start))
  2796.     return t
  2797. end
  2798.  
  2799. local function ToValue(value,type)
  2800.     if type == "Vector2" then
  2801.         local list = Split(value,",")
  2802.         if #list < 2 then return nil end
  2803.         local x = tonumber(list[1]) or 0
  2804.         local y = tonumber(list[2]) or 0
  2805.         return Vector2.new(x,y)
  2806.     elseif type == "Vector3" then
  2807.         local list = Split(value,",")
  2808.         if #list < 3 then return nil end
  2809.         local x = tonumber(list[1]) or 0
  2810.         local y = tonumber(list[2]) or 0
  2811.         local z = tonumber(list[3]) or 0
  2812.         return Vector3.new(x,y,z)
  2813.     elseif type == "Color3" then
  2814.         local list = Split(value,",")
  2815.         if #list < 3 then return nil end
  2816.         local r = tonumber(list[1]) or 0
  2817.         local g = tonumber(list[2]) or 0
  2818.         local b = tonumber(list[3]) or 0
  2819.         return Color3.new(r/255,g/255, b/255)
  2820.     elseif type == "UDim2" then
  2821.         local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
  2822.         if #list < 4 then return nil end
  2823.         local xScale = tonumber(list[1]) or 0
  2824.         local xOffset = tonumber(list[2]) or 0
  2825.         local yScale = tonumber(list[3]) or 0
  2826.         local yOffset = tonumber(list[4]) or 0
  2827.         return UDim2.new(xScale, xOffset, yScale, yOffset)
  2828.     elseif type == "Number" then
  2829.         return tonumber(value)
  2830.     elseif type == "String" then
  2831.         return value
  2832.     elseif type == "NumberRange" then
  2833.         local list = Split(value,",")
  2834.         if #list == 1 then
  2835.             if tonumber(list[1]) == nil then return nil end
  2836.             local newVal = tonumber(list[1]) or 0
  2837.             return NumberRange.new(newVal)
  2838.         end
  2839.         if #list < 2 then return nil end
  2840.         local x = tonumber(list[1]) or 0
  2841.         local y = tonumber(list[2]) or 0
  2842.         return NumberRange.new(x,y)
  2843.     elseif type == "Script" then
  2844.         local success,err = ypcall(function()
  2845.         _G.D_E_X_DONOTUSETHISPLEASE = nil
  2846.         loadstring(
  2847.             "_G.D_E_X_DONOTUSETHISPLEASE = "..value
  2848.         )()
  2849.         return _G.D_E_X_DONOTUSETHISPLEASE
  2850.         end)
  2851.         if err then
  2852.             return nil
  2853.         end
  2854.     else
  2855.         return nil
  2856.     end
  2857. end
  2858.  
  2859. local function ToPropValue(value,type)
  2860.     if type == "Vector2" then
  2861.         local list = Split(value,",")
  2862.         if #list < 2 then return nil end
  2863.         local x = tonumber(list[1]) or 0
  2864.         local y = tonumber(list[2]) or 0
  2865.         return Vector2.new(x,y)
  2866.     elseif type == "Vector3" then
  2867.         local list = Split(value,",")
  2868.         if #list < 3 then return nil end
  2869.         local x = tonumber(list[1]) or 0
  2870.         local y = tonumber(list[2]) or 0
  2871.         local z = tonumber(list[3]) or 0
  2872.         return Vector3.new(x,y,z)
  2873.     elseif type == "Color3" then
  2874.         local list = Split(value,",")
  2875.         if #list < 3 then return nil end
  2876.         local r = tonumber(list[1]) or 0
  2877.         local g = tonumber(list[2]) or 0
  2878.         local b = tonumber(list[3]) or 0
  2879.         return Color3.new(r/255,g/255, b/255)
  2880.     elseif type == "UDim2" then
  2881.         local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
  2882.         if #list < 4 then return nil end
  2883.         local xScale = tonumber(list[1]) or 0
  2884.         local xOffset = tonumber(list[2]) or 0
  2885.         local yScale = tonumber(list[3]) or 0
  2886.         local yOffset = tonumber(list[4]) or 0
  2887.         return UDim2.new(xScale, xOffset, yScale, yOffset)
  2888.     elseif type == "Content" then
  2889.         return value
  2890.     elseif type == "float" or type == "int" or type == "double" then
  2891.         return tonumber(value)
  2892.     elseif type == "string" then
  2893.         return value
  2894.     elseif type == "NumberRange" then
  2895.         local list = Split(value,",")
  2896.         if #list == 1 then
  2897.             if tonumber(list[1]) == nil then return nil end
  2898.             local newVal = tonumber(list[1]) or 0
  2899.             return NumberRange.new(newVal)
  2900.         end
  2901.         if #list < 2 then return nil end
  2902.         local x = tonumber(list[1]) or 0
  2903.         local y = tonumber(list[2]) or 0
  2904.         return NumberRange.new(x,y)
  2905.     elseif string.sub(value,1,4) == "Enum" then
  2906.         local getEnum = value
  2907.         while true do
  2908.             local x,y = string.find(getEnum,".")
  2909.             if y then
  2910.                 getEnum = string.sub(getEnum,y+1)
  2911.             else
  2912.                 break
  2913.             end
  2914.         end
  2915.         print(getEnum)
  2916.         return getEnum
  2917.     else
  2918.         return nil
  2919.     end
  2920. end
  2921.  
  2922. function PromptRemoteCaller(inst)
  2923.     if CurrentRemoteWindow then
  2924.         CurrentRemoteWindow:Destroy()
  2925.         CurrentRemoteWindow = nil
  2926.     end
  2927.     CurrentRemoteWindow = RemoteWindow:Clone()
  2928.     CurrentRemoteWindow.Parent = explorerPanel.Parent
  2929.     CurrentRemoteWindow.Visible = true
  2930.    
  2931.     local displayValues = false
  2932.    
  2933.     local ArgumentList = CurrentRemoteWindow.MainWindow.Arguments
  2934.     local ArgumentTemplate = CurrentRemoteWindow.MainWindow.ArgumentTemplate
  2935.    
  2936.     if inst:IsA("RemoteEvent") then
  2937.         CurrentRemoteWindow.Title.Text = "Fire Event"
  2938.         CurrentRemoteWindow.MainWindow.Ok.Text = "Fire"
  2939.         CurrentRemoteWindow.MainWindow.DisplayReturned.Visible = false
  2940.         CurrentRemoteWindow.MainWindow.Desc2.Visible = false
  2941.     end
  2942.    
  2943.     local newArgument = ArgumentTemplate:Clone()
  2944.     newArgument.Parent = ArgumentList
  2945.     newArgument.Visible = true
  2946.     newArgument.Type.MouseButton1Down:connect(function()
  2947.         createDDown(newArgument.Type,function(choice)
  2948.             newArgument.Type.Text = choice
  2949.         end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
  2950.     end)
  2951.    
  2952.     CurrentRemoteWindow.MainWindow.Ok.MouseButton1Up:connect(function()
  2953.         if CurrentRemoteWindow and inst.Parent ~= nil then
  2954.             local MyArguments = {}
  2955.             for i,v in pairs(ArgumentList:GetChildren()) do
  2956.                 table.insert(MyArguments,ToValue(v.Value.Text,v.Type.Text))
  2957.             end
  2958.             if inst:IsA("RemoteFunction") then
  2959.                 if displayValues then
  2960.                     spawn(function()
  2961.                         local myResults = inst:InvokeServer(unpack(MyArguments))
  2962.                         if myResults then
  2963.                             CreateTableCaution("Remote Caller",myResults)
  2964.                         else
  2965.                             CreateCaution("Remote Caller","This remote did not return anything.")
  2966.                         end
  2967.                     end)
  2968.                 else
  2969.                     spawn(function()
  2970.                         inst:InvokeServer(unpack(MyArguments))
  2971.                     end)
  2972.                 end
  2973.             else
  2974.                 inst:FireServer(unpack(MyArguments))
  2975.             end
  2976.             CurrentRemoteWindow:Destroy()
  2977.             CurrentRemoteWindow = nil
  2978.         end
  2979.     end)
  2980.    
  2981.     CurrentRemoteWindow.MainWindow.Add.MouseButton1Up:connect(function()
  2982.         if CurrentRemoteWindow then
  2983.             local newArgument = ArgumentTemplate:Clone()
  2984.             newArgument.Position = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
  2985.             newArgument.Parent = ArgumentList
  2986.             ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
  2987.             newArgument.Visible = true
  2988.             newArgument.Type.MouseButton1Down:connect(function()
  2989.                 createDDown(newArgument.Type,function(choice)
  2990.                     newArgument.Type.Text = choice
  2991.                 end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
  2992.             end)
  2993.         end
  2994.     end)
  2995.    
  2996.     CurrentRemoteWindow.MainWindow.Subtract.MouseButton1Up:connect(function()
  2997.         if CurrentRemoteWindow then
  2998.             if #ArgumentList:GetChildren() > 1 then
  2999.                 ArgumentList:GetChildren()[#ArgumentList:GetChildren()]:Destroy()
  3000.                 ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
  3001.             end
  3002.         end
  3003.     end)
  3004.    
  3005.     CurrentRemoteWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
  3006.         if CurrentRemoteWindow then
  3007.             CurrentRemoteWindow:Destroy()
  3008.             CurrentRemoteWindow = nil
  3009.         end
  3010.     end)
  3011.    
  3012.     CurrentRemoteWindow.MainWindow.DisplayReturned.MouseButton1Up:connect(function()
  3013.         if displayValues then
  3014.             displayValues = false
  3015.             CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = false
  3016.         else
  3017.             displayValues = true
  3018.             CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = true
  3019.         end
  3020.     end)
  3021. end
  3022.  
  3023. function PromptSaveInstance(inst)
  3024.     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
  3025.     if CurrentSaveInstanceWindow then
  3026.         CurrentSaveInstanceWindow:Destroy()
  3027.         CurrentSaveInstanceWindow = nil
  3028.         if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
  3029.             explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
  3030.         end
  3031.     end
  3032.     CurrentSaveInstanceWindow = SaveInstanceWindow:Clone()
  3033.     CurrentSaveInstanceWindow.Parent = explorerPanel.Parent
  3034.     CurrentSaveInstanceWindow.Visible = true
  3035.    
  3036.     local filename = CurrentSaveInstanceWindow.MainWindow.FileName
  3037.     local saveObjects = true
  3038.     local overwriteCaution = false
  3039.    
  3040.     CurrentSaveInstanceWindow.MainWindow.Save.MouseButton1Up:connect(function()
  3041.         if readfile and getelysianpath then
  3042.             if readfile(getelysianpath()..filename.Text..".rbxmx") then
  3043.                 if not overwriteCaution then
  3044.                     overwriteCaution = true
  3045.                     local newCaution = ConfirmationWindow:Clone()
  3046.                     newCaution.Name = "SaveInstanceOverwriteCaution"
  3047.                     newCaution.MainWindow.Desc.Text = "The file, "..filename.Text..".rbxmx, already exists. Overwrite?"
  3048.                     newCaution.Parent = explorerPanel.Parent
  3049.                     newCaution.Visible = true
  3050.                     newCaution.MainWindow.Yes.MouseButton1Up:connect(function()
  3051.                         ypcall(function()
  3052.                             SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
  3053.                         end)
  3054.                         overwriteCaution = false
  3055.                         newCaution:Destroy()
  3056.                         if CurrentSaveInstanceWindow then
  3057.                             CurrentSaveInstanceWindow:Destroy()
  3058.                             CurrentSaveInstanceWindow = nil
  3059.                         end
  3060.                     end)
  3061.                     newCaution.MainWindow.No.MouseButton1Up:connect(function()
  3062.                         overwriteCaution = false
  3063.                         newCaution:Destroy()
  3064.                     end)
  3065.                 end
  3066.             else
  3067.                 ypcall(function()
  3068.                     SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
  3069.                 end)
  3070.                 if CurrentSaveInstanceWindow then
  3071.                     CurrentSaveInstanceWindow:Destroy()
  3072.                     CurrentSaveInstanceWindow = nil
  3073.                     if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
  3074.                         explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
  3075.                     end
  3076.                 end
  3077.             end
  3078.         else
  3079.             ypcall(function()
  3080.                 if SaveInstance then
  3081.                     SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
  3082.                 else
  3083.                     _G.SaveInstance(inst,filename.Text,not saveObjects)
  3084.                 end
  3085.             end)
  3086.             if CurrentSaveInstanceWindow then
  3087.                 CurrentSaveInstanceWindow:Destroy()
  3088.                 CurrentSaveInstanceWindow = nil
  3089.                 if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
  3090.                     explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
  3091.                 end
  3092.             end
  3093.         end
  3094.     end)
  3095.     CurrentSaveInstanceWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
  3096.         if CurrentSaveInstanceWindow then
  3097.             CurrentSaveInstanceWindow:Destroy()
  3098.             CurrentSaveInstanceWindow = nil
  3099.             if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
  3100.                 explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
  3101.             end
  3102.         end
  3103.     end)
  3104.     CurrentSaveInstanceWindow.MainWindow.SaveObjects.MouseButton1Up:connect(function()
  3105.         if saveObjects then
  3106.             saveObjects = false
  3107.             CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = false
  3108.         else
  3109.             saveObjects = true
  3110.             CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = true
  3111.         end
  3112.     end)
  3113. end
  3114.  
  3115. function DestroyRightClick()
  3116.     if currentRightClickMenu then
  3117.         currentRightClickMenu:Destroy()
  3118.         currentRightClickMenu = nil
  3119.     end
  3120.     if CurrentInsertObjectWindow and CurrentInsertObjectWindow.Visible then
  3121.         CurrentInsertObjectWindow.Visible = false
  3122.     end
  3123. end
  3124.  
  3125. function rightClickMenu(sObj)
  3126.     local mouse = game.Players.LocalPlayer:GetMouse()
  3127.    
  3128.     currentRightClickMenu = CreateRightClickMenu(
  3129.         {"Cut","Copy","Paste Into","Duplicate","Delete","Group","Ungroup","Select Children","Teleport To","Insert Part","Insert Object","View Script","Save Instance","Call Function","Call Remote"},
  3130.         "",
  3131.         false,
  3132.         function(option)
  3133.             if option == "Cut" then
  3134.                 if not Option.Modifiable then return end
  3135.                 clipboard = {}
  3136.                 local list = Selection.List
  3137.                 local cut = {}
  3138.                 for i = 1,#list do
  3139.                     local obj = list[i]:Clone()
  3140.                     if obj then
  3141.                         table.insert(clipboard,obj)
  3142.                         table.insert(cut,list[i])
  3143.                     end
  3144.                 end
  3145.                 for i = 1,#cut do
  3146.                     pcall(delete,cut[i])
  3147.                 end
  3148.                 updateActions()
  3149.             elseif option == "Copy" then
  3150.                 if not Option.Modifiable then return end
  3151.                 clipboard = {}
  3152.                 local list = Selection.List
  3153.                 for i = 1,#list do
  3154.                     table.insert(clipboard,list[i]:Clone())
  3155.                 end
  3156.                 updateActions()
  3157.             elseif option == "Paste Into" then
  3158.                 if not Option.Modifiable then return end
  3159.                 local parent = Selection.List[1] or workspace
  3160.                 for i = 1,#clipboard do
  3161.                     clipboard[i]:Clone().Parent = parent
  3162.                 end
  3163.             elseif option == "Duplicate" then
  3164.                 if not Option.Modifiable then return end
  3165.                 local list = Selection:Get()
  3166.                 for i = 1,#list do
  3167.                     list[i]:Clone().Parent = Selection.List[1].Parent or workspace
  3168.                 end
  3169.             elseif option == "Delete" then
  3170.                 if not Option.Modifiable then return end
  3171.                 local list = Selection:Get()
  3172.                 for i = 1,#list do
  3173.                     pcall(delete,list[i])
  3174.                 end
  3175.                 Selection:Set({})
  3176.             elseif option == "Group" then
  3177.                 if not Option.Modifiable then return end
  3178.                 local newModel = Instance.new("Model")
  3179.                 local list = Selection:Get()
  3180.                 newModel.Parent = Selection.List[1].Parent or workspace
  3181.                 for i = 1,#list do
  3182.                     list[i].Parent = newModel
  3183.                 end
  3184.                 Selection:Set({})
  3185.             elseif option == "Ungroup" then
  3186.                 if not Option.Modifiable then return end
  3187.                 local ungrouped = {}
  3188.                 local list = Selection:Get()
  3189.                 for i = 1,#list do
  3190.                     if list[i]:IsA("Model") then
  3191.                         for i2,v2 in pairs(list[i]:GetChildren()) do
  3192.                             v2.Parent = list[i].Parent or workspace
  3193.                             table.insert(ungrouped,v2)
  3194.                         end    
  3195.                         pcall(delete,list[i])          
  3196.                     end
  3197.                 end
  3198.                 Selection:Set({})
  3199.                 if SettingsRemote:Invoke("SelectUngrouped") then
  3200.                     for i,v in pairs(ungrouped) do
  3201.                         Selection:Add(v)
  3202.                     end
  3203.                 end
  3204.             elseif option == "Select Children" then
  3205.                 if not Option.Modifiable then return end
  3206.                 local list = Selection:Get()
  3207.                 Selection:Set({})
  3208.                 Selection:StopUpdates()
  3209.                 for i = 1,#list do
  3210.                     for i2,v2 in pairs(list[i]:GetChildren()) do
  3211.                         Selection:Add(v2)
  3212.                     end
  3213.                 end
  3214.                 Selection:ResumeUpdates()
  3215.             elseif option == "Teleport To" then
  3216.                 if not Option.Modifiable then return end
  3217.                 local list = Selection:Get()
  3218.                 for i = 1,#list do
  3219.                     if list[i]:IsA("BasePart") then
  3220.                         pcall(function()
  3221.                             game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = list[i].CFrame
  3222.                         end)
  3223.                         break
  3224.                     end
  3225.                 end
  3226.             elseif option == "Insert Part" then
  3227.                 if not Option.Modifiable then return end
  3228.                 local insertedParts = {}
  3229.                 local list = Selection:Get()
  3230.                 for i = 1,#list do
  3231.                     pcall(function()
  3232.                         local newPart = Instance.new("Part")
  3233.                         newPart.Parent = list[i]
  3234.                         newPart.CFrame = CFrame.new(game.Players.LocalPlayer.Character.Head.Position) + Vector3.new(0,3,0)
  3235.                         table.insert(insertedParts,newPart)
  3236.                     end)
  3237.                 end
  3238.             elseif option == "Save Instance" then
  3239.                 if not Option.Modifiable then return end
  3240.                 local list = Selection:Get()
  3241.                 if #list == 1 then
  3242.                     list[1].Archivable = true
  3243.                     ypcall(function()PromptSaveInstance(list[1]:Clone())end)
  3244.                 elseif #list > 1 then
  3245.                     local newModel = Instance.new("Model")
  3246.                     newModel.Name = "SavedInstances"
  3247.                     for i = 1,#list do
  3248.                         ypcall(function()
  3249.                             list[i].Archivable = true
  3250.                             list[i]:Clone().Parent = newModel
  3251.                         end)
  3252.                     end
  3253.                     PromptSaveInstance(newModel)
  3254.                 end
  3255.             elseif option == "Call Remote" then
  3256.                 if not Option.Modifiable then return end
  3257.                 local list = Selection:Get()
  3258.                 for i = 1,#list do
  3259.                     if list[i]:IsA("RemoteFunction") or list[i]:IsA("RemoteEvent") then
  3260.                         PromptRemoteCaller(list[i])
  3261.                         break
  3262.                     end
  3263.                 end
  3264.             elseif option == "View Script" then
  3265.                 if not Option.Modifiable then return end
  3266.                 local list = Selection:Get()
  3267.                 for i = 1,#list do
  3268.                     if list[i]:IsA("LocalScript") or list[i]:IsA("ModuleScript") then
  3269.                         ScriptEditorEvent:Fire(list[i])
  3270.                     end
  3271.                 end
  3272.             end
  3273.     end)
  3274.     currentRightClickMenu.Parent = explorerPanel.Parent
  3275.     currentRightClickMenu.Position = UDim2.new(0,mouse.X,0,mouse.Y)
  3276.     if currentRightClickMenu.AbsolutePosition.X + currentRightClickMenu.AbsoluteSize.X > explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X then
  3277.         currentRightClickMenu.Position = UDim2.new(0, explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X - currentRightClickMenu.AbsoluteSize.X, 0, mouse.Y)
  3278.     end
  3279. end
  3280.  
  3281. local function cancelReparentDrag()end
  3282. local function cancelSelectDrag()end
  3283. do
  3284.     local listEntries = {}
  3285.     local nameConnLookup = {}
  3286.  
  3287.     local mouseDrag = Create('ImageButton',{
  3288.         Name = "MouseDrag";
  3289.         Position = UDim2.new(-0.25,0,-0.25,0);
  3290.         Size = UDim2.new(1.5,0,1.5,0);
  3291.         Transparency = 1;
  3292.         AutoButtonColor = false;
  3293.         Active = true;
  3294.         ZIndex = 10;
  3295.     })
  3296.     local function dragSelect(last,add,button)
  3297.         local connDrag
  3298.         local conUp
  3299.  
  3300.         conDrag = mouseDrag.MouseMoved:connect(function(x,y)
  3301.             local pos = Vector2.new(x,y) - listFrame.AbsolutePosition
  3302.             local size = listFrame.AbsoluteSize
  3303.             if pos.x < 0 or pos.x > size.x or pos.y < 0 or pos.y > size.y then return end
  3304.  
  3305.             local i = math.ceil(pos.y/ENTRY_BOUND) + scrollBar.ScrollIndex
  3306.             -- Mouse may have made a large step, so interpolate between the
  3307.             -- last index and the current.
  3308.             for n = i<last and i or last, i>last and i or last do
  3309.                 local node = TreeList[n]
  3310.                 if node then
  3311.                     if add then
  3312.                         Selection:Add(node.Object)
  3313.                     else
  3314.                         Selection:Remove(node.Object)
  3315.                     end
  3316.                 end
  3317.             end
  3318.             last = i
  3319.         end)
  3320.  
  3321.         function cancelSelectDrag()
  3322.             mouseDrag.Parent = nil
  3323.             conDrag:disconnect()
  3324.             conUp:disconnect()
  3325.             function cancelSelectDrag()end
  3326.         end
  3327.  
  3328.         conUp = mouseDrag[button]:connect(cancelSelectDrag)
  3329.  
  3330.         mouseDrag.Parent = GetScreen(listFrame)
  3331.     end
  3332.  
  3333.     local function dragReparent(object,dragGhost,clickPos,ghostOffset)
  3334.         local connDrag
  3335.         local conUp
  3336.         local conUp2
  3337.  
  3338.         local parentIndex = nil
  3339.         local dragged = false
  3340.  
  3341.         local parentHighlight = Create('Frame',{
  3342.             Transparency = 1;
  3343.             Visible = false;
  3344.             Create('Frame',{
  3345.                 BorderSizePixel = 0;
  3346.                 BackgroundColor3 = Color3.new(0,0,0);
  3347.                 BackgroundTransparency = 0.1;
  3348.                 Position = UDim2.new(0,0,0,0);
  3349.                 Size = UDim2.new(1,0,0,1);
  3350.             });
  3351.             Create('Frame',{
  3352.                 BorderSizePixel = 0;
  3353.                 BackgroundColor3 = Color3.new(0,0,0);
  3354.                 BackgroundTransparency = 0.1;
  3355.                 Position = UDim2.new(1,0,0,0);
  3356.                 Size = UDim2.new(0,1,1,0);
  3357.             });
  3358.             Create('Frame',{
  3359.                 BorderSizePixel = 0;
  3360.                 BackgroundColor3 = Color3.new(0,0,0);
  3361.                 BackgroundTransparency = 0.1;
  3362.                 Position = UDim2.new(0,0,1,0);
  3363.                 Size = UDim2.new(1,0,0,1);
  3364.             });
  3365.             Create('Frame',{
  3366.                 BorderSizePixel = 0;
  3367.                 BackgroundColor3 = Color3.new(0,0,0);
  3368.                 BackgroundTransparency = 0.1;
  3369.                 Position = UDim2.new(0,0,0,0);
  3370.                 Size = UDim2.new(0,1,1,0);
  3371.             });
  3372.         })
  3373.         SetZIndex(parentHighlight,9)
  3374.  
  3375.         conDrag = mouseDrag.MouseMoved:connect(function(x,y)
  3376.             local dragPos = Vector2.new(x,y)
  3377.             if dragged then
  3378.                 local pos = dragPos - listFrame.AbsolutePosition
  3379.                 local size = listFrame.AbsoluteSize
  3380.  
  3381.                 parentIndex = nil
  3382.                 parentHighlight.Visible = false
  3383.                 if pos.x >= 0 and pos.x <= size.x and pos.y >= 0 and pos.y <= size.y + ENTRY_SIZE*2 then
  3384.                     local i = math.ceil(pos.y/ENTRY_BOUND-2)
  3385.                     local node = TreeList[i + scrollBar.ScrollIndex]
  3386.                     if node and node.Object ~= object and not object:IsAncestorOf(node.Object) then
  3387.                         parentIndex = i
  3388.                         local entry = listEntries[i]
  3389.                         if entry then
  3390.                             parentHighlight.Visible = true
  3391.                             parentHighlight.Position = UDim2.new(0,1,0,entry.AbsolutePosition.y-listFrame.AbsolutePosition.y)
  3392.                             parentHighlight.Size = UDim2.new(0,size.x-4,0,entry.AbsoluteSize.y)
  3393.                         end
  3394.                     end
  3395.                 end
  3396.  
  3397.                 dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
  3398.             elseif (clickPos-dragPos).magnitude > 8 then
  3399.                 dragged = true
  3400.                 SetZIndex(dragGhost,9)
  3401.                 dragGhost.IndentFrame.Transparency = 0.25
  3402.                 dragGhost.IndentFrame.EntryText.TextColor3 = GuiColor.TextSelected
  3403.                 dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
  3404.                 dragGhost.Parent = GetScreen(listFrame)
  3405.                 parentHighlight.Parent = listFrame
  3406.             end
  3407.         end)
  3408.  
  3409.         function cancelReparentDrag()
  3410.             mouseDrag.Parent = nil
  3411.             conDrag:disconnect()
  3412.             conUp:disconnect()
  3413.             conUp2:disconnect()
  3414.             dragGhost:Destroy()
  3415.             parentHighlight:Destroy()
  3416.             function cancelReparentDrag()end
  3417.         end
  3418.  
  3419.         local wasSelected = Selection.Selected[object]
  3420.         if not wasSelected and Option.Selectable then
  3421.             Selection:Set({object})
  3422.         end
  3423.  
  3424.         conUp = mouseDrag.MouseButton1Up:connect(function()
  3425.             cancelReparentDrag()
  3426.             if dragged then
  3427.                 if parentIndex then
  3428.                     local parentNode = TreeList[parentIndex + scrollBar.ScrollIndex]
  3429.                     if parentNode then
  3430.                         parentNode.Expanded = true
  3431.  
  3432.                         local parentObj = parentNode.Object
  3433.                         local function parent(a,b)
  3434.                             a.Parent = b
  3435.                         end
  3436.                         if Option.Selectable then
  3437.                             local list = Selection.List
  3438.                             for i = 1,#list do
  3439.                                 pcall(parent,list[i],parentObj)
  3440.                             end
  3441.                         else
  3442.                             pcall(parent,object,parentObj)
  3443.                         end
  3444.                     end
  3445.                 end
  3446.             else
  3447.                 -- do selection click
  3448.                 if wasSelected and Option.Selectable then
  3449.                     Selection:Set({})
  3450.                 end
  3451.             end
  3452.         end)
  3453.         conUp2 = mouseDrag.MouseButton2Down:connect(function()
  3454.             cancelReparentDrag()
  3455.         end)
  3456.  
  3457.         mouseDrag.Parent = GetScreen(listFrame)
  3458.     end
  3459.  
  3460.     local entryTemplate = Create('ImageButton',{
  3461.         Name = "Entry";
  3462.         Transparency = 1;
  3463.         AutoButtonColor = false;
  3464.         Position = UDim2.new(0,0,0,0);
  3465.         Size = UDim2.new(1,0,0,ENTRY_SIZE);
  3466.         Create('Frame',{
  3467.             Name = "IndentFrame";
  3468.             BackgroundTransparency = 1;
  3469.             BackgroundColor3 = GuiColor.Selected;
  3470.             BorderColor3 = GuiColor.BorderSelected;
  3471.             Position = UDim2.new(0,0,0,0);
  3472.             Size = UDim2.new(1,0,1,0);
  3473.             Create(Icon('ImageButton',0),{
  3474.                 Name = "Expand";
  3475.                 AutoButtonColor = false;
  3476.                 Position = UDim2.new(0,-GUI_SIZE,0.5,-GUI_SIZE/2);
  3477.                 Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
  3478.             });
  3479.             Create(Icon(nil,0),{
  3480.                 Name = "ExplorerIcon";
  3481.                 Position = UDim2.new(0,2+ENTRY_PADDING,0.5,-GUI_SIZE/2);
  3482.                 Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
  3483.             });
  3484.             Create('TextLabel',{
  3485.                 Name = "EntryText";
  3486.                 BackgroundTransparency = 1;
  3487.                 TextColor3 = GuiColor.Text;
  3488.                 TextXAlignment = 'Left';
  3489.                 TextYAlignment = 'Center';
  3490.                 Font = FONT;
  3491.                 FontSize = FONT_SIZE;
  3492.                 Text = "";
  3493.                 Position = UDim2.new(0,2+ENTRY_SIZE+4,0,0);
  3494.                 Size = UDim2.new(1,-2,1,0);
  3495.             });
  3496.         });
  3497.     })
  3498.  
  3499.     function scrollBar.UpdateCallback(self)
  3500.         for i = 1,self.VisibleSpace do
  3501.             local node = TreeList[i + self.ScrollIndex]
  3502.             if node then
  3503.                 local entry = listEntries[i]
  3504.                 if not entry then
  3505.                     entry = Create(entryTemplate:Clone(),{
  3506.                         Position = UDim2.new(0,2,0,ENTRY_BOUND*(i-1)+2);
  3507.                         Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE);
  3508.                         ZIndex = listFrame.ZIndex;
  3509.                     })
  3510.                     listEntries[i] = entry
  3511.  
  3512.                     local expand = entry.IndentFrame.Expand
  3513.                     expand.MouseEnter:connect(function()
  3514.                         local node = TreeList[i + self.ScrollIndex]
  3515.                         if #node > 0 then
  3516.                             if node.Expanded then
  3517.                                 Icon(expand,NODE_EXPANDED_OVER)
  3518.                             else
  3519.                                 Icon(expand,NODE_COLLAPSED_OVER)
  3520.                             end
  3521.                         end
  3522.                     end)
  3523.                     expand.MouseLeave:connect(function()
  3524.                         local node = TreeList[i + self.ScrollIndex]
  3525.                         if #node > 0 then
  3526.                             if node.Expanded then
  3527.                                 Icon(expand,NODE_EXPANDED)
  3528.                             else
  3529.                                 Icon(expand,NODE_COLLAPSED)
  3530.                             end
  3531.                         end
  3532.                     end)
  3533.                     expand.MouseButton1Down:connect(function()
  3534.                         local node = TreeList[i + self.ScrollIndex]
  3535.                         if #node > 0 then
  3536.                             node.Expanded = not node.Expanded
  3537.                             if node.Object == explorerPanel.Parent and node.Expanded then
  3538.                                 CreateCaution("Warning","Please be careful when editing instances inside here, this is like the System32 of Dex and modifying objects here can break Dex.")
  3539.                             end
  3540.                             -- use raw update so the list updates instantly
  3541.                             rawUpdateList()
  3542.                         end
  3543.                     end)
  3544.  
  3545.                     entry.MouseButton1Down:connect(function(x,y)
  3546.                         local node = TreeList[i + self.ScrollIndex]
  3547.                         DestroyRightClick()
  3548.                         if GetAwaitRemote:Invoke() then
  3549.                             bindSetAwaiting:Fire(node.Object)
  3550.                             return
  3551.                         end
  3552.                        
  3553.                         if not HoldingShift then
  3554.                             lastSelectedNode = i + self.ScrollIndex
  3555.                         end
  3556.                        
  3557.                         if HoldingShift and not filteringWorkspace() then
  3558.                             if lastSelectedNode then
  3559.                                 if i + self.ScrollIndex - lastSelectedNode > 0 then
  3560.                                     Selection:StopUpdates()
  3561.                                     for i2 = 1, i + self.ScrollIndex - lastSelectedNode do
  3562.                                         local newNode = TreeList[lastSelectedNode + i2]
  3563.                                         if newNode then
  3564.                                             Selection:Add(newNode.Object)
  3565.                                         end
  3566.                                     end
  3567.                                     Selection:ResumeUpdates()
  3568.                                 else
  3569.                                     Selection:StopUpdates()
  3570.                                     for i2 = i + self.ScrollIndex - lastSelectedNode, 1 do
  3571.                                         local newNode = TreeList[lastSelectedNode + i2]
  3572.                                         if newNode then
  3573.                                             Selection:Add(newNode.Object)
  3574.                                         end
  3575.                                     end
  3576.                                     Selection:ResumeUpdates()
  3577.                                 end
  3578.                             end
  3579.                             return
  3580.                         end
  3581.                        
  3582.                         if HoldingCtrl then
  3583.                             if Selection.Selected[node.Object] then
  3584.                                 Selection:Remove(node.Object)
  3585.                             else
  3586.                                 Selection:Add(node.Object)
  3587.                             end
  3588.                             return
  3589.                         end
  3590.                         if Option.Modifiable then
  3591.                             local pos = Vector2.new(x,y)
  3592.                             dragReparent(node.Object,entry:Clone(),pos,entry.AbsolutePosition-pos)
  3593.                         elseif Option.Selectable then
  3594.                             if Selection.Selected[node.Object] then
  3595.                                 Selection:Set({})
  3596.                             else
  3597.                                 Selection:Set({node.Object})
  3598.                             end
  3599.                             dragSelect(i+self.ScrollIndex,true,'MouseButton1Up')
  3600.                         end
  3601.                     end)
  3602.  
  3603.                     entry.MouseButton2Down:connect(function()
  3604.                         if not Option.Selectable then return end
  3605.                        
  3606.                         DestroyRightClick()
  3607.                        
  3608.                         curSelect = entry
  3609.                        
  3610.                         local node = TreeList[i + self.ScrollIndex]
  3611.                        
  3612.                         if GetAwaitRemote:Invoke() then
  3613.                             bindSetAwaiting:Fire(node.Object)
  3614.                             return
  3615.                         end
  3616.                        
  3617.                         if not Selection.Selected[node.Object] then
  3618.                             Selection:Set({node.Object})
  3619.                         end
  3620.                     end)
  3621.                    
  3622.                    
  3623.                     entry.MouseButton2Up:connect(function()
  3624.                         if not Option.Selectable then return end
  3625.                        
  3626.                         local node = TreeList[i + self.ScrollIndex]
  3627.                        
  3628.                         if checkMouseInGui(curSelect) then
  3629.                             rightClickMenu(node.Object)
  3630.                         end
  3631.                     end)
  3632.  
  3633.                     entry.Parent = listFrame
  3634.                 end
  3635.  
  3636.                 entry.Visible = true
  3637.  
  3638.                 local object = node.Object
  3639.  
  3640.                 -- update expand icon
  3641.                 if #node == 0 then
  3642.                     entry.IndentFrame.Expand.Visible = false
  3643.                 elseif node.Expanded then
  3644.                     Icon(entry.IndentFrame.Expand,NODE_EXPANDED)
  3645.                     entry.IndentFrame.Expand.Visible = true
  3646.                 else
  3647.                     Icon(entry.IndentFrame.Expand,NODE_COLLAPSED)
  3648.                     entry.IndentFrame.Expand.Visible = true
  3649.                 end
  3650.  
  3651.                 -- update explorer icon
  3652.                 Icon(entry.IndentFrame.ExplorerIcon,ExplorerIndex[object.ClassName] or 0)
  3653.  
  3654.                 -- update indentation
  3655.                 local w = (node.Depth)*(2+ENTRY_PADDING+GUI_SIZE)
  3656.                 entry.IndentFrame.Position = UDim2.new(0,w,0,0)
  3657.                 entry.IndentFrame.Size = UDim2.new(1,-w,1,0)
  3658.  
  3659.                 -- update name change detection
  3660.                 if nameConnLookup[entry:GetDebugId(10)] then
  3661.                     nameConnLookup[entry:GetDebugId(10)]:disconnect()
  3662.                 end
  3663.                 local text = entry.IndentFrame.EntryText
  3664.                 text.Text = object.Name
  3665.                 nameConnLookup[entry:GetDebugId(10)] = node.Object.Changed:connect(function(p)
  3666.                     if p == 'Name' then
  3667.                         text.Text = object.Name
  3668.                     end
  3669.                 end)
  3670.  
  3671.                 -- update selection
  3672.                 entry.IndentFrame.Transparency = node.Selected and 0 or 1
  3673.                 text.TextColor3 = GuiColor[node.Selected and 'TextSelected' or 'Text']
  3674.  
  3675.                 entry.Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE)
  3676.             elseif listEntries[i] then
  3677.                 listEntries[i].Visible = false
  3678.             end
  3679.         end
  3680.         for i = self.VisibleSpace+1,self.TotalSpace do
  3681.             local entry = listEntries[i]
  3682.             if entry then
  3683.                 listEntries[i] = nil
  3684.                 entry:Destroy()
  3685.             end
  3686.         end
  3687.     end
  3688.  
  3689.     function scrollBarH.UpdateCallback(self)
  3690.         for i = 1,scrollBar.VisibleSpace do
  3691.             local node = TreeList[i + scrollBar.ScrollIndex]
  3692.             if node then
  3693.                 local entry = listEntries[i]
  3694.                 if entry then
  3695.                     entry.Position = UDim2.new(0,2 - scrollBarH.ScrollIndex,0,ENTRY_BOUND*(i-1)+2)
  3696.                 end
  3697.             end
  3698.         end
  3699.     end
  3700.  
  3701.     Connect(listFrame.Changed,function(p)
  3702.         if p == 'AbsoluteSize' then
  3703.             rawUpdateSize()
  3704.         end
  3705.     end)
  3706.  
  3707.     local wheelAmount = 6
  3708.     explorerPanel.MouseWheelForward:connect(function()
  3709.         if scrollBar.VisibleSpace - 1 > wheelAmount then
  3710.             scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount)
  3711.         else
  3712.             scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace)
  3713.         end
  3714.     end)
  3715.     explorerPanel.MouseWheelBackward:connect(function()
  3716.         if scrollBar.VisibleSpace - 1 > wheelAmount then
  3717.             scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount)
  3718.         else
  3719.             scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace)
  3720.         end
  3721.     end)
  3722. end
  3723.  
  3724. ----------------------------------------------------------------
  3725. ----------------------------------------------------------------
  3726. ----------------------------------------------------------------
  3727. ----------------------------------------------------------------
  3728. ---- Object detection
  3729.  
  3730. -- Inserts `v` into `t` at `i`. Also sets `Index` field in `v`.
  3731. local function insert(t,i,v)
  3732.     for n = #t,i,-1 do
  3733.         local v = t[n]
  3734.         v.Index = n+1
  3735.         t[n+1] = v
  3736.     end
  3737.     v.Index = i
  3738.     t[i] = v
  3739. end
  3740.  
  3741. -- Removes `i` from `t`. Also sets `Index` field in removed value.
  3742. local function remove(t,i)
  3743.     local v = t[i]
  3744.     for n = i+1,#t do
  3745.         local v = t[n]
  3746.         v.Index = n-1
  3747.         t[n-1] = v
  3748.     end
  3749.     t[#t] = nil
  3750.     v.Index = 0
  3751.     return v
  3752. end
  3753.  
  3754. -- Returns how deep `o` is in the tree.
  3755. local function depth(o)
  3756.     local d = -1
  3757.     while o do
  3758.         o = o.Parent
  3759.         d = d + 1
  3760.     end
  3761.     return d
  3762. end
  3763.  
  3764.  
  3765. local connLookup = {}
  3766.  
  3767. -- Returns whether a node would be present in the tree list
  3768. local function nodeIsVisible(node)
  3769.     local visible = true
  3770.     node = node.Parent
  3771.     while node and visible do
  3772.         visible = visible and node.Expanded
  3773.         node = node.Parent
  3774.     end
  3775.     return visible
  3776. end
  3777.  
  3778. -- Removes an object's tree node. Called when the object stops existing in the
  3779. -- game tree.
  3780. local function removeObject(object)
  3781.     local objectNode = NodeLookup[object:GetDebugId(10)]
  3782.     if not objectNode then
  3783.         return
  3784.     end
  3785.  
  3786.     local visible = nodeIsVisible(objectNode)
  3787.  
  3788.     Selection:Remove(object,true)
  3789.  
  3790.     local parent = objectNode.Parent
  3791.     remove(parent,objectNode.Index)
  3792.     NodeLookup[object:GetDebugId(10)] = nil
  3793.     connLookup[object:GetDebugId(10)]:disconnect()
  3794.     connLookup[object:GetDebugId(10)] = nil
  3795.  
  3796.     if visible then
  3797.         updateList()
  3798.     elseif nodeIsVisible(parent) then
  3799.         updateScroll()
  3800.     end
  3801. end
  3802.  
  3803. -- Moves a tree node to a new parent. Called when an existing object's parent
  3804. -- changes.
  3805. local function moveObject(object,parent)
  3806.     local objectNode = NodeLookup[object:GetDebugId(10)]
  3807.     if not objectNode then
  3808.         return
  3809.     end
  3810.  
  3811.     local parentNode = NodeLookup[parent:GetDebugId(10)]
  3812.     if not parentNode then
  3813.         return
  3814.     end
  3815.  
  3816.     local visible = nodeIsVisible(objectNode)
  3817.  
  3818.     remove(objectNode.Parent,objectNode.Index)
  3819.     objectNode.Parent = parentNode
  3820.  
  3821.     objectNode.Depth = depth(object)
  3822.     local function r(node,d)
  3823.         for i = 1,#node do
  3824.             node[i].Depth = d
  3825.             r(node[i],d+1)
  3826.         end
  3827.     end
  3828.     r(objectNode,objectNode.Depth+1)
  3829.  
  3830.     insert(parentNode,#parentNode+1,objectNode)
  3831.  
  3832.     if visible or nodeIsVisible(objectNode) then
  3833.         updateList()
  3834.     elseif nodeIsVisible(objectNode.Parent) then
  3835.         updateScroll()
  3836.     end
  3837. end
  3838.  
  3839. -- ScriptContext['/Libraries/LibraryRegistration/LibraryRegistration']
  3840. -- This RobloxLocked object lets me index its properties for some reason
  3841.  
  3842. local function check(object)
  3843.     return object.AncestryChanged
  3844. end
  3845.  
  3846. -- Creates a new tree node from an object. Called when an object starts
  3847. -- existing in the game tree.
  3848. local function addObject(object,noupdate)
  3849.     if script then
  3850.         -- protect against naughty RobloxLocked objects
  3851.         local s = pcall(check,object)
  3852.         if not s then
  3853.             return
  3854.         end
  3855.     end
  3856.  
  3857.     local parentNode = NodeLookup[object.Parent:GetDebugId(10)]
  3858.     if not parentNode then
  3859.         return
  3860.     end
  3861.  
  3862.     local objectNode = {
  3863.         Object = object;
  3864.         Parent = parentNode;
  3865.         Index = 0;
  3866.         Expanded = false;
  3867.         Selected = false;
  3868.         Depth = depth(object);
  3869.     }
  3870.  
  3871.     connLookup[object:GetDebugId(10)] = Connect(object.AncestryChanged,function(c,p)
  3872.         if c == object then
  3873.             if p == nil then
  3874.                 removeObject(c)
  3875.             else
  3876.                 moveObject(c,p)
  3877.             end
  3878.         end
  3879.     end)
  3880.  
  3881.     NodeLookup[object:GetDebugId(10)] = objectNode
  3882.     insert(parentNode,#parentNode+1,objectNode)
  3883.  
  3884.     if not noupdate then
  3885.         if nodeIsVisible(objectNode) then
  3886.             updateList()
  3887.         elseif nodeIsVisible(objectNode.Parent) then
  3888.             updateScroll()
  3889.         end
  3890.     end
  3891. end
  3892.  
  3893. local function makeObject(obj,par)
  3894.     local newObject = Instance.new(obj.ClassName)
  3895.     for i,v in pairs(obj.Properties) do
  3896.         ypcall(function()
  3897.             local newProp
  3898.             newProp = ToPropValue(v.Value,v.Type)
  3899.             newObject[v.Name] = newProp
  3900.         end)
  3901.     end
  3902.     newObject.Parent = par
  3903. end
  3904.  
  3905. local function writeObject(obj)
  3906.     local newObject = {ClassName = obj.ClassName, Properties = {}}
  3907.     for i,v in pairs(RbxApi.GetProperties(obj.className)) do
  3908.         if v["Name"] ~= "Parent" then
  3909.             print("thispassed")
  3910.             table.insert(newObject.Properties,{Name = v["Name"], Type = v["ValueType"], Value = tostring(obj[v["Name"]])})
  3911.         end
  3912.     end
  3913.     return newObject
  3914. end
  3915.  
  3916. local function buildDexStorage()
  3917.     local localDexStorage
  3918.    
  3919.     local success,err = ypcall(function()
  3920.         localDexStorage = game:GetObjects("rbxasset://DexStorage.rbxm")[1]
  3921.     end)
  3922.    
  3923.     if success and localDexStorage then
  3924.         for i,v in pairs(localDexStorage:GetChildren()) do
  3925.             ypcall(function()
  3926.                 v.Parent = DexStorageMain
  3927.             end)
  3928.         end
  3929.     end
  3930.    
  3931.     updateDexStorageListeners()
  3932.     --[[
  3933.     local localDexStorage = readfile(getelysianpath().."DexStorage.txt")--game:GetService("CookiesService"):GetCookieValue("DexStorage")
  3934.     --local success,err = pcall(function()
  3935.         if localDexStorage then
  3936.             local objTable = game:GetService("HttpService"):JSONDecode(localDexStorage)
  3937.             for i,v in pairs(objTable) do
  3938.                 makeObject(v,DexStorageMain)
  3939.             end
  3940.         end
  3941.     --end)
  3942.     --]]
  3943. end
  3944.  
  3945. local dexStorageDebounce = false
  3946. local dexStorageListeners = {}
  3947.  
  3948. local function updateDexStorage()
  3949.     if dexStorageDebounce then return end
  3950.     dexStorageDebounce = true  
  3951.    
  3952.     wait()
  3953.    
  3954.     pcall(function()
  3955.         saveinstance("content//DexStorage.rbxm",DexStorageMain)
  3956.     end)
  3957.    
  3958.     updateDexStorageListeners()
  3959.    
  3960.     dexStorageDebounce = false
  3961.     --[[
  3962.     local success,err = ypcall(function()
  3963.         local objs = {}
  3964.         for i,v in pairs(DexStorageMain:GetChildren()) do
  3965.             table.insert(objs,writeObject(v))
  3966.         end
  3967.         writefile(getelysianpath().."DexStorage.txt",game:GetService("HttpService"):JSONEncode(objs))
  3968.         --game:GetService("CookiesService"):SetCookieValue("DexStorage",game:GetService("HttpService"):JSONEncode(objs))
  3969.     end)
  3970.     if err then
  3971.         CreateCaution("DexStorage Save Fail!","DexStorage broke! If you see this message, report to Raspberry Pi!")
  3972.     end
  3973.     print("hi")
  3974.     --]]
  3975. end
  3976.  
  3977. function updateDexStorageListeners()
  3978.     for i,v in pairs(dexStorageListeners) do
  3979.         v:Disconnect()
  3980.     end
  3981.     dexStorageListeners = {}
  3982.     for i,v in pairs(DexStorageMain:GetChildren()) do
  3983.         pcall(function()
  3984.             local ev = v.Changed:connect(updateDexStorage)
  3985.             table.insert(dexStorageListeners,ev)
  3986.         end)
  3987.     end
  3988. end
  3989.  
  3990. do
  3991.     NodeLookup[workspace.Parent:GetDebugId(10)] = {
  3992.         Object = workspace.Parent;
  3993.         Parent = nil;
  3994.         Index = 0;
  3995.         Expanded = true;
  3996.     }
  3997.    
  3998.     if DexStorageEnabled then
  3999.         NodeLookup[DexStorage:GetDebugId(10)] = {
  4000.             Object = DexStorage;
  4001.             Parent = nil;
  4002.             Index = 0;
  4003.             Expanded = true;
  4004.         }
  4005.     end
  4006.    
  4007.     if NilStorageEnabled then
  4008.         NodeLookup[NilStorage:GetDebugId(10)] = {
  4009.             Object = NilStorage;
  4010.             Parent = nil;
  4011.             Index = 0;
  4012.             Expanded = true;
  4013.         }
  4014.     end
  4015.  
  4016.     Connect(game.DescendantAdded,addObject)
  4017.     Connect(game.DescendantRemoving,removeObject)
  4018.    
  4019.     if DexStorageEnabled then
  4020.         --[[
  4021.         if readfile(getelysianpath().."DexStorage.txt") == nil then
  4022.             writefile(getelysianpath().."DexStorage.txt","")
  4023.         end
  4024.         --]]
  4025.        
  4026.         buildDexStorage()
  4027.    
  4028.         Connect(DexStorage.DescendantAdded,addObject)
  4029.         Connect(DexStorage.DescendantRemoving,removeObject)
  4030.    
  4031.         Connect(DexStorage.DescendantAdded,updateDexStorage)
  4032.         Connect(DexStorage.DescendantRemoving,updateDexStorage)
  4033.     end
  4034.    
  4035.     if NilStorageEnabled then
  4036.         Connect(NilStorage.DescendantAdded,addObject)
  4037.         Connect(NilStorage.DescendantRemoving,removeObject)    
  4038.        
  4039.         local currentTable = get_nil_instances()   
  4040.        
  4041.         spawn(function()
  4042.             while wait() do
  4043.                 if #currentTable ~= #get_nil_instances() then
  4044.                     currentTable = get_nil_instances()
  4045.                     --NilStorageMain:ClearAllChildren()
  4046.                     for i,v in pairs(get_nil_instances()) do
  4047.                         if v ~= NilStorage and v ~= DexStorage then
  4048.                             pcall(function()
  4049.                                 v.Parent = NilStorageMain
  4050.                             end)
  4051.                             --[[
  4052.                             local newNil = v
  4053.                             newNil.Archivable = true
  4054.                             newNil:Clone().Parent = NilStorageMain
  4055.                             --]]
  4056.                         end
  4057.                     end
  4058.                 end
  4059.             end
  4060.         end)
  4061.     end
  4062.  
  4063.     local function get(o)
  4064.         return o:GetChildren()
  4065.     end
  4066.  
  4067.     local function r(o)
  4068.         pcall(function()
  4069.             local children = get(o)
  4070.             for i = 1,#children do
  4071.                 addObject(children[i],true)
  4072.                 r(children[i])
  4073.             end
  4074.         end)
  4075.     end
  4076.  
  4077.     r(workspace.Parent)
  4078.     if DexStorageEnabled then
  4079.         r(DexStorage)
  4080.     end
  4081.     if NilStorageEnabled then
  4082.         r(NilStorage)
  4083.     end
  4084.  
  4085.     scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
  4086.     updateList()
  4087. end
  4088.  
  4089. ----------------------------------------------------------------
  4090. ----------------------------------------------------------------
  4091. ----------------------------------------------------------------
  4092. ----------------------------------------------------------------
  4093. ---- Actions
  4094.  
  4095. local actionButtons do
  4096.     actionButtons = {}
  4097.  
  4098.     local totalActions = 1
  4099.     local currentActions = totalActions
  4100.     local function makeButton(icon,over,name,vis,cond)
  4101.         local buttonEnabled = false
  4102.        
  4103.         local button = Create(Icon('ImageButton',icon),{
  4104.             Name = name .. "Button";
  4105.             Visible = Option.Modifiable and Option.Selectable;
  4106.             Position = UDim2.new(1,-(GUI_SIZE+2)*currentActions+2,0.25,-GUI_SIZE/2);
  4107.             Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
  4108.             Parent = headerFrame;
  4109.         })
  4110.  
  4111.         local tipText = Create('TextLabel',{
  4112.             Name = name .. "Text";
  4113.             Text = name;
  4114.             Visible = false;
  4115.             BackgroundTransparency = 1;
  4116.             TextXAlignment = 'Right';
  4117.             Font = FONT;
  4118.             FontSize = FONT_SIZE;
  4119.             Position = UDim2.new(0,0,0,0);
  4120.             Size = UDim2.new(1,-(GUI_SIZE+2)*totalActions,1,0);
  4121.             Parent = headerFrame;
  4122.         })
  4123.  
  4124.        
  4125.         button.MouseEnter:connect(function()
  4126.             if buttonEnabled then
  4127.                 button.BackgroundTransparency = 0.9
  4128.             end
  4129.             --Icon(button,over)
  4130.             --tipText.Visible = true
  4131.         end)
  4132.         button.MouseLeave:connect(function()
  4133.             button.BackgroundTransparency = 1
  4134.             --Icon(button,icon)
  4135.             --tipText.Visible = false
  4136.         end)
  4137.  
  4138.         currentActions = currentActions + 1
  4139.         actionButtons[#actionButtons+1] = {Obj = button,Cond = cond}
  4140.         QuickButtons[#actionButtons+1] = {Obj = button,Cond = cond, Toggle = function(on)
  4141.             if on then
  4142.                 buttonEnabled = true
  4143.                 Icon(button,over)
  4144.             else
  4145.                 buttonEnabled = false
  4146.                 Icon(button,icon)
  4147.             end
  4148.         end}
  4149.         return button
  4150.     end
  4151.  
  4152.     --local clipboard = {}
  4153.     local function delete(o)
  4154.         o.Parent = nil
  4155.     end
  4156.    
  4157.     makeButton(ACTION_EDITQUICKACCESS,ACTION_EDITQUICKACCESS,"Options",true,function()return true end).MouseButton1Click:connect(function()
  4158.        
  4159.     end)
  4160.    
  4161.  
  4162.     -- DELETE
  4163.     makeButton(ACTION_DELETE,ACTION_DELETE_OVER,"Delete",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
  4164.         if not Option.Modifiable then return end
  4165.         local list = Selection:Get()
  4166.         for i = 1,#list do
  4167.             pcall(delete,list[i])
  4168.         end
  4169.         Selection:Set({})
  4170.     end)
  4171.    
  4172.     -- PASTE
  4173.     makeButton(ACTION_PASTE,ACTION_PASTE_OVER,"Paste",true,function() return #Selection:Get() > 0 and #clipboard > 0 end).MouseButton1Click:connect(function()
  4174.         if not Option.Modifiable then return end
  4175.         local parent = Selection.List[1] or workspace
  4176.         for i = 1,#clipboard do
  4177.             clipboard[i]:Clone().Parent = parent
  4178.         end
  4179.     end)
  4180.    
  4181.     -- COPY
  4182.     makeButton(ACTION_COPY,ACTION_COPY_OVER,"Copy",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
  4183.         if not Option.Modifiable then return end
  4184.         clipboard = {}
  4185.         local list = Selection.List
  4186.         for i = 1,#list do
  4187.             table.insert(clipboard,list[i]:Clone())
  4188.         end
  4189.         updateActions()
  4190.     end)
  4191.    
  4192.     -- CUT
  4193.     makeButton(ACTION_CUT,ACTION_CUT_OVER,"Cut",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
  4194.         if not Option.Modifiable then return end
  4195.         clipboard = {}
  4196.         local list = Selection.List
  4197.         local cut = {}
  4198.         for i = 1,#list do
  4199.             local obj = list[i]:Clone()
  4200.             if obj then
  4201.                 table.insert(clipboard,obj)
  4202.                 table.insert(cut,list[i])
  4203.             end
  4204.         end
  4205.         for i = 1,#cut do
  4206.             pcall(delete,cut[i])
  4207.         end
  4208.         updateActions()
  4209.     end)
  4210.    
  4211.     -- FREEZE
  4212.     makeButton(ACTION_FREEZE,ACTION_FREEZE,"Freeze",true,function() return true end)
  4213.    
  4214.     -- ADD/REMOVE STARRED
  4215.     makeButton(ACTION_ADDSTAR,ACTION_ADDSTAR_OVER,"Star",true,function() return #Selection:Get() > 0 end)
  4216.    
  4217.     -- STARRED
  4218.     makeButton(ACTION_STARRED,ACTION_STARRED,"Starred",true,function() return true end)
  4219.  
  4220.  
  4221.     -- SORT
  4222.     -- local actionSort = makeButton(ACTION_SORT,ACTION_SORT_OVER,"Sort")
  4223. end
  4224.  
  4225. ----------------------------------------------------------------
  4226. ----------------------------------------------------------------
  4227. ----------------------------------------------------------------
  4228. ----------------------------------------------------------------
  4229. ---- Option Bindables
  4230.  
  4231. do
  4232.     local optionCallback = {
  4233.         Modifiable = function(value)
  4234.             for i = 1,#actionButtons do
  4235.                 actionButtons[i].Obj.Visible = value and Option.Selectable
  4236.             end
  4237.             cancelReparentDrag()
  4238.         end;
  4239.         Selectable = function(value)
  4240.             for i = 1,#actionButtons do
  4241.                 actionButtons[i].Obj.Visible = value and Option.Modifiable
  4242.             end
  4243.             cancelSelectDrag()
  4244.             Selection:Set({})
  4245.         end;
  4246.     }
  4247.  
  4248.     local bindSetOption = explorerPanel:FindFirstChild("SetOption")
  4249.     if not bindSetOption then
  4250.         bindSetOption = Create('BindableFunction',{Name = "SetOption"})
  4251.         bindSetOption.Parent = explorerPanel
  4252.     end
  4253.  
  4254.     bindSetOption.OnInvoke = function(optionName,value)
  4255.         if optionCallback[optionName] then
  4256.             Option[optionName] = value
  4257.             optionCallback[optionName](value)
  4258.         end
  4259.     end
  4260.  
  4261.     local bindGetOption = explorerPanel:FindFirstChild("GetOption")
  4262.     if not bindGetOption then
  4263.         bindGetOption = Create('BindableFunction',{Name = "GetOption"})
  4264.         bindGetOption.Parent = explorerPanel
  4265.     end
  4266.  
  4267.     bindGetOption.OnInvoke = function(optionName)
  4268.         if optionName then
  4269.             return Option[optionName]
  4270.         else
  4271.             local options = {}
  4272.             for k,v in pairs(Option) do
  4273.                 options[k] = v
  4274.             end
  4275.             return options
  4276.         end
  4277.     end
  4278. end
  4279.  
  4280. function SelectionVar()
  4281.     return Selection
  4282. end
  4283.  
  4284. Input.InputBegan:connect(function(key)
  4285.     if key.KeyCode == Enum.KeyCode.LeftControl then
  4286.         HoldingCtrl = true
  4287.     end
  4288.     if key.KeyCode == Enum.KeyCode.LeftShift then
  4289.         HoldingShift = true
  4290.     end
  4291. end)
  4292.  
  4293. Input.InputEnded:connect(function(key)
  4294.     if key.KeyCode == Enum.KeyCode.LeftControl then
  4295.         HoldingCtrl = false
  4296.     end
  4297.     if key.KeyCode == Enum.KeyCode.LeftShift then
  4298.         HoldingShift = false
  4299.     end
  4300. end)
  4301.  
  4302. while RbxApi == nil do
  4303.     RbxApi = GetApiRemote:Invoke()
  4304.     wait()
  4305. end
  4306.  
  4307. explorerFilter.Changed:connect(function(prop)
  4308.     if prop == "Text" then
  4309.         rawUpdateList()
  4310.     end
  4311. end)
  4312.  
  4313. CurrentInsertObjectWindow = CreateInsertObjectMenu(
  4314.     GetClasses(),
  4315.     "",
  4316.     false,
  4317.     function(option)
  4318.         CurrentInsertObjectWindow.Visible = false
  4319.         local list = SelectionVar():Get()
  4320.         for i = 1,#list do
  4321.             pcall(function() Instance.new(option,list[i]) end)
  4322.         end
  4323.         DestroyRightClick()
  4324.     end
  4325. )
  4326. end)
  4327.  
  4328. spawn(function()
  4329.     --[[
  4330.    
  4331. Change log:
  4332.  
  4333. 09/18
  4334.     Fixed checkbox mouseover sprite
  4335.     Encapsulated checkbox creation into separate method
  4336.     Fixed another checkbox issue
  4337.  
  4338. 09/15
  4339.     Invalid input is ignored instead of setting to default of that data type
  4340.     Consolidated control methods and simplified them
  4341.     All input goes through ToValue method
  4342.     Fixed position of BrickColor palette
  4343.     Made DropDown appear above row if it would otherwise exceed the page height
  4344.     Cleaned up stylesheets
  4345.  
  4346. 09/14
  4347.     Made properties window scroll when mouse wheel scrolled
  4348.     Object/Instance and Color3 data types handled properly
  4349.     Multiple BrickColor controls interfering with each other fixed
  4350.     Added support for Content data type
  4351.    
  4352. --]]
  4353.  
  4354. wait(0.2)
  4355.  
  4356. local print = function(s)
  4357.     print(tostring(s))
  4358. end
  4359.  
  4360. -- Services
  4361. local Teams = game:GetService("Teams")
  4362. local Workspace = game:GetService("Workspace")
  4363. local Debris = game:GetService("Debris")
  4364. local ContentProvider = game:GetService("ContentProvider")
  4365. local Players = game:GetService("Players")
  4366. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  4367.  
  4368. -- Functions
  4369. function httpGet(url)
  4370.     return game:HttpGet(url,true)
  4371. end
  4372.  
  4373. -- RbxApi Stuff
  4374.  
  4375. local apiUrl = "http://anaminus.github.io/rbx/json/api/latest.json"
  4376. local maxChunkSize = 100 * 1000
  4377. local ApiJson = ""
  4378.  
  4379. function getLocalApiJson()
  4380.     local rawApiJson = require(ApiJson)()
  4381.     return rawApiJson
  4382. end
  4383.  
  4384. function getCurrentApiJson()
  4385.     if true then return Synapse:DownloadString("http://anaminus.github.io/rbx/json/api/latest.json") end
  4386.     local jsonStr = nil
  4387.     if readfile and getelysianpath then
  4388.         if readfile(getelysianpath().."Xpl0rerApi.txt") then
  4389.             print("Api found in folder!")
  4390.             jsonStr = readfile(getelysianpath().."Xpl0rerApi.txt")
  4391.             return jsonStr
  4392.         end
  4393.     end
  4394.     local success, err = pcall(function()
  4395.         jsonStr = httpGet(apiUrl)
  4396.         print("Fetched json successfully")
  4397.     end)
  4398.     if success then
  4399.         print("Returning json")
  4400.         --print(jsonStr:sub(1,500))
  4401.         return jsonStr
  4402.     else
  4403.         print("Error fetching json: " .. tostring(err))
  4404.         print("Falling back to local copy")
  4405.         return getLocalApiJson()
  4406.     end
  4407. end
  4408.  
  4409. function splitStringIntoChunks(jsonStr)
  4410.     -- Splits up a string into a table with a given size
  4411.     local t = {}
  4412.     for i = 1, math.ceil(string.len(jsonStr)/maxChunkSize) do
  4413.         local str = jsonStr:sub((i-1)*maxChunkSize+1, i*maxChunkSize)
  4414.         table.insert(t, str)
  4415.     end
  4416.     return t
  4417. end
  4418.  
  4419. local jsonToParse = getCurrentApiJson()
  4420. local apiChunks = splitStringIntoChunks(jsonToParse)
  4421.  
  4422. function getRbxApi()
  4423. --[[
  4424.     Api.Classes
  4425.     Api.Enums
  4426.     Api.GetProperties(className)
  4427.     Api.IsEnum(valueType)
  4428. --]]
  4429.  
  4430. -- Services
  4431. local HttpService = game:GetService("HttpService")
  4432. local ServerStorage = game:GetService("ServerStorage")
  4433. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  4434.  
  4435. -- Remotes
  4436. --local Remotes = ReplicatedStorage:WaitForChild("OnlineStudio"):WaitForChild("Remotes")
  4437. --local GetApiJsonFunction = Remotes:WaitForChild("GetApiJson")
  4438.  
  4439. -- Functions
  4440. local JsonDecode = function(s) return HttpService:JSONDecode(s) end
  4441.  
  4442. local function GetApiRemoteFunction(index)
  4443.     if (apiChunks[index]) then
  4444.         return apiChunks[index], #apiChunks
  4445.     else
  4446.         print("Bad index for GetApiJson")
  4447.         return nil
  4448.     end
  4449. end
  4450.  
  4451. local function getApiJson()
  4452.     local apiTable = {}
  4453.     local firstPage, pageCount = GetApiRemoteFunction(1)
  4454.     table.insert(apiTable, firstPage)
  4455.     for i = 2, pageCount do
  4456.         --print("Fetching API page # " .. tostring(i))
  4457.         local result = GetApiRemoteFunction(i)
  4458.         table.insert(apiTable, result)
  4459.     end
  4460.     return table.concat(apiTable)
  4461. end
  4462.  
  4463. local json = getApiJson()
  4464. local apiDump =  JsonDecode(json)
  4465.  
  4466. local Classes = {}
  4467. local Enums = {}
  4468.  
  4469. local function sortAlphabetic(t, property)
  4470.     table.sort(t,
  4471.         function(x,y) return x[property] < y[property]
  4472.     end)
  4473. end
  4474.  
  4475. local function isEnum(name)
  4476.     return Enums[name] ~= nil
  4477. end
  4478.  
  4479. local function getProperties(className)
  4480.     local class = Classes[className]
  4481.     local properties = {}
  4482.    
  4483.     if not class then return properties end
  4484.    
  4485.     while class do
  4486.         for _,property in pairs(class.Properties) do
  4487.             table.insert(properties, property)
  4488.         end
  4489.         class = Classes[class.Superclass]
  4490.     end
  4491.    
  4492.     sortAlphabetic(properties, "Name")
  4493.  
  4494.     return properties
  4495. end
  4496.  
  4497. for _,item in pairs(apiDump) do
  4498.     local itemType = item.type
  4499. -- Classes --
  4500.     if (itemType == 'Class') then
  4501.         Classes[item.Name] = item
  4502.         item.Properties = {}
  4503.         item.Functions = {}
  4504.         item.YieldFunctions = {}
  4505.         item.Events = {}
  4506.         item.Callbacks = {}
  4507. -- Members --
  4508.     elseif (itemType == 'Property') then
  4509.         table.insert(Classes[item.Class].Properties, item)
  4510.     elseif (itemType == 'Function') then
  4511.         table.insert(Classes[item.Class].Functions, item)
  4512.     elseif (itemType == 'YieldFunction') then
  4513.         table.insert(Classes[item.Class].YieldFunctions, item)
  4514.     elseif (itemType == 'Event') then
  4515.         table.insert(Classes[item.Class].Events, item)
  4516.     elseif (itemType == 'Callback') then
  4517.         table.insert(Classes[item.Class].Callbacks, item)
  4518. -- Enums --
  4519.     elseif (itemType == 'Enum') then
  4520.         Enums[item.Name] = item
  4521.         item.EnumItems = {}
  4522.     elseif (itemType == 'EnumItem') then
  4523.         Enums[item.Enum].EnumItems[item.Name] = item
  4524.     end
  4525. end
  4526.  
  4527. return {
  4528.     Classes = Classes;
  4529.     Enums = Enums;
  4530.     GetProperties = getProperties;
  4531.     IsEnum = isEnum;
  4532. }
  4533. end
  4534.  
  4535. -- Modules
  4536. local Permissions = {CanEdit = true}
  4537. local RbxApi = getRbxApi()
  4538.  
  4539. --[[
  4540.     RbxApi.Classes
  4541.     RbxApi.Enums
  4542.     RbxApi.GetProperties(className)
  4543.     RbxApi.IsEnum(valueType)
  4544. --]]
  4545.  
  4546. -- Styles
  4547.  
  4548. local function CreateColor3(r, g, b) return Color3.new(r/255,g/255,b/255) end
  4549.  
  4550. local Styles = {
  4551.     Font = Enum.Font.Arial;
  4552.     Margin = 5;
  4553.     Black = CreateColor3(0,0,0);
  4554.     White = CreateColor3(255,255,255);
  4555. }
  4556.  
  4557. local Row = {
  4558.     Font = Styles.Font;
  4559.     FontSize = Enum.FontSize.Size14;
  4560.     TextXAlignment = Enum.TextXAlignment.Left;
  4561.     TextColor = Styles.Black;
  4562.     TextColorOver = Styles.White;
  4563.     TextLockedColor = CreateColor3(120,120,120);
  4564.     Height = 24;
  4565.     BorderColor = CreateColor3(216,216,216);
  4566.     BackgroundColor = Styles.White;
  4567.     BackgroundColorAlternate = CreateColor3(246,246,246);
  4568.     BackgroundColorMouseover = CreateColor3(211,224,244);
  4569.     TitleMarginLeft = 15;
  4570. }
  4571.  
  4572. local DropDown = {
  4573.     Font = Styles.Font;
  4574.     FontSize = Enum.FontSize.Size14;
  4575.     TextColor = CreateColor3(0,0,0);
  4576.     TextColorOver = Styles.White;
  4577.     TextXAlignment = Enum.TextXAlignment.Left;
  4578.     Height = 16;
  4579.     BackColor = Styles.White;
  4580.     BackColorOver = CreateColor3(86,125,188);
  4581.     BorderColor = CreateColor3(216,216,216);
  4582.     BorderSizePixel = 2;
  4583.     ArrowColor = CreateColor3(160,160,160);
  4584.     ArrowColorOver = Styles.Black;
  4585. }
  4586.  
  4587. local BrickColors = {
  4588.     BoxSize = 13;
  4589.     BorderSizePixel = 1;
  4590.     BorderColor = CreateColor3(160,160,160);
  4591.     FrameColor = CreateColor3(160,160,160);
  4592.     Size = 20;
  4593.     Padding = 4;
  4594.     ColorsPerRow = 8;
  4595.     OuterBorder = 1;
  4596.     OuterBorderColor = Styles.Black;
  4597. }
  4598.  
  4599. wait(1)
  4600.  
  4601. local Gui = D_E_X
  4602. local PropertiesFrame = Gui:WaitForChild("PropertiesFrame")
  4603. local ExplorerFrame = Gui:WaitForChild("ExplorerPanel")
  4604.  
  4605. local bindGetSelection = ExplorerFrame.GetSelection
  4606. local bindSelectionChanged = ExplorerFrame.SelectionChanged
  4607. local bindGetApi = PropertiesFrame.GetApi
  4608. local bindGetAwait = PropertiesFrame.GetAwaiting
  4609. local bindSetAwait = PropertiesFrame.SetAwaiting
  4610.  
  4611. local ContentUrl = ContentProvider.BaseUrl .. "asset/?id="
  4612.  
  4613. local SettingsRemote = Gui:WaitForChild("SettingsPanel"):WaitForChild("GetSetting")
  4614.  
  4615. local propertiesSearch = PropertiesFrame.Header.TextBox
  4616.  
  4617. local AwaitingObjectValue = false
  4618. local AwaitingObjectObj
  4619. local AwaitingObjectProp
  4620.  
  4621. function searchingProperties()
  4622.     if propertiesSearch.Text ~= "" and propertiesSearch.Text ~= "Search Properties" then
  4623.         return true
  4624.     end
  4625.     return false
  4626. end
  4627.  
  4628. local function GetSelection()
  4629.     local selection = bindGetSelection:Invoke()
  4630.     if #selection == 0 then
  4631.         return nil
  4632.     else
  4633.         return selection
  4634.     end
  4635. end
  4636.  
  4637. -- Number
  4638.  
  4639. local function Round(number, decimalPlaces)
  4640.     return tonumber(string.format("%." .. (decimalPlaces or 0) .. "f", number))
  4641. end
  4642.  
  4643. -- Strings
  4644.  
  4645. local function Split(str, delimiter)
  4646.     local start = 1
  4647.     local t = {}
  4648.     while true do
  4649.         local pos = string.find (str, delimiter, start, true)
  4650.         if not pos then
  4651.             break
  4652.         end
  4653.         table.insert (t, string.sub (str, start, pos - 1))
  4654.         start = pos + string.len (delimiter)
  4655.     end
  4656.     table.insert (t, string.sub (str, start))
  4657.     return t
  4658. end
  4659.  
  4660. -- Data Type Handling
  4661.  
  4662. local function ToString(value, type)
  4663.     if type == "float" then
  4664.         return tostring(Round(value,2))
  4665.     elseif type == "Content" then
  4666.         if string.find(value,"/asset") then
  4667.             local match = string.find(value, "=") + 1
  4668.             local id = string.sub(value, match)
  4669.             return id
  4670.         else
  4671.             return tostring(value)
  4672.         end
  4673.     elseif type == "Vector2" then
  4674.         local x = value.x
  4675.         local y = value.y
  4676.         return string.format("%g, %g", x,y)
  4677.     elseif type == "Vector3" then
  4678.         local x = value.x
  4679.         local y = value.y
  4680.         local z = value.z
  4681.         return string.format("%g, %g, %g", x,y,z)
  4682.     elseif type == "Color3" then
  4683.         local r = value.r
  4684.         local g = value.g
  4685.         local b = value.b
  4686.         return string.format("%d, %d, %d", r*255,g*255,b*255)
  4687.     elseif type == "UDim2" then
  4688.         local xScale = value.X.Scale
  4689.         local xOffset = value.X.Offset
  4690.         local yScale = value.Y.Scale
  4691.         local yOffset = value.Y.Offset
  4692.         return string.format("{%d, %d}, {%d, %d}", xScale, xOffset, yScale, yOffset)
  4693.     else
  4694.         return tostring(value)
  4695.     end
  4696. end
  4697.  
  4698. local function ToValue(value,type)
  4699.     if type == "Vector2" then
  4700.         local list = Split(value,",")
  4701.         if #list < 2 then return nil end
  4702.         local x = tonumber(list[1]) or 0
  4703.         local y = tonumber(list[2]) or 0
  4704.         return Vector2.new(x,y)
  4705.     elseif type == "Vector3" then
  4706.         local list = Split(value,",")
  4707.         if #list < 3 then return nil end
  4708.         local x = tonumber(list[1]) or 0
  4709.         local y = tonumber(list[2]) or 0
  4710.         local z = tonumber(list[3]) or 0
  4711.         return Vector3.new(x,y,z)
  4712.     elseif type == "Color3" then
  4713.         local list = Split(value,",")
  4714.         if #list < 3 then return nil end
  4715.         local r = tonumber(list[1]) or 0
  4716.         local g = tonumber(list[2]) or 0
  4717.         local b = tonumber(list[3]) or 0
  4718.         return Color3.new(r/255,g/255, b/255)
  4719.     elseif type == "UDim2" then
  4720.         local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
  4721.         if #list < 4 then return nil end
  4722.         local xScale = tonumber(list[1]) or 0
  4723.         local xOffset = tonumber(list[2]) or 0
  4724.         local yScale = tonumber(list[3]) or 0
  4725.         local yOffset = tonumber(list[4]) or 0
  4726.         return UDim2.new(xScale, xOffset, yScale, yOffset)
  4727.     elseif type == "Content" then
  4728.         if tonumber(value) ~= nil then
  4729.             value = ContentUrl .. value
  4730.         end
  4731.         return value
  4732.     elseif type == "float" or type == "int" or type == "double" then
  4733.         return tonumber(value)
  4734.     elseif type == "string" then
  4735.         return value
  4736.     elseif type == "NumberRange" then
  4737.         local list = Split(value,",")
  4738.         if #list == 1 then
  4739.             if tonumber(list[1]) == nil then return nil end
  4740.             local newVal = tonumber(list[1]) or 0
  4741.             return NumberRange.new(newVal)
  4742.         end
  4743.         if #list < 2 then return nil end
  4744.         local x = tonumber(list[1]) or 0
  4745.         local y = tonumber(list[2]) or 0
  4746.         return NumberRange.new(x,y)
  4747.     else
  4748.         return nil
  4749.     end
  4750. end
  4751.  
  4752.  
  4753. -- Tables
  4754.  
  4755. local function CopyTable(T)
  4756.   local t2 = {}
  4757.   for k,v in pairs(T) do
  4758.     t2[k] = v
  4759.   end
  4760.   return t2
  4761. end
  4762.  
  4763. local function SortTable(T)
  4764.     table.sort(T,
  4765.         function(x,y) return x.Name < y.Name
  4766.     end)
  4767. end
  4768.  
  4769. -- Spritesheet
  4770. local Sprite = {
  4771.     Width = 13;
  4772.     Height = 13;
  4773. }
  4774.  
  4775. local Spritesheet = {
  4776.     Image = "http://www.roblox.com/asset/?id=128896947";
  4777.     Height = 256;
  4778.     Width = 256;
  4779. }
  4780.  
  4781. local Images = {
  4782.     "unchecked",
  4783.     "checked",
  4784.     "unchecked_over",
  4785.     "checked_over",
  4786.     "unchecked_disabled",
  4787.     "checked_disabled"
  4788. }
  4789.  
  4790. local function SpritePosition(spriteName)
  4791.     local x = 0
  4792.     local y = 0
  4793.     for i,v in pairs(Images) do
  4794.         if (v == spriteName) then
  4795.             return {x, y}
  4796.         end
  4797.         x = x + Sprite.Height
  4798.         if (x + Sprite.Width) > Spritesheet.Width then
  4799.             x = 0
  4800.             y = y + Sprite.Height
  4801.         end
  4802.     end
  4803. end
  4804.  
  4805. local function GetCheckboxImageName(checked, readOnly, mouseover)
  4806.     if checked then
  4807.         if readOnly then
  4808.             return "checked_disabled"
  4809.         elseif mouseover then
  4810.             return "checked_over"
  4811.         else
  4812.             return "checked"
  4813.         end
  4814.     else
  4815.         if readOnly then
  4816.             return "unchecked_disabled"
  4817.         elseif mouseover then
  4818.             return "unchecked_over"
  4819.         else
  4820.             return "unchecked"
  4821.         end
  4822.     end
  4823. end
  4824.  
  4825. local MAP_ID = 418720155
  4826.  
  4827. -- Gui Controls --
  4828.  
  4829. ---- IconMap ----
  4830. -- Image size: 256px x 256px
  4831. -- Icon size: 16px x 16px
  4832. -- Padding between each icon: 2px
  4833. -- Padding around image edge: 1px
  4834. -- Total icons: 14 x 14 (196)
  4835. local Icon do
  4836.     local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID
  4837.     game:GetService('ContentProvider'):Preload(iconMap)
  4838.     local iconDehash do
  4839.         -- 14 x 14, 0-based input, 0-based output
  4840.         local f=math.floor
  4841.         function iconDehash(h)
  4842.             return f(h/14%14),f(h%14)
  4843.         end
  4844.     end
  4845.  
  4846.     function Icon(IconFrame,index)
  4847.         local row,col = iconDehash(index)
  4848.         local mapSize = Vector2.new(256,256)
  4849.         local pad,border = 2,1
  4850.         local iconSize = 16
  4851.  
  4852.         local class = 'Frame'
  4853.         if type(IconFrame) == 'string' then
  4854.             class = IconFrame
  4855.             IconFrame = nil
  4856.         end
  4857.  
  4858.         if not IconFrame then
  4859.             IconFrame = Create(class,{
  4860.                 Name = "Icon";
  4861.                 BackgroundTransparency = 1;
  4862.                 ClipsDescendants = true;
  4863.                 Create('ImageLabel',{
  4864.                     Name = "IconMap";
  4865.                     Active = false;
  4866.                     BackgroundTransparency = 1;
  4867.                     Image = iconMap;
  4868.                     Size = UDim2.new(mapSize.x/iconSize,0,mapSize.y/iconSize,0);
  4869.                 });
  4870.             })
  4871.         end
  4872.  
  4873.         IconFrame.IconMap.Position = UDim2.new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0)
  4874.         return IconFrame
  4875.     end
  4876. end
  4877.  
  4878. local function CreateCell()
  4879.     local tableCell = Instance.new("Frame")
  4880.     tableCell.Size = UDim2.new(0.5, -1, 1, 0)
  4881.     tableCell.BackgroundColor3 = Row.BackgroundColor
  4882.     tableCell.BorderColor3 = Row.BorderColor
  4883.     return tableCell
  4884. end
  4885.    
  4886. local function CreateLabel(readOnly)
  4887.     local label = Instance.new("TextLabel")
  4888.     label.Font = Row.Font
  4889.     label.FontSize = Row.FontSize
  4890.     label.TextXAlignment = Row.TextXAlignment
  4891.     label.BackgroundTransparency = 1
  4892.    
  4893.     if readOnly then
  4894.         label.TextColor3 = Row.TextLockedColor
  4895.     else
  4896.         label.TextColor3 = Row.TextColor
  4897.     end
  4898.     return label
  4899. end
  4900.  
  4901. local function CreateTextButton(readOnly, onClick)
  4902.     local button = Instance.new("TextButton")
  4903.     button.Font = Row.Font
  4904.     button.FontSize = Row.FontSize
  4905.     button.TextXAlignment = Row.TextXAlignment
  4906.     button.BackgroundTransparency = 1
  4907.     if readOnly then
  4908.         button.TextColor3 = Row.TextLockedColor
  4909.     else
  4910.         button.TextColor3 = Row.TextColor
  4911.         button.MouseButton1Click:connect(function()
  4912.             onClick()
  4913.         end)
  4914.     end
  4915.     return button
  4916. end
  4917.  
  4918. local function CreateObject(readOnly)
  4919.     local button = Instance.new("TextButton")
  4920.     button.Font = Row.Font
  4921.     button.FontSize = Row.FontSize
  4922.     button.TextXAlignment = Row.TextXAlignment
  4923.     button.BackgroundTransparency = 1
  4924.     if readOnly then
  4925.         button.TextColor3 = Row.TextLockedColor
  4926.     else
  4927.         button.TextColor3 = Row.TextColor
  4928.     end
  4929.     local cancel = Create(Icon('ImageButton',177),{
  4930.         Name = "Cancel";
  4931.         Visible = false;
  4932.         Position = UDim2.new(1,-20,0,0);
  4933.         Size = UDim2.new(0,20,0,20);
  4934.         Parent = button;
  4935.     })
  4936.     return button
  4937. end
  4938.  
  4939. local function CreateTextBox(readOnly)
  4940.     if readOnly then
  4941.         local box = CreateLabel(readOnly)
  4942.         return box
  4943.     else
  4944.         local box = Instance.new("TextBox")
  4945.         if not SettingsRemote:Invoke("ClearProps") then
  4946.             box.ClearTextOnFocus = false
  4947.         end
  4948.         box.Font = Row.Font
  4949.         box.FontSize = Row.FontSize
  4950.         box.TextXAlignment = Row.TextXAlignment
  4951.         box.BackgroundTransparency = 1
  4952.         box.TextColor3 = Row.TextColor
  4953.         return box
  4954.     end
  4955. end
  4956.  
  4957. local function CreateDropDownItem(text, onClick)
  4958.     local button = Instance.new("TextButton")
  4959.     button.Font = DropDown.Font
  4960.     button.FontSize = DropDown.FontSize
  4961.     button.TextColor3 = DropDown.TextColor
  4962.     button.TextXAlignment = DropDown.TextXAlignment
  4963.     button.BackgroundColor3 = DropDown.BackColor
  4964.     button.AutoButtonColor = false
  4965.     button.BorderSizePixel = 0
  4966.     button.Active = true
  4967.     button.Text = text
  4968.    
  4969.     button.MouseEnter:connect(function()
  4970.         button.TextColor3 = DropDown.TextColorOver
  4971.         button.BackgroundColor3 = DropDown.BackColorOver
  4972.     end)
  4973.     button.MouseLeave:connect(function()
  4974.         button.TextColor3 = DropDown.TextColor
  4975.         button.BackgroundColor3 = DropDown.BackColor
  4976.     end)
  4977.     button.MouseButton1Click:connect(function()
  4978.         onClick(text)
  4979.     end)   
  4980.     return button
  4981. end
  4982.  
  4983. local function CreateDropDown(choices, currentChoice, readOnly, onClick)
  4984.     local frame = Instance.new("Frame")
  4985.     frame.Name = "DropDown"
  4986.     frame.Size = UDim2.new(1, 0, 1, 0)
  4987.     frame.BackgroundTransparency = 1
  4988.     frame.Active = true
  4989.    
  4990.     local menu = nil
  4991.     local arrow = nil
  4992.     local expanded = false
  4993.     local margin = DropDown.BorderSizePixel;
  4994.    
  4995.     local button = Instance.new("TextButton")
  4996.     button.Font = Row.Font
  4997.     button.FontSize = Row.FontSize
  4998.     button.TextXAlignment = Row.TextXAlignment
  4999.     button.BackgroundTransparency = 1
  5000.     button.TextColor3 = Row.TextColor
  5001.     if readOnly then
  5002.         button.TextColor3 = Row.TextLockedColor
  5003.     end
  5004.     button.Text = currentChoice
  5005.     button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
  5006.     button.Position = UDim2.new(0, Styles.Margin, 0, 0)
  5007.     button.Parent = frame
  5008.    
  5009.     local function showArrow(color)
  5010.         if arrow then arrow:Destroy() end
  5011.        
  5012.         local graphicTemplate = Create('Frame',{
  5013.             Name="Graphic";
  5014.             BorderSizePixel = 0;
  5015.             BackgroundColor3 = color;
  5016.         })
  5017.         local graphicSize = 16/2
  5018.        
  5019.         arrow = ArrowGraphic(graphicSize,'Down',true,graphicTemplate)
  5020.         arrow.Position = UDim2.new(1,-graphicSize * 2,0.5,-graphicSize/2)
  5021.         arrow.Parent = frame
  5022.     end
  5023.    
  5024.     local function hideMenu()
  5025.         expanded = false
  5026.         showArrow(DropDown.ArrowColor)
  5027.         if menu then menu:Destroy() end
  5028.     end
  5029.    
  5030.     local function showMenu()
  5031.         expanded = true
  5032.         menu = Instance.new("Frame")
  5033.         menu.Size = UDim2.new(1, -2 * margin, 0, #choices * DropDown.Height)
  5034.         menu.Position = UDim2.new(0, margin, 0, Row.Height + margin)
  5035.         menu.BackgroundTransparency = 0
  5036.         menu.BackgroundColor3 = DropDown.BackColor
  5037.         menu.BorderColor3 = DropDown.BorderColor
  5038.         menu.BorderSizePixel = DropDown.BorderSizePixel
  5039.         menu.Active = true
  5040.         menu.ZIndex = 5
  5041.         menu.Parent = frame
  5042.        
  5043.         local parentFrameHeight = menu.Parent.Parent.Parent.Parent.Size.Y.Offset
  5044.         local rowHeight = menu.Parent.Parent.Parent.Position.Y.Offset
  5045.         if (rowHeight + menu.Size.Y.Offset) > math.max(parentFrameHeight,PropertiesFrame.AbsoluteSize.y) then
  5046.             menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
  5047.         end
  5048.            
  5049.         local function choice(name)
  5050.             onClick(name)
  5051.             hideMenu()
  5052.         end
  5053.        
  5054.         for i,name in pairs(choices) do
  5055.             local option = CreateDropDownItem(name, function()
  5056.                 choice(name)
  5057.             end)
  5058.             option.Size = UDim2.new(1, 0, 0, 16)
  5059.             option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
  5060.             option.ZIndex = menu.ZIndex
  5061.             option.Parent = menu
  5062.         end
  5063.     end
  5064.    
  5065.     showArrow(DropDown.ArrowColor)
  5066.    
  5067.     if not readOnly then
  5068.        
  5069.         button.MouseEnter:connect(function()
  5070.             button.TextColor3 = Row.TextColor
  5071.             showArrow(DropDown.ArrowColorOver)
  5072.         end)
  5073.         button.MouseLeave:connect(function()
  5074.             button.TextColor3 = Row.TextColor
  5075.             if not expanded then
  5076.                 showArrow(DropDown.ArrowColor)
  5077.             end
  5078.         end)
  5079.         button.MouseButton1Click:connect(function()
  5080.             if expanded then
  5081.                 hideMenu()
  5082.             else
  5083.                 showMenu()
  5084.             end
  5085.         end)
  5086.     end
  5087.    
  5088.     return frame,button
  5089. end
  5090.  
  5091. local function CreateBrickColor(readOnly, onClick)
  5092.     local frame = Instance.new("Frame")
  5093.     frame.Size = UDim2.new(1,0,1,0)
  5094.     frame.BackgroundTransparency = 1
  5095.    
  5096.     local colorPalette = Instance.new("Frame")
  5097.     colorPalette.BackgroundTransparency = 0
  5098.     colorPalette.SizeConstraint = Enum.SizeConstraint.RelativeXX
  5099.     colorPalette.Size = UDim2.new(1, -2 * BrickColors.OuterBorder, 1, -2 * BrickColors.OuterBorder)
  5100.     colorPalette.BorderSizePixel = BrickColors.BorderSizePixel
  5101.     colorPalette.BorderColor3 = BrickColors.BorderColor
  5102.     colorPalette.Position = UDim2.new(0, BrickColors.OuterBorder, 0, BrickColors.OuterBorder + Row.Height)
  5103.     colorPalette.ZIndex = 5
  5104.     colorPalette.Visible = false
  5105.     colorPalette.BorderSizePixel = BrickColors.OuterBorder
  5106.     colorPalette.BorderColor3 = BrickColors.OuterBorderColor
  5107.     colorPalette.Parent = frame
  5108.    
  5109.     local function show()
  5110.         colorPalette.Visible = true
  5111.     end
  5112.    
  5113.     local function hide()
  5114.         colorPalette.Visible = false
  5115.     end
  5116.    
  5117.     local function toggle()
  5118.         colorPalette.Visible = not colorPalette.Visible
  5119.     end
  5120.    
  5121.     local colorBox = Instance.new("TextButton", frame)
  5122.     colorBox.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin)
  5123.     colorBox.Size = UDim2.new(0, BrickColors.BoxSize, 0, BrickColors.BoxSize)
  5124.     colorBox.Text = ""
  5125.     colorBox.MouseButton1Click:connect(function()
  5126.         if not readOnly then
  5127.             toggle()
  5128.         end
  5129.     end)
  5130.    
  5131.     if readOnly then
  5132.         colorBox.AutoButtonColor = false
  5133.     end
  5134.    
  5135.     local spacingBefore = (Styles.Margin * 2) + BrickColors.BoxSize
  5136.    
  5137.     local propertyLabel = CreateTextButton(readOnly, function()
  5138.         if not readOnly then
  5139.             toggle()
  5140.         end
  5141.     end)
  5142.     propertyLabel.Size = UDim2.new(1, (-1 * spacingBefore) - Styles.Margin, 1, 0)
  5143.     propertyLabel.Position = UDim2.new(0, spacingBefore, 0, 0)
  5144.     propertyLabel.Parent = frame
  5145.    
  5146.     local size = (1 / BrickColors.ColorsPerRow)
  5147.    
  5148.     for index = 0, 127 do
  5149.         local brickColor = BrickColor.palette(index)
  5150.         local color3 = brickColor.Color
  5151.        
  5152.         local x = size * (index % BrickColors.ColorsPerRow)
  5153.         local y = size * math.floor(index / BrickColors.ColorsPerRow)
  5154.    
  5155.         local brickColorBox = Instance.new("TextButton")
  5156.         brickColorBox.Text = ""
  5157.         brickColorBox.Size = UDim2.new(size,0,size,0)
  5158.         brickColorBox.BackgroundColor3 = color3
  5159.         brickColorBox.Position = UDim2.new(x, 0, y, 0)
  5160.         brickColorBox.ZIndex = colorPalette.ZIndex
  5161.         brickColorBox.Parent = colorPalette
  5162.    
  5163.         brickColorBox.MouseButton1Click:connect(function()
  5164.             hide()
  5165.             onClick(brickColor)
  5166.         end)
  5167.     end
  5168.    
  5169.     return frame,propertyLabel,colorBox
  5170. end
  5171.  
  5172. local function CreateColor3Control(readOnly, onClick)
  5173.     local frame = Instance.new("Frame")
  5174.     frame.Size = UDim2.new(1,0,1,0)
  5175.     frame.BackgroundTransparency = 1
  5176.    
  5177.     local colorBox = Instance.new("TextButton", frame)
  5178.     colorBox.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin)
  5179.     colorBox.Size = UDim2.new(0, BrickColors.BoxSize, 0, BrickColors.BoxSize)
  5180.     colorBox.Text = ""
  5181.     colorBox.AutoButtonColor = false
  5182.    
  5183.     local spacingBefore = (Styles.Margin * 2) + BrickColors.BoxSize
  5184.     local box = CreateTextBox(readOnly)
  5185.     box.Size = UDim2.new(1, (-1 * spacingBefore) - Styles.Margin, 1, 0)
  5186.     box.Position = UDim2.new(0, spacingBefore, 0, 0)
  5187.     box.Parent = frame
  5188.    
  5189.     return frame,box,colorBox
  5190. end
  5191.  
  5192. function CreateCheckbox(value, readOnly, onClick)
  5193.     local checked = value
  5194.     local mouseover = false
  5195.  
  5196.     local checkboxFrame = Instance.new("ImageButton")
  5197.     checkboxFrame.Size = UDim2.new(0, Sprite.Width, 0, Sprite.Height)
  5198.     checkboxFrame.BackgroundTransparency = 1
  5199.     checkboxFrame.ClipsDescendants = true
  5200.     --checkboxFrame.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin)
  5201.  
  5202.     local spritesheetImage = Instance.new("ImageLabel", checkboxFrame)
  5203.     spritesheetImage.Name = "SpritesheetImageLabel"
  5204.     spritesheetImage.Size = UDim2.new(0, Spritesheet.Width, 0, Spritesheet.Height)
  5205.     spritesheetImage.Image = Spritesheet.Image
  5206.     spritesheetImage.BackgroundTransparency = 1
  5207.    
  5208.     local function updateSprite()
  5209.         local spriteName = GetCheckboxImageName(checked, readOnly, mouseover)
  5210.         local spritePosition = SpritePosition(spriteName)
  5211.         spritesheetImage.Position = UDim2.new(0, -1 * spritePosition[1], 0, -1 * spritePosition[2])
  5212.     end
  5213.    
  5214.     local function setValue(val)
  5215.         checked = val
  5216.         updateSprite()
  5217.     end
  5218.  
  5219.     if not readOnly then
  5220.         checkboxFrame.MouseEnter:connect(function() mouseover = true updateSprite() end)
  5221.         checkboxFrame.MouseLeave:connect(function() mouseover = false updateSprite() end)
  5222.         checkboxFrame.MouseButton1Click:connect(function()
  5223.             onClick(checked)
  5224.         end)
  5225.     end
  5226.    
  5227.     updateSprite()
  5228.    
  5229.     return checkboxFrame, setValue
  5230. end
  5231.  
  5232.  
  5233.  
  5234. -- Code for handling controls of various data types --
  5235.  
  5236. local Controls = {}
  5237.  
  5238. Controls["default"] = function(object, propertyData, readOnly)
  5239.     local propertyName = propertyData["Name"]
  5240.     local propertyType = propertyData["ValueType"]
  5241.    
  5242.     local box = CreateTextBox(readOnly)
  5243.     box.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
  5244.     box.Position = UDim2.new(0, Styles.Margin, 0, 0)
  5245.  
  5246.     local function update()
  5247.         local value = object[propertyName]
  5248.         box.Text = ToString(value, propertyType)
  5249.     end
  5250.    
  5251.     if not readOnly then
  5252.         box.FocusLost:connect(function(enterPressed)
  5253.             Set(object, propertyData, ToValue(box.Text,propertyType))
  5254.             update()
  5255.         end)
  5256.     end
  5257.    
  5258.     update()
  5259.    
  5260.     object.Changed:connect(function(property)
  5261.         if (property == propertyName) then
  5262.             update()
  5263.         end
  5264.     end)
  5265.    
  5266.     return box
  5267. end
  5268.  
  5269. Controls["bool"] = function(object, propertyData, readOnly)
  5270.     local propertyName = propertyData["Name"]
  5271.     local checked = object[propertyName]
  5272.    
  5273.     local checkbox, setValue = CreateCheckbox(checked, readOnly, function(value)
  5274.         Set(object, propertyData, not checked)
  5275.     end)
  5276.     checkbox.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin)
  5277.    
  5278.     setValue(checked)
  5279.    
  5280.     local function update()
  5281.         checked = object[propertyName]
  5282.         setValue(checked)
  5283.     end
  5284.    
  5285.     object.Changed:connect(function(property)
  5286.         if (property == propertyName) then
  5287.             update()
  5288.         end
  5289.     end)
  5290.    
  5291.     if object:IsA("BoolValue") then
  5292.         object.Changed:connect(function(val)
  5293.             update()
  5294.         end)
  5295.     end
  5296.    
  5297.     update()
  5298.    
  5299.     return checkbox
  5300. end
  5301.  
  5302. Controls["BrickColor"] = function(object, propertyData, readOnly)
  5303.     local propertyName = propertyData["Name"]
  5304.  
  5305.     local frame,label,brickColorBox = CreateBrickColor(readOnly, function(brickColor)
  5306.         Set(object, propertyData, brickColor)
  5307.     end)
  5308.    
  5309.     local function update()
  5310.         local value = object[propertyName]
  5311.         brickColorBox.BackgroundColor3 = value.Color
  5312.         label.Text = tostring(value)
  5313.     end
  5314.    
  5315.     update()
  5316.    
  5317.     object.Changed:connect(function(property)
  5318.         if (property == propertyName) then
  5319.             update()
  5320.         end
  5321.     end)
  5322.    
  5323.     return frame
  5324. end
  5325.  
  5326. Controls["Color3"] = function(object, propertyData, readOnly)
  5327.     local propertyName = propertyData["Name"]
  5328.  
  5329.     local frame,textBox,colorBox = CreateColor3Control(readOnly)
  5330.    
  5331.     textBox.FocusLost:connect(function(enterPressed)
  5332.         Set(object, propertyData, ToValue(textBox.Text,"Color3"))
  5333.         local value = object[propertyName]
  5334.         colorBox.BackgroundColor3 = value
  5335.         textBox.Text = ToString(value, "Color3")
  5336.     end)
  5337.            
  5338.     local function update()
  5339.         local value = object[propertyName]
  5340.         colorBox.BackgroundColor3 = value
  5341.         textBox.Text = ToString(value, "Color3")
  5342.     end
  5343.    
  5344.     update()
  5345.    
  5346.     object.Changed:connect(function(property)
  5347.         if (property == propertyName) then
  5348.             update()
  5349.         end
  5350.     end)
  5351.    
  5352.     return frame
  5353. end
  5354.  
  5355. Controls["Enum"] = function(object, propertyData, readOnly)
  5356.     local propertyName = propertyData["Name"]
  5357.     local propertyType = propertyData["ValueType"]
  5358.    
  5359.     local enumName = object[propertyName].Name
  5360.    
  5361.     local enumNames = {}
  5362.     for _,enum in pairs(Enum[tostring(propertyType)]:GetEnumItems()) do
  5363.         table.insert(enumNames, enum.Name)
  5364.     end
  5365.    
  5366.     local dropdown, propertyLabel = CreateDropDown(enumNames, enumName, readOnly, function(value)
  5367.         Set(object, propertyData, value)
  5368.     end)
  5369.     --dropdown.Parent = frame
  5370.    
  5371.     local function update()
  5372.         local value = object[propertyName].Name
  5373.         propertyLabel.Text = tostring(value)
  5374.     end
  5375.    
  5376.     update()
  5377.    
  5378.     object.Changed:connect(function(property)
  5379.         if (property == propertyName) then
  5380.             update()
  5381.         end
  5382.     end)
  5383.    
  5384.     return dropdown
  5385. end
  5386.  
  5387. Controls["Object"] = function(object, propertyData, readOnly)
  5388.     local propertyName = propertyData["Name"]
  5389.     local propertyType = propertyData["ValueType"]
  5390.    
  5391.     local box = CreateObject(readOnly,function()end)
  5392.     box.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
  5393.     box.Position = UDim2.new(0, Styles.Margin, 0, 0)
  5394.  
  5395.     local function update()
  5396.         if AwaitingObjectObj == object then
  5397.             if AwaitingObjectValue == true then
  5398.                 box.Text = "Select an Object"
  5399.                 return
  5400.             end
  5401.         end
  5402.         local value = object[propertyName]
  5403.         box.Text = ToString(value, propertyType)
  5404.     end
  5405.    
  5406.     if not readOnly then
  5407.         box.MouseButton1Click:connect(function()
  5408.             if AwaitingObjectValue then
  5409.                 AwaitingObjectValue = false
  5410.                 update()
  5411.                 return
  5412.             end
  5413.             AwaitingObjectValue = true
  5414.             AwaitingObjectObj = object
  5415.             AwaitingObjectProp = propertyData
  5416.             box.Text = "Select an Object"
  5417.         end)
  5418.        
  5419.         box.Cancel.Visible = true
  5420.         box.Cancel.MouseButton1Click:connect(function()
  5421.             object[propertyName] = nil
  5422.         end)
  5423.     end
  5424.    
  5425.     update()
  5426.    
  5427.     object.Changed:connect(function(property)
  5428.         if (property == propertyName) then
  5429.             update()
  5430.         end
  5431.     end)
  5432.    
  5433.     if object:IsA("ObjectValue") then
  5434.         object.Changed:connect(function(val)
  5435.             update()
  5436.         end)
  5437.     end
  5438.    
  5439.     return box
  5440. end
  5441.  
  5442. function GetControl(object, propertyData, readOnly)
  5443.     local propertyType = propertyData["ValueType"]
  5444.     local control = nil
  5445.    
  5446.     if Controls[propertyType] then
  5447.         control = Controls[propertyType](object, propertyData, readOnly)
  5448.     elseif RbxApi.IsEnum(propertyType) then
  5449.         control = Controls["Enum"](object, propertyData, readOnly)
  5450.     else
  5451.         control = Controls["default"](object, propertyData, readOnly)
  5452.     end
  5453.     return control
  5454. end
  5455. -- Permissions
  5456.  
  5457. function CanEditObject(object)
  5458.     local player = Players.LocalPlayer
  5459.     local character = player.Character
  5460.     return Permissions.CanEdit
  5461. end
  5462.  
  5463. function CanEditProperty(object,propertyData)
  5464.     local tags = propertyData["tags"]
  5465.     for _,name in pairs(tags) do
  5466.         if name == "readonly" then
  5467.             return false
  5468.         end
  5469.     end
  5470.     return CanEditObject(object)
  5471. end
  5472.  
  5473. --RbxApi
  5474. local function PropertyIsHidden(propertyData)
  5475.     local tags = propertyData["tags"]
  5476.     for _,name in pairs(tags) do
  5477.         if name == "deprecated"
  5478.             or name == "hidden"
  5479.             or name == "writeonly" then
  5480.             return true
  5481.         end
  5482.     end
  5483.     return false
  5484. end
  5485.  
  5486. function Set(object, propertyData, value)
  5487.     local propertyName = propertyData["Name"]
  5488.     local propertyType = propertyData["ValueType"]
  5489.    
  5490.     if value == nil then return end
  5491.    
  5492.     for i,v in pairs(GetSelection()) do
  5493.         if CanEditProperty(v,propertyData) then
  5494.             pcall(function()
  5495.                 --print("Setting " .. propertyName .. " to " .. tostring(value))
  5496.                 v[propertyName] = value
  5497.             end)
  5498.         end
  5499.     end
  5500. end
  5501.  
  5502. function CreateRow(object, propertyData, isAlternateRow)
  5503.     local propertyName = propertyData["Name"]
  5504.     local propertyType = propertyData["ValueType"]
  5505.     local propertyValue = object[propertyName]
  5506.     --rowValue, rowValueType, isAlternate
  5507.     local backColor = Row.BackgroundColor;
  5508.     if (isAlternateRow) then
  5509.         backColor = Row.BackgroundColorAlternate
  5510.     end
  5511.    
  5512.     local readOnly = not CanEditProperty(object, propertyData)
  5513.     if propertyType == "Instance" or propertyName == "Parent" then readOnly = true end
  5514.  
  5515.     local rowFrame = Instance.new("Frame")
  5516.     rowFrame.Size = UDim2.new(1,0,0,Row.Height)
  5517.     rowFrame.BackgroundTransparency = 1
  5518.     rowFrame.Name = 'Row'
  5519.  
  5520.     local propertyLabelFrame = CreateCell()
  5521.     propertyLabelFrame.Parent = rowFrame
  5522.     propertyLabelFrame.ClipsDescendants = true
  5523.    
  5524.     local propertyLabel = CreateLabel(readOnly)
  5525.     propertyLabel.Text = propertyName
  5526.     propertyLabel.Size = UDim2.new(1, -1 * Row.TitleMarginLeft, 1, 0)
  5527.     propertyLabel.Position = UDim2.new(0, Row.TitleMarginLeft, 0, 0)
  5528.     propertyLabel.Parent = propertyLabelFrame
  5529.  
  5530.     local propertyValueFrame = CreateCell()
  5531.     propertyValueFrame.Size = UDim2.new(0.5, -1, 1, 0)
  5532.     propertyValueFrame.Position = UDim2.new(0.5, 0, 0, 0)
  5533.     propertyValueFrame.Parent = rowFrame
  5534.  
  5535.     local control = GetControl(object, propertyData, readOnly)
  5536.     control.Parent = propertyValueFrame
  5537.  
  5538.     rowFrame.MouseEnter:connect(function()
  5539.         propertyLabelFrame.BackgroundColor3 = Row.BackgroundColorMouseover
  5540.         propertyValueFrame.BackgroundColor3 = Row.BackgroundColorMouseover
  5541.     end)
  5542.     rowFrame.MouseLeave:connect(function()
  5543.         propertyLabelFrame.BackgroundColor3 = backColor
  5544.         propertyValueFrame.BackgroundColor3 = backColor
  5545.     end)
  5546.    
  5547.     propertyLabelFrame.BackgroundColor3 = backColor
  5548.     propertyValueFrame.BackgroundColor3 = backColor
  5549.    
  5550.     return rowFrame
  5551. end
  5552.  
  5553. function ClearPropertiesList()
  5554.     for _,instance in pairs(ContentFrame:GetChildren()) do
  5555.         instance:Destroy()
  5556.     end
  5557. end
  5558.  
  5559. local selection = Gui:FindFirstChild("Selection", 1)
  5560. print(selection)
  5561.  
  5562. function displayProperties(props)
  5563.     for i,v in pairs(props) do
  5564.         pcall(function()
  5565.             local a = CreateRow(v.object, v.propertyData, ((numRows % 2) == 0))
  5566.             a.Position = UDim2.new(0,0,0,numRows*Row.Height)
  5567.             a.Parent = ContentFrame
  5568.             numRows = numRows + 1
  5569.         end)
  5570.     end
  5571. end
  5572.  
  5573. function checkForDupe(prop,props)
  5574.     for i,v in pairs(props) do
  5575.         if v.propertyData.Name == prop.Name and v.propertyData.ValueType == prop.ValueType then
  5576.             return true
  5577.         end
  5578.     end
  5579.     return false
  5580. end
  5581.  
  5582. function sortProps(t)
  5583.     table.sort(t,
  5584.         function(x,y) return x.propertyData.Name < y.propertyData.Name
  5585.     end)
  5586. end
  5587.  
  5588. function showProperties(obj)
  5589.     ClearPropertiesList()
  5590.     if obj == nil then return end
  5591.     local propHolder = {}
  5592.     local foundProps = {}
  5593.     numRows = 0
  5594.     for _,nextObj in pairs(obj) do
  5595.         if not foundProps[nextObj.className] then
  5596.             foundProps[nextObj.className] = true
  5597.             for i,v in pairs(RbxApi.GetProperties(nextObj.className)) do
  5598.                 local suc, err = pcall(function()
  5599.                     if not (PropertyIsHidden(v)) and not checkForDupe(v,propHolder) then
  5600.                         if string.find(string.lower(v.Name),string.lower(propertiesSearch.Text)) or not searchingProperties() then
  5601.                             table.insert(propHolder,{propertyData = v, object = nextObj})
  5602.                         end
  5603.                     end
  5604.                 end)
  5605.                 --[[if not suc then
  5606.                     warn("Problem getting the value of property " .. v.Name .. " | " .. err)
  5607.                 end --]]
  5608.             end
  5609.         end
  5610.     end
  5611.     sortProps(propHolder)
  5612.     displayProperties(propHolder)
  5613.     ContentFrame.Size = UDim2.new(1, 0, 0, numRows * Row.Height)
  5614.     scrollBar.ScrollIndex = 0
  5615.     scrollBar.TotalSpace = numRows * Row.Height
  5616.     scrollBar.Update()
  5617. end
  5618.  
  5619. ----------------------------------------------------------------
  5620. -----------------------SCROLLBAR STUFF--------------------------
  5621. ----------------------------------------------------------------
  5622. ----------------------------------------------------------------
  5623. local ScrollBarWidth = 16
  5624.  
  5625. local ScrollStyles = {
  5626.     Background      = Color3.new(233/255, 233/255, 233/255);
  5627.     Border          = Color3.new(149/255, 149/255, 149/255);
  5628.     Selected        = Color3.new( 63/255, 119/255, 189/255);
  5629.     BorderSelected  = Color3.new( 55/255, 106/255, 167/255);
  5630.     Text            = Color3.new(  0/255,   0/255,   0/255);
  5631.     TextDisabled    = Color3.new(128/255, 128/255, 128/255);
  5632.     TextSelected    = Color3.new(255/255, 255/255, 255/255);
  5633.     Button          = Color3.new(221/255, 221/255, 221/255);
  5634.     ButtonBorder    = Color3.new(149/255, 149/255, 149/255);
  5635.     ButtonSelected  = Color3.new(255/255,   0/255,   0/255);
  5636.     Field           = Color3.new(255/255, 255/255, 255/255);
  5637.     FieldBorder     = Color3.new(191/255, 191/255, 191/255);
  5638.     TitleBackground = Color3.new(178/255, 178/255, 178/255);
  5639. }
  5640. do
  5641.     local ZIndexLock = {}
  5642.     function SetZIndex(object,z)
  5643.         if not ZIndexLock[object] then
  5644.             ZIndexLock[object] = true
  5645.             if object:IsA'GuiObject' then
  5646.                 object.ZIndex = z
  5647.             end
  5648.             local children = object:GetChildren()
  5649.             for i = 1,#children do
  5650.                 SetZIndex(children[i],z)
  5651.             end
  5652.             ZIndexLock[object] = nil
  5653.         end
  5654.     end
  5655. end
  5656. function SetZIndexOnChanged(object)
  5657.     return object.Changed:connect(function(p)
  5658.         if p == "ZIndex" then
  5659.             SetZIndex(object,object.ZIndex)
  5660.         end
  5661.     end)
  5662. end
  5663. function Create(ty,data)
  5664.     local obj
  5665.     if type(ty) == 'string' then
  5666.         obj = Instance.new(ty)
  5667.     else
  5668.         obj = ty
  5669.     end
  5670.     for k, v in pairs(data) do
  5671.         if type(k) == 'number' then
  5672.             v.Parent = obj
  5673.         else
  5674.             obj[k] = v
  5675.         end
  5676.     end
  5677.     return obj
  5678. end
  5679. -- returns the ascendant ScreenGui of an object
  5680. function GetScreen(screen)
  5681.     if screen == nil then return nil end
  5682.     while not screen:IsA("ScreenGui") do
  5683.         screen = screen.Parent
  5684.         if screen == nil then return nil end
  5685.     end
  5686.     return screen
  5687. end
  5688. -- AutoButtonColor doesn't always reset properly
  5689. function ResetButtonColor(button)
  5690.     local active = button.Active
  5691.     button.Active = not active
  5692.     button.Active = active
  5693. end
  5694.  
  5695. function ArrowGraphic(size,dir,scaled,template)
  5696.     local Frame = Create('Frame',{
  5697.         Name = "Arrow Graphic";
  5698.         BorderSizePixel = 0;
  5699.         Size = UDim2.new(0,size,0,size);
  5700.         Transparency = 1;
  5701.     })
  5702.     if not template then
  5703.         template = Instance.new("Frame")
  5704.         template.BorderSizePixel = 0
  5705.     end
  5706.  
  5707.     local transform
  5708.     if dir == nil or dir == 'Up' then
  5709.         function transform(p,s) return p,s end
  5710.     elseif dir == 'Down' then
  5711.         function transform(p,s) return UDim2.new(0,p.X.Offset,0,size-p.Y.Offset-1),s end
  5712.     elseif dir == 'Left' then
  5713.         function transform(p,s) return UDim2.new(0,p.Y.Offset,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
  5714.     elseif dir == 'Right' then
  5715.         function transform(p,s) return UDim2.new(0,size-p.Y.Offset-1,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
  5716.     end
  5717.  
  5718.     local scale
  5719.     if scaled then
  5720.         function scale(p,s) return UDim2.new(p.X.Offset/size,0,p.Y.Offset/size,0),UDim2.new(s.X.Offset/size,0,s.Y.Offset/size,0) end
  5721.     else
  5722.         function scale(p,s) return p,s end
  5723.     end
  5724.  
  5725.     local o = math.floor(size/4)
  5726.     if size%2 == 0 then
  5727.         local n = size/2-1
  5728.         for i = 0,n do
  5729.             local t = template:Clone()
  5730.             local p,s = scale(transform(
  5731.                 UDim2.new(0,n-i,0,o+i),
  5732.                 UDim2.new(0,(i+1)*2,0,1)
  5733.             ))
  5734.             t.Position = p
  5735.             t.Size = s
  5736.             t.Parent = Frame
  5737.         end
  5738.     else
  5739.         local n = (size-1)/2
  5740.         for i = 0,n do
  5741.             local t = template:Clone()
  5742.             local p,s = scale(transform(
  5743.                 UDim2.new(0,n-i,0,o+i),
  5744.                 UDim2.new(0,i*2+1,0,1)
  5745.             ))
  5746.             t.Position = p
  5747.             t.Size = s
  5748.             t.Parent = Frame
  5749.         end
  5750.     end
  5751.     if size%4 > 1 then
  5752.         local t = template:Clone()
  5753.         local p,s = scale(transform(
  5754.             UDim2.new(0,0,0,size-o-1),
  5755.             UDim2.new(0,size,0,1)
  5756.         ))
  5757.         t.Position = p
  5758.         t.Size = s
  5759.         t.Parent = Frame
  5760.     end
  5761.     return Frame
  5762. end
  5763.  
  5764. function GripGraphic(size,dir,spacing,scaled,template)
  5765.     local Frame = Create('Frame',{
  5766.         Name = "Grip Graphic";
  5767.         BorderSizePixel = 0;
  5768.         Size = UDim2.new(0,size.x,0,size.y);
  5769.         Transparency = 1;
  5770.     })
  5771.     if not template then
  5772.         template = Instance.new("Frame")
  5773.         template.BorderSizePixel = 0
  5774.     end
  5775.  
  5776.     spacing = spacing or 2
  5777.  
  5778.     local scale
  5779.     if scaled then
  5780.         function scale(p) return UDim2.new(p.X.Offset/size.x,0,p.Y.Offset/size.y,0) end
  5781.     else
  5782.         function scale(p) return p end
  5783.     end
  5784.  
  5785.     if dir == 'Vertical' then
  5786.         for i=0,size.x-1,spacing do
  5787.             local t = template:Clone()
  5788.             t.Size = scale(UDim2.new(0,1,0,size.y))
  5789.             t.Position = scale(UDim2.new(0,i,0,0))
  5790.             t.Parent = Frame
  5791.         end
  5792.     elseif dir == nil or dir == 'Horizontal' then
  5793.         for i=0,size.y-1,spacing do
  5794.             local t = template:Clone()
  5795.             t.Size = scale(UDim2.new(0,size.x,0,1))
  5796.             t.Position = scale(UDim2.new(0,0,0,i))
  5797.             t.Parent = Frame
  5798.         end
  5799.     end
  5800.  
  5801.     return Frame
  5802. end
  5803.  
  5804. do
  5805.     local mt = {
  5806.         __index = {
  5807.             GetScrollPercent = function(self)
  5808.                 return self.ScrollIndex/(self.TotalSpace-self.VisibleSpace)
  5809.             end;
  5810.             CanScrollDown = function(self)
  5811.                 return self.ScrollIndex + self.VisibleSpace < self.TotalSpace
  5812.             end;
  5813.             CanScrollUp = function(self)
  5814.                 return self.ScrollIndex > 0
  5815.             end;
  5816.             ScrollDown = function(self)
  5817.                 self.ScrollIndex = self.ScrollIndex + self.PageIncrement
  5818.                 self:Update()
  5819.             end;
  5820.             ScrollUp = function(self)
  5821.                 self.ScrollIndex = self.ScrollIndex - self.PageIncrement
  5822.                 self:Update()
  5823.             end;
  5824.             ScrollTo = function(self,index)
  5825.                 self.ScrollIndex = index
  5826.                 self:Update()
  5827.             end;
  5828.             SetScrollPercent = function(self,percent)
  5829.                 self.ScrollIndex = math.floor((self.TotalSpace - self.VisibleSpace)*percent + 0.5)
  5830.                 self:Update()
  5831.             end;
  5832.         };
  5833.     }
  5834.     mt.__index.CanScrollRight = mt.__index.CanScrollDown
  5835.     mt.__index.CanScrollLeft = mt.__index.CanScrollUp
  5836.     mt.__index.ScrollLeft = mt.__index.ScrollUp
  5837.     mt.__index.ScrollRight = mt.__index.ScrollDown
  5838.  
  5839.     function ScrollBar(horizontal)
  5840.         -- create row scroll bar
  5841.         local ScrollFrame = Create('Frame',{
  5842.             Name = "ScrollFrame";
  5843.             Position = horizontal and UDim2.new(0,0,1,-ScrollBarWidth) or UDim2.new(1,-ScrollBarWidth,0,0);
  5844.             Size = horizontal and UDim2.new(1,0,0,ScrollBarWidth) or UDim2.new(0,ScrollBarWidth,1,0);
  5845.             BackgroundTransparency = 1;
  5846.             Create('ImageButton',{
  5847.                 Name = "ScrollDown";
  5848.                 Position = horizontal and UDim2.new(1,-ScrollBarWidth,0,0) or UDim2.new(0,0,1,-ScrollBarWidth);
  5849.                 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
  5850.                 BackgroundColor3 = ScrollStyles.Button;
  5851.                 BorderColor3 = ScrollStyles.Border;
  5852.                 --BorderSizePixel = 0;
  5853.             });
  5854.             Create('ImageButton',{
  5855.                 Name = "ScrollUp";
  5856.                 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
  5857.                 BackgroundColor3 = ScrollStyles.Button;
  5858.                 BorderColor3 = ScrollStyles.Border;
  5859.                 --BorderSizePixel = 0;
  5860.             });
  5861.             Create('ImageButton',{
  5862.                 Name = "ScrollBar";
  5863.                 Size = horizontal and UDim2.new(1,-ScrollBarWidth*2,1,0) or UDim2.new(1,0,1,-ScrollBarWidth*2);
  5864.                 Position = horizontal and UDim2.new(0,ScrollBarWidth,0,0) or UDim2.new(0,0,0,ScrollBarWidth);
  5865.                 AutoButtonColor = false;
  5866.                 BackgroundColor3 = Color3.new(0.94902, 0.94902, 0.94902);
  5867.                 BorderColor3 = ScrollStyles.Border;
  5868.                 --BorderSizePixel = 0;
  5869.                 Create('ImageButton',{
  5870.                     Name = "ScrollThumb";
  5871.                     AutoButtonColor = false;
  5872.                     Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
  5873.                     BackgroundColor3 = ScrollStyles.Button;
  5874.                     BorderColor3 = ScrollStyles.Border;
  5875.                     --BorderSizePixel = 0;
  5876.                 });
  5877.             });
  5878.         })
  5879.  
  5880.         local graphicTemplate = Create('Frame',{
  5881.             Name="Graphic";
  5882.             BorderSizePixel = 0;
  5883.             BackgroundColor3 = ScrollStyles.Border;
  5884.         })
  5885.         local graphicSize = ScrollBarWidth/2
  5886.  
  5887.         local ScrollDownFrame = ScrollFrame.ScrollDown
  5888.             local ScrollDownGraphic = ArrowGraphic(graphicSize,horizontal and 'Right' or 'Down',true,graphicTemplate)
  5889.             ScrollDownGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
  5890.             ScrollDownGraphic.Parent = ScrollDownFrame
  5891.         local ScrollUpFrame = ScrollFrame.ScrollUp
  5892.             local ScrollUpGraphic = ArrowGraphic(graphicSize,horizontal and 'Left' or 'Up',true,graphicTemplate)
  5893.             ScrollUpGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
  5894.             ScrollUpGraphic.Parent = ScrollUpFrame
  5895.         local ScrollBarFrame = ScrollFrame.ScrollBar
  5896.         local ScrollThumbFrame = ScrollBarFrame.ScrollThumb
  5897.         do
  5898.             local size = ScrollBarWidth*3/8
  5899.             local Decal = GripGraphic(Vector2.new(size,size),horizontal and 'Vertical' or 'Horizontal',2,graphicTemplate)
  5900.             Decal.Position = UDim2.new(0.5,-size/2,0.5,-size/2)
  5901.             Decal.Parent = ScrollThumbFrame
  5902.         end
  5903.  
  5904.         local MouseDrag = Create('ImageButton',{
  5905.             Name = "MouseDrag";
  5906.             Position = UDim2.new(-0.25,0,-0.25,0);
  5907.             Size = UDim2.new(1.5,0,1.5,0);
  5908.             Transparency = 1;
  5909.             AutoButtonColor = false;
  5910.             Active = true;
  5911.             ZIndex = 10;
  5912.         })
  5913.  
  5914.         local Class = setmetatable({
  5915.             GUI = ScrollFrame;
  5916.             ScrollIndex = 0;
  5917.             VisibleSpace = 0;
  5918.             TotalSpace = 0;
  5919.             PageIncrement = 1;
  5920.         },mt)
  5921.  
  5922.         local UpdateScrollThumb
  5923.         if horizontal then
  5924.             function UpdateScrollThumb()
  5925.                 ScrollThumbFrame.Size = UDim2.new(Class.VisibleSpace/Class.TotalSpace,0,0,ScrollBarWidth)
  5926.                 if ScrollThumbFrame.AbsoluteSize.x < ScrollBarWidth then
  5927.                     ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,0,ScrollBarWidth)
  5928.                 end
  5929.                 local barSize = ScrollBarFrame.AbsoluteSize.x
  5930.                 ScrollThumbFrame.Position = UDim2.new(Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.x)/barSize,0,0,0)
  5931.             end
  5932.         else
  5933.             function UpdateScrollThumb()
  5934.                 ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,Class.VisibleSpace/Class.TotalSpace,0)
  5935.                 if ScrollThumbFrame.AbsoluteSize.y < ScrollBarWidth then
  5936.                     ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,0,ScrollBarWidth)
  5937.                 end
  5938.                 local barSize = ScrollBarFrame.AbsoluteSize.y
  5939.                 ScrollThumbFrame.Position = UDim2.new(0,0,Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.y)/barSize,0)
  5940.             end
  5941.         end
  5942.  
  5943.         local lastDown
  5944.         local lastUp
  5945.         local scrollStyle = {BackgroundColor3=ScrollStyles.Border,BackgroundTransparency=0}
  5946.         local scrollStyle_ds = {BackgroundColor3=ScrollStyles.Border,BackgroundTransparency=0.7}
  5947.  
  5948.         local function Update()
  5949.             local t = Class.TotalSpace
  5950.             local v = Class.VisibleSpace
  5951.             local s = Class.ScrollIndex
  5952.             if v <= t then
  5953.                 if s > 0 then
  5954.                     if s + v > t then
  5955.                         Class.ScrollIndex = t - v
  5956.                     end
  5957.                 else
  5958.                     Class.ScrollIndex = 0
  5959.                 end
  5960.             else
  5961.                 Class.ScrollIndex = 0
  5962.             end
  5963.  
  5964.             if Class.UpdateCallback then
  5965.                 if Class.UpdateCallback(Class) == false then
  5966.                     return
  5967.                 end
  5968.             end
  5969.  
  5970.             local down = Class:CanScrollDown()
  5971.             local up = Class:CanScrollUp()
  5972.             if down ~= lastDown then
  5973.                 lastDown = down
  5974.                 ScrollDownFrame.Active = down
  5975.                 ScrollDownFrame.AutoButtonColor = down
  5976.                 local children = ScrollDownGraphic:GetChildren()
  5977.                 local style = down and scrollStyle or scrollStyle_ds
  5978.                 for i = 1,#children do
  5979.                     Create(children[i],style)
  5980.                 end
  5981.             end
  5982.             if up ~= lastUp then
  5983.                 lastUp = up
  5984.                 ScrollUpFrame.Active = up
  5985.                 ScrollUpFrame.AutoButtonColor = up
  5986.                 local children = ScrollUpGraphic:GetChildren()
  5987.                 local style = up and scrollStyle or scrollStyle_ds
  5988.                 for i = 1,#children do
  5989.                     Create(children[i],style)
  5990.                 end
  5991.             end
  5992.             ScrollThumbFrame.Visible = down or up
  5993.             UpdateScrollThumb()
  5994.         end
  5995.         Class.Update = Update
  5996.  
  5997.         SetZIndexOnChanged(ScrollFrame)
  5998.  
  5999.         local scrollEventID = 0
  6000.         ScrollDownFrame.MouseButton1Down:connect(function()
  6001.             scrollEventID = tick()
  6002.             local current = scrollEventID
  6003.             local up_con
  6004.             up_con = MouseDrag.MouseButton1Up:connect(function()
  6005.                 scrollEventID = tick()
  6006.                 MouseDrag.Parent = nil
  6007.                 ResetButtonColor(ScrollDownFrame)
  6008.                 up_con:disconnect(); drag = nil
  6009.             end)
  6010.             MouseDrag.Parent = GetScreen(ScrollFrame)
  6011.             Class:ScrollDown()
  6012.             wait(0.2) -- delay before auto scroll
  6013.             while scrollEventID == current do
  6014.                 Class:ScrollDown()
  6015.                 if not Class:CanScrollDown() then break end
  6016.                 wait()
  6017.             end
  6018.         end)
  6019.  
  6020.         ScrollDownFrame.MouseButton1Up:connect(function()
  6021.             scrollEventID = tick()
  6022.         end)
  6023.  
  6024.         ScrollUpFrame.MouseButton1Down:connect(function()
  6025.             scrollEventID = tick()
  6026.             local current = scrollEventID
  6027.             local up_con
  6028.             up_con = MouseDrag.MouseButton1Up:connect(function()
  6029.                 scrollEventID = tick()
  6030.                 MouseDrag.Parent = nil
  6031.                 ResetButtonColor(ScrollUpFrame)
  6032.                 up_con:disconnect(); drag = nil
  6033.             end)
  6034.             MouseDrag.Parent = GetScreen(ScrollFrame)
  6035.             Class:ScrollUp()
  6036.             wait(0.2)
  6037.             while scrollEventID == current do
  6038.                 Class:ScrollUp()
  6039.                 if not Class:CanScrollUp() then break end
  6040.                 wait()
  6041.             end
  6042.         end)
  6043.  
  6044.         ScrollUpFrame.MouseButton1Up:connect(function()
  6045.             scrollEventID = tick()
  6046.         end)
  6047.  
  6048.         if horizontal then
  6049.             ScrollBarFrame.MouseButton1Down:connect(function(x,y)
  6050.                 scrollEventID = tick()
  6051.                 local current = scrollEventID
  6052.                 local up_con
  6053.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  6054.                     scrollEventID = tick()
  6055.                     MouseDrag.Parent = nil
  6056.                     ResetButtonColor(ScrollUpFrame)
  6057.                     up_con:disconnect(); drag = nil
  6058.                 end)
  6059.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  6060.                 if x > ScrollThumbFrame.AbsolutePosition.x then
  6061.                     Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  6062.                     wait(0.2)
  6063.                     while scrollEventID == current do
  6064.                         if x < ScrollThumbFrame.AbsolutePosition.x + ScrollThumbFrame.AbsoluteSize.x then break end
  6065.                         Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  6066.                         wait()
  6067.                     end
  6068.                 else
  6069.                     Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  6070.                     wait(0.2)
  6071.                     while scrollEventID == current do
  6072.                         if x > ScrollThumbFrame.AbsolutePosition.x then break end
  6073.                         Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  6074.                         wait()
  6075.                     end
  6076.                 end
  6077.             end)
  6078.         else
  6079.             ScrollBarFrame.MouseButton1Down:connect(function(x,y)
  6080.                 scrollEventID = tick()
  6081.                 local current = scrollEventID
  6082.                 local up_con
  6083.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  6084.                     scrollEventID = tick()
  6085.                     MouseDrag.Parent = nil
  6086.                     ResetButtonColor(ScrollUpFrame)
  6087.                     up_con:disconnect(); drag = nil
  6088.                 end)
  6089.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  6090.                 if y > ScrollThumbFrame.AbsolutePosition.y then
  6091.                     Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  6092.                     wait(0.2)
  6093.                     while scrollEventID == current do
  6094.                         if y < ScrollThumbFrame.AbsolutePosition.y + ScrollThumbFrame.AbsoluteSize.y then break end
  6095.                         Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  6096.                         wait()
  6097.                     end
  6098.                 else
  6099.                     Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  6100.                     wait(0.2)
  6101.                     while scrollEventID == current do
  6102.                         if y > ScrollThumbFrame.AbsolutePosition.y then break end
  6103.                         Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  6104.                         wait()
  6105.                     end
  6106.                 end
  6107.             end)
  6108.         end
  6109.  
  6110.         if horizontal then
  6111.             ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
  6112.                 scrollEventID = tick()
  6113.                 local mouse_offset = x - ScrollThumbFrame.AbsolutePosition.x
  6114.                 local drag_con
  6115.                 local up_con
  6116.                 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
  6117.                     local bar_abs_pos = ScrollBarFrame.AbsolutePosition.x
  6118.                     local bar_drag = ScrollBarFrame.AbsoluteSize.x - ScrollThumbFrame.AbsoluteSize.x
  6119.                     local bar_abs_one = bar_abs_pos + bar_drag
  6120.                     x = x - mouse_offset
  6121.                     x = x < bar_abs_pos and bar_abs_pos or x > bar_abs_one and bar_abs_one or x
  6122.                     x = x - bar_abs_pos
  6123.                     Class:SetScrollPercent(x/(bar_drag))
  6124.                 end)
  6125.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  6126.                     scrollEventID = tick()
  6127.                     MouseDrag.Parent = nil
  6128.                     ResetButtonColor(ScrollThumbFrame)
  6129.                     drag_con:disconnect(); drag_con = nil
  6130.                     up_con:disconnect(); drag = nil
  6131.                 end)
  6132.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  6133.             end)
  6134.         else
  6135.             ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
  6136.                 scrollEventID = tick()
  6137.                 local mouse_offset = y - ScrollThumbFrame.AbsolutePosition.y
  6138.                 local drag_con
  6139.                 local up_con
  6140.                 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
  6141.                     local bar_abs_pos = ScrollBarFrame.AbsolutePosition.y
  6142.                     local bar_drag = ScrollBarFrame.AbsoluteSize.y - ScrollThumbFrame.AbsoluteSize.y
  6143.                     local bar_abs_one = bar_abs_pos + bar_drag
  6144.                     y = y - mouse_offset
  6145.                     y = y < bar_abs_pos and bar_abs_pos or y > bar_abs_one and bar_abs_one or y
  6146.                     y = y - bar_abs_pos
  6147.                     Class:SetScrollPercent(y/(bar_drag))
  6148.                 end)
  6149.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  6150.                     scrollEventID = tick()
  6151.                     MouseDrag.Parent = nil
  6152.                     ResetButtonColor(ScrollThumbFrame)
  6153.                     drag_con:disconnect(); drag_con = nil
  6154.                     up_con:disconnect(); drag = nil
  6155.                 end)
  6156.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  6157.             end)
  6158.         end
  6159.  
  6160.         function Class:Destroy()
  6161.             ScrollFrame:Destroy()
  6162.             MouseDrag:Destroy()
  6163.             for k in pairs(Class) do
  6164.                 Class[k] = nil
  6165.             end
  6166.             setmetatable(Class,nil)
  6167.         end
  6168.  
  6169.         Update()
  6170.  
  6171.         return Class
  6172.     end
  6173. end
  6174.  
  6175. ----------------------------------------------------------------
  6176. ----------------------------------------------------------------
  6177. ----------------------------------------------------------------
  6178. ----------------------------------------------------------------
  6179.  
  6180. local MainFrame = Instance.new("Frame")
  6181. MainFrame.Name = "MainFrame"
  6182. MainFrame.Size = UDim2.new(1, -1 * ScrollBarWidth, 1, 0)
  6183. MainFrame.Position = UDim2.new(0, 0, 0, 0)
  6184. MainFrame.BackgroundTransparency = 1
  6185. MainFrame.ClipsDescendants = true
  6186. MainFrame.Parent = PropertiesFrame
  6187.  
  6188. ContentFrame = Instance.new("Frame")
  6189. ContentFrame.Name = "ContentFrame"
  6190. ContentFrame.Size = UDim2.new(1, 0, 0, 0)
  6191. ContentFrame.BackgroundTransparency = 1
  6192. ContentFrame.Parent = MainFrame
  6193.  
  6194. scrollBar = ScrollBar(false)
  6195. scrollBar.PageIncrement = 1
  6196. Create(scrollBar.GUI,{
  6197.     Position = UDim2.new(1,-ScrollBarWidth,0,0);
  6198.     Size = UDim2.new(0,ScrollBarWidth,1,0);
  6199.     Parent = PropertiesFrame;
  6200. })
  6201.  
  6202. scrollBarH = ScrollBar(true)
  6203. scrollBarH.PageIncrement = ScrollBarWidth
  6204. Create(scrollBarH.GUI,{
  6205.     Position = UDim2.new(0,0,1,-ScrollBarWidth);
  6206.     Size = UDim2.new(1,-ScrollBarWidth,0,ScrollBarWidth);
  6207.     Visible = false;
  6208.     Parent = PropertiesFrame;
  6209. })
  6210.  
  6211. do
  6212.     local listEntries = {}
  6213.     local nameConnLookup = {}
  6214.    
  6215.     function scrollBar.UpdateCallback(self)
  6216.         scrollBar.TotalSpace = ContentFrame.AbsoluteSize.Y
  6217.         scrollBar.VisibleSpace = MainFrame.AbsoluteSize.Y
  6218.         ContentFrame.Position = UDim2.new(ContentFrame.Position.X.Scale,ContentFrame.Position.X.Offset,0,-1*scrollBar.ScrollIndex)
  6219.     end
  6220.  
  6221.     function scrollBarH.UpdateCallback(self)
  6222.        
  6223.     end
  6224.  
  6225.     MainFrame.Changed:connect(function(p)
  6226.         if p == 'AbsoluteSize' then
  6227.             scrollBarH.VisibleSpace = math.ceil(MainFrame.AbsoluteSize.x)
  6228.             scrollBarH:Update()
  6229.             scrollBar.VisibleSpace = math.ceil(MainFrame.AbsoluteSize.y)
  6230.             scrollBar:Update()
  6231.         end
  6232.     end)
  6233.  
  6234.     local wheelAmount = Row.Height
  6235.     PropertiesFrame.MouseWheelForward:connect(function()
  6236.         if scrollBar.VisibleSpace - 1 > wheelAmount then
  6237.             scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount)
  6238.         else
  6239.             scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace)
  6240.         end
  6241.     end)
  6242.     PropertiesFrame.MouseWheelBackward:connect(function()
  6243.         if scrollBar.VisibleSpace - 1 > wheelAmount then
  6244.             scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount)
  6245.         else
  6246.             scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace)
  6247.         end
  6248.     end)
  6249. end
  6250.  
  6251. scrollBar.VisibleSpace = math.ceil(MainFrame.AbsoluteSize.y)
  6252. scrollBar:Update()
  6253.  
  6254. showProperties(GetSelection())
  6255.  
  6256. bindSelectionChanged.Event:connect(function()
  6257.     showProperties(GetSelection())
  6258. end)
  6259.  
  6260. bindSetAwait.Event:connect(function(obj)
  6261.     if AwaitingObjectValue then
  6262.         AwaitingObjectValue = false
  6263.         local mySel = obj
  6264.         if mySel then
  6265.             pcall(function()
  6266.                 Set(AwaitingObjectObj, AwaitingObjectProp, mySel)
  6267.             end)
  6268.         end
  6269.     end
  6270. end)
  6271.  
  6272. propertiesSearch.Changed:connect(function(prop)
  6273.     if prop == "Text" then
  6274.         showProperties(GetSelection())
  6275.     end
  6276. end)
  6277.  
  6278. bindGetApi.OnInvoke = function()
  6279.     return RbxApi
  6280. end
  6281.  
  6282. bindGetAwait.OnInvoke = function()
  6283.     return AwaitingObjectValue
  6284. end
  6285. end)
  6286.  
  6287. spawn(function()
  6288.     local top = D_E_X.ScriptEditor
  6289.  
  6290. local editorGrid = top:WaitForChild("EditorGrid")
  6291.  
  6292. local currentSource = ""
  6293.  
  6294. local currentEditor = {
  6295.     x = 0,
  6296.     y = 0
  6297. }
  6298.  
  6299. local userInput = game:GetService("UserInputService")
  6300. local mouse = game.Players.LocalPlayer:GetMouse()
  6301.  
  6302. local topBar = top:WaitForChild("TopBar")
  6303. local scriptBar = topBar:WaitForChild("ScriptBar")
  6304. local scriptBarLeft = topBar:WaitForChild("ScriptBarLeft")
  6305. local scriptBarRight = topBar:WaitForChild("ScriptBarRight")
  6306. local clipboardButton = topBar:WaitForChild("Clipboard")
  6307.  
  6308. local entryTemplate = topBar:WaitForChild("Entry")
  6309.  
  6310. local openEvent = top:WaitForChild("OpenScript")
  6311.  
  6312. local closeButton = top:WaitForChild("Close")
  6313.  
  6314. local memoryScripts = {}
  6315.  
  6316. local editingIndex = 0
  6317.  
  6318. -- Scrollbar
  6319.  
  6320. local ScrollBarWidth = 16
  6321.  
  6322. local ScrollStyles = {
  6323.     Background      = Color3.new(233/255, 233/255, 233/255);
  6324.     Border          = Color3.new(149/255, 149/255, 149/255);
  6325.     Selected        = Color3.new( 63/255, 119/255, 189/255);
  6326.     BorderSelected  = Color3.new( 55/255, 106/255, 167/255);
  6327.     Text            = Color3.new(  0/255,   0/255,   0/255);
  6328.     TextDisabled    = Color3.new(128/255, 128/255, 128/255);
  6329.     TextSelected    = Color3.new(255/255, 255/255, 255/255);
  6330.     Button          = Color3.new(221/255, 221/255, 221/255);
  6331.     ButtonBorder    = Color3.new(149/255, 149/255, 149/255);
  6332.     ButtonSelected  = Color3.new(255/255,   0/255,   0/255);
  6333.     Field           = Color3.new(255/255, 255/255, 255/255);
  6334.     FieldBorder     = Color3.new(191/255, 191/255, 191/255);
  6335.     TitleBackground = Color3.new(178/255, 178/255, 178/255);
  6336. }
  6337. do
  6338.     local ZIndexLock = {}
  6339.     function SetZIndex(object,z)
  6340.         if not ZIndexLock[object] then
  6341.             ZIndexLock[object] = true
  6342.             if object:IsA'GuiObject' then
  6343.                 object.ZIndex = z
  6344.             end
  6345.             local children = object:GetChildren()
  6346.             for i = 1,#children do
  6347.                 SetZIndex(children[i],z)
  6348.             end
  6349.             ZIndexLock[object] = nil
  6350.         end
  6351.     end
  6352. end
  6353. function SetZIndexOnChanged(object)
  6354.     return object.Changed:connect(function(p)
  6355.         if p == "ZIndex" then
  6356.             SetZIndex(object,object.ZIndex)
  6357.         end
  6358.     end)
  6359. end
  6360. function Create(ty,data)
  6361.     local obj
  6362.     if type(ty) == 'string' then
  6363.         obj = Instance.new(ty)
  6364.     else
  6365.         obj = ty
  6366.     end
  6367.     for k, v in pairs(data) do
  6368.         if type(k) == 'number' then
  6369.             v.Parent = obj
  6370.         else
  6371.             obj[k] = v
  6372.         end
  6373.     end
  6374.     return obj
  6375. end
  6376. -- returns the ascendant ScreenGui of an object
  6377. function GetScreen(screen)
  6378.     if screen == nil then return nil end
  6379.     while not screen:IsA("ScreenGui") do
  6380.         screen = screen.Parent
  6381.         if screen == nil then return nil end
  6382.     end
  6383.     return screen
  6384. end
  6385. -- AutoButtonColor doesn't always reset properly
  6386. function ResetButtonColor(button)
  6387.     local active = button.Active
  6388.     button.Active = not active
  6389.     button.Active = active
  6390. end
  6391.  
  6392. function ArrowGraphic(size,dir,scaled,template)
  6393.     local Frame = Create('Frame',{
  6394.         Name = "Arrow Graphic";
  6395.         BorderSizePixel = 0;
  6396.         Size = UDim2.new(0,size,0,size);
  6397.         Transparency = 1;
  6398.     })
  6399.     if not template then
  6400.         template = Instance.new("Frame")
  6401.         template.BorderSizePixel = 0
  6402.     end
  6403.  
  6404.     local transform
  6405.     if dir == nil or dir == 'Up' then
  6406.         function transform(p,s) return p,s end
  6407.     elseif dir == 'Down' then
  6408.         function transform(p,s) return UDim2.new(0,p.X.Offset,0,size-p.Y.Offset-1),s end
  6409.     elseif dir == 'Left' then
  6410.         function transform(p,s) return UDim2.new(0,p.Y.Offset,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
  6411.     elseif dir == 'Right' then
  6412.         function transform(p,s) return UDim2.new(0,size-p.Y.Offset-1,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
  6413.     end
  6414.  
  6415.     local scale
  6416.     if scaled then
  6417.         function scale(p,s) return UDim2.new(p.X.Offset/size,0,p.Y.Offset/size,0),UDim2.new(s.X.Offset/size,0,s.Y.Offset/size,0) end
  6418.     else
  6419.         function scale(p,s) return p,s end
  6420.     end
  6421.  
  6422.     local o = math.floor(size/4)
  6423.     if size%2 == 0 then
  6424.         local n = size/2-1
  6425.         for i = 0,n do
  6426.             local t = template:Clone()
  6427.             local p,s = scale(transform(
  6428.                 UDim2.new(0,n-i,0,o+i),
  6429.                 UDim2.new(0,(i+1)*2,0,1)
  6430.             ))
  6431.             t.Position = p
  6432.             t.Size = s
  6433.             t.Parent = Frame
  6434.         end
  6435.     else
  6436.         local n = (size-1)/2
  6437.         for i = 0,n do
  6438.             local t = template:Clone()
  6439.             local p,s = scale(transform(
  6440.                 UDim2.new(0,n-i,0,o+i),
  6441.                 UDim2.new(0,i*2+1,0,1)
  6442.             ))
  6443.             t.Position = p
  6444.             t.Size = s
  6445.             t.Parent = Frame
  6446.         end
  6447.     end
  6448.     if size%4 > 1 then
  6449.         local t = template:Clone()
  6450.         local p,s = scale(transform(
  6451.             UDim2.new(0,0,0,size-o-1),
  6452.             UDim2.new(0,size,0,1)
  6453.         ))
  6454.         t.Position = p
  6455.         t.Size = s
  6456.         t.Parent = Frame
  6457.     end
  6458.     return Frame
  6459. end
  6460.  
  6461. function GripGraphic(size,dir,spacing,scaled,template)
  6462.     local Frame = Create('Frame',{
  6463.         Name = "Grip Graphic";
  6464.         BorderSizePixel = 0;
  6465.         Size = UDim2.new(0,size.x,0,size.y);
  6466.         Transparency = 1;
  6467.     })
  6468.     if not template then
  6469.         template = Instance.new("Frame")
  6470.         template.BorderSizePixel = 0
  6471.     end
  6472.  
  6473.     spacing = spacing or 2
  6474.  
  6475.     local scale
  6476.     if scaled then
  6477.         function scale(p) return UDim2.new(p.X.Offset/size.x,0,p.Y.Offset/size.y,0) end
  6478.     else
  6479.         function scale(p) return p end
  6480.     end
  6481.  
  6482.     if dir == 'Vertical' then
  6483.         for i=0,size.x-1,spacing do
  6484.             local t = template:Clone()
  6485.             t.Size = scale(UDim2.new(0,1,0,size.y))
  6486.             t.Position = scale(UDim2.new(0,i,0,0))
  6487.             t.Parent = Frame
  6488.         end
  6489.     elseif dir == nil or dir == 'Horizontal' then
  6490.         for i=0,size.y-1,spacing do
  6491.             local t = template:Clone()
  6492.             t.Size = scale(UDim2.new(0,size.x,0,1))
  6493.             t.Position = scale(UDim2.new(0,0,0,i))
  6494.             t.Parent = Frame
  6495.         end
  6496.     end
  6497.  
  6498.     return Frame
  6499. end
  6500.  
  6501. do
  6502.     local mt = {
  6503.         __index = {
  6504.             GetScrollPercent = function(self)
  6505.                 return self.ScrollIndex/(self.TotalSpace-self.VisibleSpace)
  6506.             end;
  6507.             CanScrollDown = function(self)
  6508.                 return self.ScrollIndex + self.VisibleSpace < self.TotalSpace
  6509.             end;
  6510.             CanScrollUp = function(self)
  6511.                 return self.ScrollIndex > 0
  6512.             end;
  6513.             ScrollDown = function(self)
  6514.                 self.ScrollIndex = self.ScrollIndex + self.PageIncrement
  6515.                 self:Update()
  6516.             end;
  6517.             ScrollUp = function(self)
  6518.                 self.ScrollIndex = self.ScrollIndex - self.PageIncrement
  6519.                 self:Update()
  6520.             end;
  6521.             ScrollTo = function(self,index)
  6522.                 self.ScrollIndex = index
  6523.                 self:Update()
  6524.             end;
  6525.             SetScrollPercent = function(self,percent)
  6526.                 self.ScrollIndex = math.floor((self.TotalSpace - self.VisibleSpace)*percent + 0.5)
  6527.                 self:Update()
  6528.             end;
  6529.         };
  6530.     }
  6531.     mt.__index.CanScrollRight = mt.__index.CanScrollDown
  6532.     mt.__index.CanScrollLeft = mt.__index.CanScrollUp
  6533.     mt.__index.ScrollLeft = mt.__index.ScrollUp
  6534.     mt.__index.ScrollRight = mt.__index.ScrollDown
  6535.  
  6536.     function ScrollBar(horizontal)
  6537.         -- create row scroll bar
  6538.         local ScrollFrame = Create('Frame',{
  6539.             Name = "ScrollFrame";
  6540.             Position = horizontal and UDim2.new(0,0,1,-ScrollBarWidth) or UDim2.new(1,-ScrollBarWidth,0,0);
  6541.             Size = horizontal and UDim2.new(1,0,0,ScrollBarWidth) or UDim2.new(0,ScrollBarWidth,1,0);
  6542.             BackgroundTransparency = 1;
  6543.             Create('ImageButton',{
  6544.                 Name = "ScrollDown";
  6545.                 Position = horizontal and UDim2.new(1,-ScrollBarWidth,0,0) or UDim2.new(0,0,1,-ScrollBarWidth);
  6546.                 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
  6547.                 BackgroundColor3 = ScrollStyles.Button;
  6548.                 BorderColor3 = ScrollStyles.Border;
  6549.                 --BorderSizePixel = 0;
  6550.             });
  6551.             Create('ImageButton',{
  6552.                 Name = "ScrollUp";
  6553.                 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
  6554.                 BackgroundColor3 = ScrollStyles.Button;
  6555.                 BorderColor3 = ScrollStyles.Border;
  6556.                 --BorderSizePixel = 0;
  6557.             });
  6558.             Create('ImageButton',{
  6559.                 Name = "ScrollBar";
  6560.                 Size = horizontal and UDim2.new(1,-ScrollBarWidth*2,1,0) or UDim2.new(1,0,1,-ScrollBarWidth*2);
  6561.                 Position = horizontal and UDim2.new(0,ScrollBarWidth,0,0) or UDim2.new(0,0,0,ScrollBarWidth);
  6562.                 AutoButtonColor = false;
  6563.                 BackgroundColor3 = Color3.new(0.94902, 0.94902, 0.94902);
  6564.                 BorderColor3 = ScrollStyles.Border;
  6565.                 --BorderSizePixel = 0;
  6566.                 Create('ImageButton',{
  6567.                     Name = "ScrollThumb";
  6568.                     AutoButtonColor = false;
  6569.                     Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
  6570.                     BackgroundColor3 = ScrollStyles.Button;
  6571.                     BorderColor3 = ScrollStyles.Border;
  6572.                     --BorderSizePixel = 0;
  6573.                 });
  6574.             });
  6575.         })
  6576.  
  6577.         local graphicTemplate = Create('Frame',{
  6578.             Name="Graphic";
  6579.             BorderSizePixel = 0;
  6580.             BackgroundColor3 = ScrollStyles.Border;
  6581.         })
  6582.         local graphicSize = ScrollBarWidth/2
  6583.  
  6584.         local ScrollDownFrame = ScrollFrame.ScrollDown
  6585.             local ScrollDownGraphic = ArrowGraphic(graphicSize,horizontal and 'Right' or 'Down',true,graphicTemplate)
  6586.             ScrollDownGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
  6587.             ScrollDownGraphic.Parent = ScrollDownFrame
  6588.         local ScrollUpFrame = ScrollFrame.ScrollUp
  6589.             local ScrollUpGraphic = ArrowGraphic(graphicSize,horizontal and 'Left' or 'Up',true,graphicTemplate)
  6590.             ScrollUpGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
  6591.             ScrollUpGraphic.Parent = ScrollUpFrame
  6592.         local ScrollBarFrame = ScrollFrame.ScrollBar
  6593.         local ScrollThumbFrame = ScrollBarFrame.ScrollThumb
  6594.         do
  6595.             local size = ScrollBarWidth*3/8
  6596.             local Decal = GripGraphic(Vector2.new(size,size),horizontal and 'Vertical' or 'Horizontal',2,graphicTemplate)
  6597.             Decal.Position = UDim2.new(0.5,-size/2,0.5,-size/2)
  6598.             Decal.Parent = ScrollThumbFrame
  6599.         end
  6600.  
  6601.         local MouseDrag = Create('ImageButton',{
  6602.             Name = "MouseDrag";
  6603.             Position = UDim2.new(-0.25,0,-0.25,0);
  6604.             Size = UDim2.new(1.5,0,1.5,0);
  6605.             Transparency = 1;
  6606.             AutoButtonColor = false;
  6607.             Active = true;
  6608.             ZIndex = 10;
  6609.         })
  6610.  
  6611.         local Class = setmetatable({
  6612.             GUI = ScrollFrame;
  6613.             ScrollIndex = 0;
  6614.             VisibleSpace = 0;
  6615.             TotalSpace = 0;
  6616.             PageIncrement = 1;
  6617.         },mt)
  6618.  
  6619.         local UpdateScrollThumb
  6620.         if horizontal then
  6621.             function UpdateScrollThumb()
  6622.                 ScrollThumbFrame.Size = UDim2.new(Class.VisibleSpace/Class.TotalSpace,0,0,ScrollBarWidth)
  6623.                 if ScrollThumbFrame.AbsoluteSize.x < ScrollBarWidth then
  6624.                     ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,0,ScrollBarWidth)
  6625.                 end
  6626.                 local barSize = ScrollBarFrame.AbsoluteSize.x
  6627.                 ScrollThumbFrame.Position = UDim2.new(Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.x)/barSize,0,0,0)
  6628.             end
  6629.         else
  6630.             function UpdateScrollThumb()
  6631.                 ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,Class.VisibleSpace/Class.TotalSpace,0)
  6632.                 if ScrollThumbFrame.AbsoluteSize.y < ScrollBarWidth then
  6633.                     ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,0,ScrollBarWidth)
  6634.                 end
  6635.                 local barSize = ScrollBarFrame.AbsoluteSize.y
  6636.                 ScrollThumbFrame.Position = UDim2.new(0,0,Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.y)/barSize,0)
  6637.             end
  6638.         end
  6639.  
  6640.         local lastDown
  6641.         local lastUp
  6642.         local scrollStyle = {BackgroundColor3=ScrollStyles.Border,BackgroundTransparency=0}
  6643.         local scrollStyle_ds = {BackgroundColor3=ScrollStyles.Border,BackgroundTransparency=0.7}
  6644.  
  6645.         local function Update()
  6646.             local t = Class.TotalSpace
  6647.             local v = Class.VisibleSpace
  6648.             local s = Class.ScrollIndex
  6649.             if v <= t then
  6650.                 if s > 0 then
  6651.                     if s + v > t then
  6652.                         Class.ScrollIndex = t - v
  6653.                     end
  6654.                 else
  6655.                     Class.ScrollIndex = 0
  6656.                 end
  6657.             else
  6658.                 Class.ScrollIndex = 0
  6659.             end
  6660.  
  6661.             if Class.UpdateCallback then
  6662.                 if Class.UpdateCallback(Class) == false then
  6663.                     return
  6664.                 end
  6665.             end
  6666.  
  6667.             local down = Class:CanScrollDown()
  6668.             local up = Class:CanScrollUp()
  6669.             if down ~= lastDown then
  6670.                 lastDown = down
  6671.                 ScrollDownFrame.Active = down
  6672.                 ScrollDownFrame.AutoButtonColor = down
  6673.                 local children = ScrollDownGraphic:GetChildren()
  6674.                 local style = down and scrollStyle or scrollStyle_ds
  6675.                 for i = 1,#children do
  6676.                     Create(children[i],style)
  6677.                 end
  6678.             end
  6679.             if up ~= lastUp then
  6680.                 lastUp = up
  6681.                 ScrollUpFrame.Active = up
  6682.                 ScrollUpFrame.AutoButtonColor = up
  6683.                 local children = ScrollUpGraphic:GetChildren()
  6684.                 local style = up and scrollStyle or scrollStyle_ds
  6685.                 for i = 1,#children do
  6686.                     Create(children[i],style)
  6687.                 end
  6688.             end
  6689.             ScrollThumbFrame.Visible = down or up
  6690.             UpdateScrollThumb()
  6691.         end
  6692.         Class.Update = Update
  6693.  
  6694.         SetZIndexOnChanged(ScrollFrame)
  6695.  
  6696.         local scrollEventID = 0
  6697.         ScrollDownFrame.MouseButton1Down:connect(function()
  6698.             scrollEventID = tick()
  6699.             local current = scrollEventID
  6700.             local up_con
  6701.             up_con = MouseDrag.MouseButton1Up:connect(function()
  6702.                 scrollEventID = tick()
  6703.                 MouseDrag.Parent = nil
  6704.                 ResetButtonColor(ScrollDownFrame)
  6705.                 up_con:disconnect(); drag = nil
  6706.             end)
  6707.             MouseDrag.Parent = GetScreen(ScrollFrame)
  6708.             Class:ScrollDown()
  6709.             wait(0.2) -- delay before auto scroll
  6710.             while scrollEventID == current do
  6711.                 Class:ScrollDown()
  6712.                 if not Class:CanScrollDown() then break end
  6713.                 wait()
  6714.             end
  6715.         end)
  6716.  
  6717.         ScrollDownFrame.MouseButton1Up:connect(function()
  6718.             scrollEventID = tick()
  6719.         end)
  6720.  
  6721.         ScrollUpFrame.MouseButton1Down:connect(function()
  6722.             scrollEventID = tick()
  6723.             local current = scrollEventID
  6724.             local up_con
  6725.             up_con = MouseDrag.MouseButton1Up:connect(function()
  6726.                 scrollEventID = tick()
  6727.                 MouseDrag.Parent = nil
  6728.                 ResetButtonColor(ScrollUpFrame)
  6729.                 up_con:disconnect(); drag = nil
  6730.             end)
  6731.             MouseDrag.Parent = GetScreen(ScrollFrame)
  6732.             Class:ScrollUp()
  6733.             wait(0.2)
  6734.             while scrollEventID == current do
  6735.                 Class:ScrollUp()
  6736.                 if not Class:CanScrollUp() then break end
  6737.                 wait()
  6738.             end
  6739.         end)
  6740.  
  6741.         ScrollUpFrame.MouseButton1Up:connect(function()
  6742.             scrollEventID = tick()
  6743.         end)
  6744.  
  6745.         if horizontal then
  6746.             ScrollBarFrame.MouseButton1Down:connect(function(x,y)
  6747.                 scrollEventID = tick()
  6748.                 local current = scrollEventID
  6749.                 local up_con
  6750.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  6751.                     scrollEventID = tick()
  6752.                     MouseDrag.Parent = nil
  6753.                     ResetButtonColor(ScrollUpFrame)
  6754.                     up_con:disconnect(); drag = nil
  6755.                 end)
  6756.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  6757.                 if x > ScrollThumbFrame.AbsolutePosition.x then
  6758.                     Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  6759.                     wait(0.2)
  6760.                     while scrollEventID == current do
  6761.                         if x < ScrollThumbFrame.AbsolutePosition.x + ScrollThumbFrame.AbsoluteSize.x then break end
  6762.                         Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  6763.                         wait()
  6764.                     end
  6765.                 else
  6766.                     Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  6767.                     wait(0.2)
  6768.                     while scrollEventID == current do
  6769.                         if x > ScrollThumbFrame.AbsolutePosition.x then break end
  6770.                         Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  6771.                         wait()
  6772.                     end
  6773.                 end
  6774.             end)
  6775.         else
  6776.             ScrollBarFrame.MouseButton1Down:connect(function(x,y)
  6777.                 scrollEventID = tick()
  6778.                 local current = scrollEventID
  6779.                 local up_con
  6780.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  6781.                     scrollEventID = tick()
  6782.                     MouseDrag.Parent = nil
  6783.                     ResetButtonColor(ScrollUpFrame)
  6784.                     up_con:disconnect(); drag = nil
  6785.                 end)
  6786.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  6787.                 if y > ScrollThumbFrame.AbsolutePosition.y then
  6788.                     Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  6789.                     wait(0.2)
  6790.                     while scrollEventID == current do
  6791.                         if y < ScrollThumbFrame.AbsolutePosition.y + ScrollThumbFrame.AbsoluteSize.y then break end
  6792.                         Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  6793.                         wait()
  6794.                     end
  6795.                 else
  6796.                     Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  6797.                     wait(0.2)
  6798.                     while scrollEventID == current do
  6799.                         if y > ScrollThumbFrame.AbsolutePosition.y then break end
  6800.                         Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  6801.                         wait()
  6802.                     end
  6803.                 end
  6804.             end)
  6805.         end
  6806.  
  6807.         if horizontal then
  6808.             ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
  6809.                 scrollEventID = tick()
  6810.                 local mouse_offset = x - ScrollThumbFrame.AbsolutePosition.x
  6811.                 local drag_con
  6812.                 local up_con
  6813.                 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
  6814.                     local bar_abs_pos = ScrollBarFrame.AbsolutePosition.x
  6815.                     local bar_drag = ScrollBarFrame.AbsoluteSize.x - ScrollThumbFrame.AbsoluteSize.x
  6816.                     local bar_abs_one = bar_abs_pos + bar_drag
  6817.                     x = x - mouse_offset
  6818.                     x = x < bar_abs_pos and bar_abs_pos or x > bar_abs_one and bar_abs_one or x
  6819.                     x = x - bar_abs_pos
  6820.                     Class:SetScrollPercent(x/(bar_drag))
  6821.                 end)
  6822.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  6823.                     scrollEventID = tick()
  6824.                     MouseDrag.Parent = nil
  6825.                     ResetButtonColor(ScrollThumbFrame)
  6826.                     drag_con:disconnect(); drag_con = nil
  6827.                     up_con:disconnect(); drag = nil
  6828.                 end)
  6829.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  6830.             end)
  6831.         else
  6832.             ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
  6833.                 scrollEventID = tick()
  6834.                 local mouse_offset = y - ScrollThumbFrame.AbsolutePosition.y
  6835.                 local drag_con
  6836.                 local up_con
  6837.                 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
  6838.                     local bar_abs_pos = ScrollBarFrame.AbsolutePosition.y
  6839.                     local bar_drag = ScrollBarFrame.AbsoluteSize.y - ScrollThumbFrame.AbsoluteSize.y
  6840.                     local bar_abs_one = bar_abs_pos + bar_drag
  6841.                     y = y - mouse_offset
  6842.                     y = y < bar_abs_pos and bar_abs_pos or y > bar_abs_one and bar_abs_one or y
  6843.                     y = y - bar_abs_pos
  6844.                     Class:SetScrollPercent(y/(bar_drag))
  6845.                 end)
  6846.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  6847.                     scrollEventID = tick()
  6848.                     MouseDrag.Parent = nil
  6849.                     ResetButtonColor(ScrollThumbFrame)
  6850.                     drag_con:disconnect(); drag_con = nil
  6851.                     up_con:disconnect(); drag = nil
  6852.                 end)
  6853.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  6854.             end)
  6855.         end
  6856.  
  6857.         function Class:Destroy()
  6858.             ScrollFrame:Destroy()
  6859.             MouseDrag:Destroy()
  6860.             for k in pairs(Class) do
  6861.                 Class[k] = nil
  6862.             end
  6863.             setmetatable(Class,nil)
  6864.         end
  6865.  
  6866.         Update()
  6867.  
  6868.         return Class
  6869.     end
  6870. end
  6871.  
  6872. -- End Scrollbar
  6873.  
  6874. local scrollBar = ScrollBar(false)
  6875. scrollBar.PageIncrement = 16
  6876. Create(scrollBar.GUI,{
  6877.     Position = UDim2.new(1,0,0,0);
  6878.     Size = UDim2.new(0,ScrollBarWidth,1,0);
  6879.     Parent = editorGrid;
  6880. })
  6881.  
  6882. local scrollBarH = ScrollBar(true)
  6883. scrollBarH.PageIncrement = 8
  6884. Create(scrollBarH.GUI,{
  6885.     Position = UDim2.new(0,0,1,0);
  6886.     Size = UDim2.new(1,0,0,ScrollBarWidth);
  6887.     Parent = editorGrid;
  6888. })
  6889.  
  6890. local entries = {}
  6891.  
  6892. local grid = {}
  6893.  
  6894. local count = 1
  6895. local xCount = 1
  6896.  
  6897. local lineSpan = 0
  6898.  
  6899. for i = 0,490,8 do
  6900.     local newRow = {}
  6901.     for j = 0,390,16 do
  6902.         local cellText = Instance.new("TextLabel",editorGrid)
  6903.         cellText.BackgroundTransparency = 1
  6904.         cellText.BorderSizePixel = 0
  6905.         cellText.Text = ""
  6906.         cellText.Position = UDim2.new(0,i,0,j)
  6907.         cellText.Size = UDim2.new(0,8,0,16)
  6908.         cellText.Font = Enum.Font.SourceSans
  6909.         cellText.FontSize = Enum.FontSize.Size18
  6910.         table.insert(newRow,cellText)
  6911.         xCount = xCount + 1
  6912.     end
  6913.     table.insert(grid,newRow)
  6914.     count = count + 1
  6915.     xCount = 1
  6916. end
  6917.  
  6918. local syntaxHighlightList = {
  6919.     {["Keyword"] = "for", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6920.     {["Keyword"] = "local", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6921.     {["Keyword"] = "if", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6922.     {["Keyword"] = "then", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6923.     {["Keyword"] = "do", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6924.     {["Keyword"] = "while", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6925.     {["Keyword"] = "end", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6926.     {["Keyword"] = "function", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6927.     {["Keyword"] = "string", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6928.     {["Keyword"] = "table", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6929.     {["Keyword"] = "game", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6930.     {["Keyword"] = "workspace", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6931.     {["Keyword"] = "return", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6932.     {["Keyword"] = "break", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6933.     {["Keyword"] = "elseif", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6934.     {["Keyword"] = "in", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6935.     {["Keyword"] = "pairs", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true},
  6936.     {["Keyword"] = "ipairs", ["Color"] = Color3.new(0, 0, 127/255), ["Independent"] = true}
  6937. }
  6938.  
  6939. function checkMouseInGui(gui)
  6940.     if gui == nil then return false end
  6941.     local plrMouse = game.Players.LocalPlayer:GetMouse()
  6942.     local guiPosition = gui.AbsolutePosition
  6943.     local guiSize = gui.AbsoluteSize   
  6944.    
  6945.     if plrMouse.X >= guiPosition.x and plrMouse.X <= guiPosition.x + guiSize.x and plrMouse.Y >= guiPosition.y and plrMouse.Y <= guiPosition.y + guiSize.y then
  6946.         return true
  6947.     else
  6948.         return false
  6949.     end
  6950. end
  6951.  
  6952. function AddZeros(num,reach)
  6953.     local toConvert = tostring(num)
  6954.     while #toConvert < reach do
  6955.         toConvert = " "..toConvert
  6956.     end
  6957.     return toConvert
  6958. end
  6959.  
  6960. function buildScript(source,xOff,yOff,override)
  6961.     local buildingRows = true
  6962.     local buildScr = source
  6963.    
  6964.     local totalLines = 0
  6965.    
  6966.     --print(xOff,yOff)
  6967.    
  6968.     if currentSource ~= source then
  6969.         currentSource = source
  6970.     end
  6971.  
  6972.     if override then
  6973.         currentSource = source
  6974.         entries = {}
  6975.         while buildingRows do
  6976.             local x,y = string.find(buildScr,"\n")
  6977.             if x and y then
  6978.                 table.insert(entries,string.sub(buildScr,1,y))
  6979.                 buildScr = string.sub(buildScr,y+1,string.len(buildScr))
  6980.             else
  6981.                 buildingRows = false
  6982.                 table.insert(entries,buildScr)
  6983.             end
  6984.         end
  6985.     end
  6986.    
  6987.     totalLines = #entries
  6988.     lineSpan = #tostring(totalLines)
  6989.    
  6990.     if lineSpan == 1 then lineSpan = 2 end
  6991.    
  6992.     local currentRow = 1
  6993.     local currentColumn = 2 + lineSpan
  6994.    
  6995.     local colorTime = 0
  6996.     local colorReplace = nil
  6997.    
  6998.     local inString = false
  6999.    
  7000.     local workingEntries = entries
  7001.    
  7002.     --[[
  7003.     for i,v in pairs(entries) do
  7004.         table.insert(workingEntries,v)
  7005.     end
  7006.    
  7007.     for i = 1,yOff do
  7008.         table.remove(workingEntries,1)
  7009.     end
  7010.     --]]
  7011.    
  7012.     local delayance = xOff
  7013.  
  7014.     for i = 1,#grid do
  7015.         for j = 1,#grid[i] do
  7016.             if i <= lineSpan then
  7017.                 local newNum = AddZeros(yOff + j,lineSpan)
  7018.                 local newDigit =  string.sub(newNum,i,i)
  7019.                 if newDigit == " " then
  7020.                     grid[i][j].Text = ""
  7021.                 else
  7022.                     grid[i][j].Text = newDigit
  7023.                 end
  7024.                 grid[i][j].BackgroundTransparency = 0
  7025.                 grid[i][j].BackgroundColor3 = Color3.new(163/255, 162/255, 165/255)
  7026.                 --grid[i][j].Font = Enum.Font.SourceSansBold
  7027.             elseif i == lineSpan + 1 then
  7028.                 grid[i][j].Text = ""
  7029.                 grid[i][j].BackgroundTransparency = 0
  7030.                 grid[i][j].BackgroundColor3 = Color3.new(200/255, 200/255, 200/255)
  7031.                 --grid[i][j].Font = Enum.Font.SourceSans
  7032.             else
  7033.                 grid[i][j].Text = ""
  7034.                 grid[i][j].BackgroundTransparency = 1
  7035.                 --grid[i][j].Font = Enum.Font.SourceSans
  7036.             end
  7037.         end
  7038.     end
  7039.    
  7040.     while true do
  7041.         if currentRow > #workingEntries or currentRow > #grid[1] then break end
  7042.         local entry = workingEntries[currentRow+yOff]
  7043.         while string.len(entry) > 0 do
  7044.             if string.sub(entry,1,1) == "\t" then entry = "    "..string.sub(entry,2) end
  7045.            
  7046.             if currentColumn > #grid then break end
  7047.            
  7048.             if delayance == 0 then
  7049.                 grid[currentColumn][currentRow].Text = string.sub(entry,1,1)
  7050.             end
  7051.            
  7052.             -- Coloring
  7053.            
  7054.             if not inString then
  7055.                 for i,v in pairs(syntaxHighlightList) do
  7056.                     if string.sub(entry,1,string.len(v["Keyword"])) == v["Keyword"] then
  7057.                         if v["Independent"] then
  7058.                             local outCheck = string.len(v["Keyword"])+1
  7059.                             local outEntry = string.sub(entry,outCheck,outCheck)
  7060.                             if not string.find(outEntry,"%w") then
  7061.                                 colorTime = string.len(v["Keyword"])
  7062.                                 colorReplace = v["Color"]
  7063.                             end
  7064.                         else
  7065.                             colorTime = string.len(v["Keyword"])
  7066.                             colorReplace = v["Color"]
  7067.                         end
  7068.                     end
  7069.                 end
  7070.             end
  7071.            
  7072.             if string.sub(entry,1,1) == "\"" and string.match(entry,"\".+\"") then
  7073.                 inString = true
  7074.                 colorTime = string.len(string.match(entry,"\".+\""))
  7075.                 colorReplace = Color3.new(170/255, 0, 1)
  7076.             end
  7077.            
  7078.             if colorTime > 0 then
  7079.                 colorTime = colorTime - 1
  7080.                 grid[currentColumn][currentRow].TextColor3 = colorReplace
  7081.                 if colorTime == 0 then inString = false end
  7082.             else
  7083.                 grid[currentColumn][currentRow].TextColor3 = Color3.new(0,0,0)
  7084.                 inString = false
  7085.             end
  7086.            
  7087.             if delayance == 0 then
  7088.                 currentColumn = currentColumn + 1
  7089.             else
  7090.                 delayance = delayance - 1
  7091.             end
  7092.             entry = string.sub(entry,2,string.len(entry))
  7093.         end
  7094.         currentRow = currentRow + 1
  7095.         currentColumn = 2 + lineSpan
  7096.         colorTime = 0
  7097.         delayance = xOff
  7098.         inString = false
  7099.     end
  7100. end
  7101.  
  7102. function scrollBar.UpdateCallback(self)
  7103.     scrollBar.TotalSpace = #entries * 16
  7104.     scrollBar.VisibleSpace = editorGrid.AbsoluteSize.Y
  7105.     buildScript(currentSource,math.floor(scrollBarH.ScrollIndex/8),math.floor(scrollBar.ScrollIndex/16))
  7106. end
  7107.  
  7108. function scrollBarH.UpdateCallback(self)
  7109.     scrollBarH.TotalSpace = (getLongestEntry(entries) + 1 + lineSpan) * 8
  7110.     scrollBarH.VisibleSpace = editorGrid.AbsoluteSize.X
  7111.     buildScript(currentSource,math.floor(scrollBarH.ScrollIndex/8),math.floor(scrollBar.ScrollIndex/16))
  7112. end
  7113.  
  7114. function getLongestEntry(tab)
  7115.     local longest = 0
  7116.     for i,v in pairs(tab) do
  7117.         if string.len(v) > longest then
  7118.             longest = string.len(v)
  7119.         end
  7120.     end
  7121.     return longest
  7122. end
  7123.  
  7124. function openScript(scrObj)
  7125.     if scrObj:IsA("LocalScript") then
  7126.         scrObj.Archivable = true
  7127.         scrObj = scrObj:Clone()
  7128.         scrObj.Disabled = true
  7129.     end
  7130.    
  7131.     local scrName = scrObj.Name
  7132.     local scrSource = decompile(scrObj)
  7133.    
  7134.     table.insert(memoryScripts,{Name = scrName,Source = scrSource})
  7135.    
  7136.     local newTab = entryTemplate:Clone()
  7137.     newTab.Button.Text = scrName
  7138.     newTab.Position = UDim2.new(0,#scriptBar:GetChildren() * 100,0,0)
  7139.     newTab.Visible = true
  7140.    
  7141.     newTab.Button.MouseButton1Down:connect(function()
  7142.         for i,v in pairs(scriptBar:GetChildren()) do
  7143.             if v == newTab then
  7144.                 editingIndex = i
  7145.                 buildScript(memoryScripts[i].Source,0,0,true)
  7146.                 scrollBar:ScrollTo(1)
  7147.                 scrollBar:Update()
  7148.                 scrollBarH:ScrollTo(1)
  7149.                 scrollBarH:Update()
  7150.             end
  7151.         end
  7152.     end)
  7153.    
  7154.     newTab.Close.MouseButton1Click:connect(function()
  7155.         for i,v in pairs(scriptBar:GetChildren()) do
  7156.             if v == newTab then
  7157.                 table.remove(memoryScripts,i)
  7158.                 if editingIndex == i then
  7159.                     editingIndex = #memoryScripts
  7160.                     if editingIndex > 0 then
  7161.                         buildScript(memoryScripts[#memoryScripts].Source,0,0,true)
  7162.                     else
  7163.                         buildScript("",0,0,true)
  7164.                     end
  7165.                 end
  7166.                
  7167.                 scrollBar:ScrollTo(1)
  7168.                 scrollBar:Update()
  7169.                 scrollBarH:ScrollTo(1)
  7170.                 scrollBarH:Update()
  7171.                
  7172.                 for i2 = i,#scriptBar:GetChildren() do
  7173.                     scriptBar:GetChildren()[i2].Position = scriptBar:GetChildren()[i2].Position + UDim2.new(0,-100,0,0)
  7174.                 end
  7175.                 if editingIndex > i then
  7176.                     editingIndex = editingIndex - 1
  7177.                 end
  7178.                 newTab:Destroy()
  7179.             end
  7180.         end
  7181.     end)
  7182.    
  7183.     editingIndex = #memoryScripts
  7184.     buildScript(scrSource,0,0,true)
  7185.    
  7186.     newTab.Parent = scriptBar
  7187. end
  7188.  
  7189. function updateScriptBar()
  7190.     local entryCount = 0
  7191.    
  7192.     scriptBarLeft.Active = false
  7193.     scriptBarLeft.AutoButtonColor = false
  7194.     for i,v in pairs(scriptBarLeft["Arrow Graphic"]:GetChildren()) do
  7195.         v.BackgroundTransparency = 0.7
  7196.     end
  7197.     scriptBarRight.Active = false
  7198.     scriptBarRight.AutoButtonColor = false
  7199.     for i,v in pairs(scriptBarRight["Arrow Graphic"]:GetChildren()) do
  7200.         v.BackgroundTransparency = 0.7
  7201.     end
  7202.     for i,v in pairs(scriptBar:GetChildren()) do
  7203.         if v.Position.X.Offset < 0 then
  7204.             scriptBarLeft.Active = true
  7205.             scriptBarLeft.AutoButtonColor = true
  7206.             for i,v in pairs(scriptBarLeft["Arrow Graphic"]:GetChildren()) do
  7207.                 v.BackgroundTransparency = 0
  7208.             end
  7209.         elseif v.Position.X.Offset >= 0 then
  7210.             entryCount = entryCount + 1
  7211.             if entryCount == 5 then
  7212.                 scriptBarRight.Active = true
  7213.                 scriptBarRight.AutoButtonColor = true
  7214.                 for i,v in pairs(scriptBarRight["Arrow Graphic"]:GetChildren()) do
  7215.                     v.BackgroundTransparency = 0
  7216.                 end
  7217.             end
  7218.         end
  7219.     end
  7220. end
  7221.  
  7222. scriptBar.ChildAdded:connect(updateScriptBar)
  7223. scriptBar.ChildRemoved:connect(updateScriptBar)
  7224.  
  7225. scriptBarLeft.MouseButton1Click:connect(function()
  7226.     if scriptBarLeft.Active == false then return end
  7227.     for i,v in pairs(scriptBar:GetChildren()) do
  7228.         v.Position = v.Position + UDim2.new(0,100,0,0)
  7229.     end
  7230.     updateScriptBar()
  7231. end)
  7232.  
  7233. scriptBarRight.MouseButton1Click:connect(function()
  7234.     if scriptBarRight.Active == false then return end
  7235.     for i,v in pairs(scriptBar:GetChildren()) do
  7236.         v.Position = v.Position + UDim2.new(0,-100,0,0)
  7237.     end
  7238.     updateScriptBar()
  7239. end)
  7240.  
  7241. mouse.Button1Down:connect(function()
  7242.     if checkMouseInGui(editorGrid) then
  7243.         --print("LETS EDIT!")
  7244.     end
  7245. end)
  7246.  
  7247. openEvent.Event:connect(function(...)
  7248.     top.Visible = true
  7249.     local args = {...}
  7250.     if #args > 0 then
  7251.         openScript(args[1])
  7252.     end
  7253. end)
  7254.  
  7255. clipboardButton.MouseButton1Click:connect(function()
  7256.     if Clipboard and Clipboard.set then
  7257.         Clipboard.set(currentSource)
  7258.     elseif CopyString then
  7259.         CopyString(currentSource)
  7260.     end
  7261. end)
  7262.  
  7263. closeButton.MouseButton1Click:connect(function()
  7264.     top.Visible = false
  7265. end)
  7266.  
  7267. --[[
  7268. local scr = script.Parent:WaitForChild("Scr")
  7269. local scr2 = script.Parent:WaitForChild("Scr2")
  7270. local scr3 = script.Parent:WaitForChild("Scr3")
  7271. local scr4 = script.Parent:WaitForChild("TOS")
  7272. local scr5 = script.Parent:WaitForChild("HW")
  7273. --]]
  7274.  
  7275. buildScript("",0,0,true)
  7276. --[[
  7277. openScript(scr)
  7278. openScript(scr2)
  7279. openScript(scr3)
  7280. openScript(scr4)
  7281. openScript(scr5)
  7282. --]]
  7283.  
  7284. scrollBar:Update()
  7285. scrollBarH:Update()
  7286. end)
Add Comment
Please, Sign In to add comment