Marty2000

Customized Dex Explorer

May 7th, 2024 (edited)
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 138.40 KB | Gaming | 0 0
  1. -- initial states
  2. local Option = {
  3.     -- can modify object parents in the hierarchy
  4.     Modifiable = false;
  5.     -- can select objects
  6.     Selectable = true;
  7. }
  8.  
  9. print = function(...)
  10.     -- lol
  11. end
  12.  
  13. local fullListCustom = {
  14.     ["Vector3Value"] = "rbxassetid://8425127573",
  15.     ["BevelMesh"] = "rbxassetid://8425128737",
  16.     ["ImporterGroupSettings"] = "rbxassetid://8425128737",
  17.     ["PluginGuiService"] = "rbxassetid://8425128737",
  18.     ["NetworkSettings"] = "rbxassetid://8425128737",
  19.     ["StarterGui"] = "rbxassetid://8425118169",
  20.     ["Accoutrement"] = "rbxassetid://8425128737",
  21.     ["Vector3Curve"] = "rbxassetid://8425128737",
  22.     ["LuaSourceContainer"] = "rbxassetid://8425128737",
  23.     ["GuiMain"] = "rbxassetid://8425128737",
  24.     ["VectorForce"] = "rbxassetid://8425243159",
  25.     ["HumanoidController"] = "rbxassetid://8425128737",
  26.     ["MeshContentProvider"] = "rbxassetid://8425128737",
  27.     ["Handles"] = "rbxassetid://8425200671",
  28.     ["ReflectionMetadataClasses"] = "rbxassetid://8425128737",
  29.     ["ValueBase"] = "rbxassetid://8425127573",
  30.     ["Hole"] = "rbxassetid://8425128737",
  31.     ["CSGDictionaryService"] = "rbxassetid://8425128737",
  32.     ["UIScale"] = "rbxassetid://8425122723",
  33.     ["CFrameValue"] = "rbxassetid://8425127573",
  34.     ["ImageLabel"] = "rbxassetid://8425201557",
  35.     ["StarterPlayer"] = "rbxassetid://8425195182",
  36.     ["DebuggerConnectionManager"] = "rbxassetid://8425128737",
  37.     ["PluginManagerInterface"] = "rbxassetid://8425128737",
  38.     ["UIListLayout"] = "rbxassetid://8425122723",
  39.     ["SessionService"] = "rbxassetid://8425128737",
  40.     ["CoreGui"] = "rbxassetid://8425118169",
  41.     ["ReflectionMetadataEvents"] = "rbxassetid://8425128737",
  42.     ["BindableEvent"] = "rbxassetid://8425197545",
  43.     ["SelectionPartLasso"] = "rbxassetid://8425128737",
  44.     ["DataModel"] = "rbxassetid://8425128737",
  45.     ["TouchInputService"] = "rbxassetid://8425128737",
  46.     ["PhysicsSettings"] = "rbxassetid://8425128737",
  47.     ["CSGCacheService"] = "rbxassetid://8425128737",
  48.     ["TextSource"] = "rbxassetid://8425128737",
  49.     ["OrderedDataStore"] = "rbxassetid://8425128737",
  50.     ["SocialService"] = "rbxassetid://8425128737",
  51.     ["RenderingTest"] = "rbxassetid://8425128737",
  52.     ["RunService"] = "rbxassetid://8425128737",
  53.     ["TemporaryCageMeshProvider"] = "rbxassetid://8425128737",
  54.     ["HumanoidDescription"] = "rbxassetid://8425242662",
  55.     ["KeyframeSequence"] = "rbxassetid://8425128737",
  56.     ["MessageBusService"] = "rbxassetid://8425128737",
  57.     ["ServerScriptService"] = "rbxassetid://8425196793",
  58.     ["BillboardGui"] = "rbxassetid://8425198318",
  59.     ["Feature"] = "rbxassetid://8425128737",
  60.     ["CustomDspSoundEffect"] = "rbxassetid://8425247111",
  61.     ["MarketplaceService"] = "rbxassetid://8425128737",
  62.     ["Team"] = "rbxassetid://8425123006",
  63.     ["AppStorageService"] = "rbxassetid://8425128737",
  64.     ["FlangeSoundEffect"] = "rbxassetid://8425247111",
  65.     ["EchoSoundEffect"] = "rbxassetid://8425247111",
  66.     ["MemoryStoreSortedMap"] = "rbxassetid://8425128737",
  67.     ["NetworkPeer"] = "rbxassetid://8425128737",
  68.     ["AdvancedDragger"] = "rbxassetid://8425128737",
  69.     ["Teams"] = "rbxassetid://8425123177",
  70.     ["PointsService"] = "rbxassetid://8425128737",
  71.     ["GuiBase"] = "rbxassetid://8425128737",
  72.     ["BodyGyro"] = "rbxassetid://8425125550",
  73.     ["WrapLayer"] = "rbxassetid://8425262027",
  74.     ["Path"] = "rbxassetid://8425128737",
  75.     ["GuiLabel"] = "rbxassetid://8425128737",
  76.     ["ReflectionMetadataFunctions"] = "rbxassetid://8425128737",
  77.     ["WeldConstraint"] = "rbxassetid://8425245086",
  78.     ["Folder"] = "rbxassetid://8425195649",
  79.     ["TriangleMeshPart"] = "rbxassetid://8425128556",
  80.     ["LuaSettings"] = "rbxassetid://8425128737",
  81.     ["FlagStand"] = "rbxassetid://8425119830",
  82.     ["PartOperationAsset"] = "rbxassetid://8425128737",
  83.     ["ABTestService"] = "rbxassetid://8425128737",
  84.     ["Explosion"] = "rbxassetid://8425120522",
  85.     ["BlockMesh"] = "rbxassetid://8425126746",
  86.     ["SkateboardController"] = "rbxassetid://8425128737",
  87.     ["TextLabel"] = "rbxassetid://8425201387",
  88.     ["Constraint"] = "rbxassetid://8425128737",
  89.     ["BindableFunction"] = "rbxassetid://8425197788",
  90.     ["ReflectionMetadataCallbacks"] = "rbxassetid://8425128737",
  91.     ["ImageHandleAdornment"] = "rbxassetid://8425241923",
  92.     ["AnalysticsSettings"] = "rbxassetid://8425128737",
  93.     ["RenderSettings"] = "rbxassetid://8425128737",
  94.     ["HSRDataContentProvider"] = "rbxassetid://8425128737",
  95.     ["DataModelSession"] = "rbxassetid://8425128737",
  96.     ["ObjectValue"] = "rbxassetid://8425127573",
  97.     ["AssetCounterService"] = "rbxassetid://8425128737",
  98.     ["VRService"] = "rbxassetid://8425128737",
  99.     ["TotalCountTimeIntervalItem"] = "rbxassetid://8425128737",
  100.     ["ReflectionMetadataEnum"] = "rbxassetid://8425128737",
  101.     ["LegacyStudioBridge"] = "rbxassetid://8425128737",
  102.     ["FaceInstance"] = "rbxassetid://8425128737",
  103.     ["Plane"] = "rbxassetid://8425128737",
  104.     ["ColorCorrectionEffect"] = "rbxassetid://8425194473",
  105.     ["Atmosphere"] = "rbxassetid://8425122290",
  106.     ["CookiesService"] = "rbxassetid://8425128737",
  107.     ["RopeConstraint"] = "rbxassetid://8425246189",
  108.     ["SelectionBox"] = "rbxassetid://8425200469",
  109.     ["PolicyService"] = "rbxassetid://8425128737",
  110.     ["NetworkReplicator"] = "rbxassetid://8425122066",
  111.     ["IncrementalPatchBuilder"] = "rbxassetid://8425128737",
  112.     ["MultipleDocumentInterfaceInstance"] = "rbxassetid://8425128737",
  113.     ["StarterGear"] = "rbxassetid://8425128737",
  114.     ["Controller"] = "rbxassetid://8425128737",
  115.     ["PausedState"] = "rbxassetid://8425128737",
  116.     ["PathfindingService"] = "rbxassetid://8425128737",
  117.     ["LayerCollector"] = "rbxassetid://8425128737",
  118.     ["Geometry"] = "rbxassetid://8425128737",
  119.     ["ManualWeld"] = "rbxassetid://8425128737",
  120.     ["PackageUIService"] = "rbxassetid://8425128737",
  121.     ["TremoloSoundEffect"] = "rbxassetid://8425247111",
  122.     ["PoseBase"] = "rbxassetid://8425128737",
  123.     ["Status"] = "rbxassetid://8425128737",
  124.     ["Pose"] = "rbxassetid://8425128737",
  125.     ["Hat"] = "rbxassetid://8425118446",
  126.     ["KeyboardService"] = "rbxassetid://8425128737",
  127.     ["WrapTarget"] = "rbxassetid://8425261894",
  128.     ["HingeConstraint"] = "rbxassetid://8425246580",
  129.     ["WorldRoot"] = "rbxassetid://8425128737",
  130.     ["ContentProvider"] = "rbxassetid://8425128737",
  131.     ["PathfindingLink"] = "rbxassetid://8425128737",
  132.     ["BadgeService"] = "rbxassetid://8425128737",
  133.     ["Humanoid"] = "rbxassetid://8425126558",
  134.     ["MemStorageConnection"] = "rbxassetid://8425128737",
  135.     ["CylinderHandleAdornment"] = "rbxassetid://8425241717",
  136.     ["RunningAverageItemDouble"] = "rbxassetid://8425128737",
  137.     ["EulerRotationCurve"] = "rbxassetid://8425128737",
  138.     ["Attachment"] = "rbxassetid://8425194873",
  139.     ["MetaBreakpoint"] = "rbxassetid://8425128737",
  140.     ["BodyMover"] = "rbxassetid://8425125550",
  141.     ["AssetService"] = "rbxassetid://8425128737",
  142.     ["LocalStorageService"] = "rbxassetid://8425128737",
  143.     ["RobloxPluginGuiService"] = "rbxassetid://8425128737",
  144.     ["ImageButton"] = "rbxassetid://8425200895",
  145.     ["GuiBase2d"] = "rbxassetid://8425128737",
  146.     ["NumberValue"] = "rbxassetid://8425127573",
  147.     ["CylindricalConstraint"] = "rbxassetid://8425244860",
  148.     ["PluginMenu"] = "rbxassetid://8425128737",
  149.     ["CollectionService"] = "rbxassetid://8425128737",
  150.     ["Configuration"] = "rbxassetid://8425199604",
  151.     ["Accessory"] = "rbxassetid://8425121531",
  152.     ["LineForce"] = "rbxassetid://8425243522",
  153.     ["KeyframeMarker"] = "rbxassetid://8425128737",
  154.     ["ReflectionMetadataMember"] = "rbxassetid://8425128737",
  155.     ["HopperBin"] = "rbxassetid://8425123549",
  156.     ["FlyweightService"] = "rbxassetid://8425128737",
  157.     ["MotorFeature"] = "rbxassetid://8425128737",
  158.     ["DataStoreSetOptions"] = "rbxassetid://8425128737",
  159.     ["ReflectionMetadataYieldFunctions"] = "rbxassetid://8425128737",
  160.     ["ReplicatedStorage"] = "rbxassetid://8425197003",
  161.     ["SurfaceSelection"] = "rbxassetid://8425200291",
  162.     ["FriendPages"] = "rbxassetid://8425128737",
  163.     ["StarterPack"] = "rbxassetid://8425128737",
  164.     ["ImporterMeshSettings"] = "rbxassetid://8425128737",
  165.     ["DynamicRotate"] = "rbxassetid://8425128737",
  166.     ["ArcHandles"] = "rbxassetid://8425200106",
  167.     ["Players"] = "rbxassetid://8425538254",
  168.     ["DataStore"] = "rbxassetid://8425128737",
  169.     ["BaseScript"] = "rbxassetid://8425128737",
  170.     ["UserStorageService"] = "rbxassetid://8425128737",
  171.     ["VehicleController"] = "rbxassetid://8425128737",
  172.     ["AssetImportService"] = "rbxassetid://8425128737",
  173.     ["RunningAverageTimeIntervalItem"] = "rbxassetid://8425128737",
  174.     ["PlayerEmulatorService"] = "rbxassetid://8425128737",
  175.     ["BasePart"] = "rbxassetid://8425128556",
  176.     ["ToastNotificationService"] = "rbxassetid://8425128737",
  177.     ["DataStoreKeyInfo"] = "rbxassetid://8425128737",
  178.     ["PartAdornment"] = "rbxassetid://8425128737",
  179.     ["TextButton"] = "rbxassetid://8425201165",
  180.     ["PluginToolbar"] = "rbxassetid://8425128737",
  181.     ["ViewportFrame"] = "rbxassetid://8425128737",
  182.     ["ScriptContext"] = "rbxassetid://8425128737",
  183.     ["GenericSettings"] = "rbxassetid://8425128737",
  184.     ["StarterCharacterScripts"] = "rbxassetid://8425128737",
  185.     ["MaterialService"] = "rbxassetid://8425128737",
  186.     ["Dialog"] = "rbxassetid://8425198662",
  187.     ["ThirdPartyUserService"] = "rbxassetid://8425128737",
  188.     ["CacheableContentProvider"] = "rbxassetid://8425128737",
  189.     ["ThreadState"] = "rbxassetid://8425128737",
  190.     ["Dragger"] = "rbxassetid://8425128737",
  191.     ["HeightmapImporterService"] = "rbxassetid://8425128737",
  192.     ["CommandInstance"] = "rbxassetid://8425128737",
  193.     ["Clouds"] = "rbxassetid://8425128737",
  194.     ["ManualGlue"] = "rbxassetid://8425128737",
  195.     ["Seat"] = "rbxassetid://8425120806",
  196.     ["AnimationRigData"] = "rbxassetid://8425199087",
  197.     ["VoiceChatInternal"] = "rbxassetid://8425128737",
  198.     ["Debris"] = "rbxassetid://8425121884",
  199.     ["AvatarImportService"] = "rbxassetid://8425128737",
  200.     ["DebuggerUIService"] = "rbxassetid://8425128737",
  201.     ["LodDataService"] = "rbxassetid://8425128737",
  202.     ["ParticleEmitter"] = "rbxassetid://8425195022",
  203.     ["Flag"] = "rbxassetid://8425120025",
  204.     ["StopWatchReporter"] = "rbxassetid://8425128737",
  205.     ["UserSettings"] = "rbxassetid://8425128737",
  206.     ["MessagingService"] = "rbxassetid://8425128737",
  207.     ["Backpack"] = "rbxassetid://8425124072",
  208.     ["Actor"] = "rbxassetid://8425240974",
  209.     ["NetworkMarker"] = "rbxassetid://8425128737",
  210.     ["LuaWebService"] = "rbxassetid://8425128737",
  211.     ["Sky"] = "rbxassetid://8425122290",
  212.     ["DataStoreKey"] = "rbxassetid://8425128737",
  213.     ["Translator"] = "rbxassetid://8425128737",
  214.     ["UILayout"] = "rbxassetid://8425122723",
  215.     ["FloatCurve"] = "rbxassetid://8425128737",
  216.     ["Chat"] = "rbxassetid://8425128737",
  217.     ["Workspace"] = "rbxassetid://8425124333",
  218.     ["SelectionSphere"] = "rbxassetid://8425200469",
  219.     ["TrussPart"] = "rbxassetid://8425128556",
  220.     ["DataStoreVersionPages"] = "rbxassetid://8425128737",
  221.     ["AssetDeliveryProxy"] = "rbxassetid://8425128737",
  222.     ["RemoteDebuggerServer"] = "rbxassetid://8425128737",
  223.     ["PrismaticConstraint"] = "rbxassetid://8425246405",
  224.     ["TorsionSpringConstraint"] = "rbxassetid://8425128737",
  225.     ["TouchTransmitter"] = "rbxassetid://8425128737",
  226.     ["InventoryPages"] = "rbxassetid://8425128737",
  227.     ["InstanceAdornment"] = "rbxassetid://8425128737",
  228.     ["Fire"] = "rbxassetid://8425198879",
  229.     ["RotationCurve"] = "rbxassetid://8425128737",
  230.     ["ProximityPromptService"] = "rbxassetid://8425128737",
  231.     ["VoiceChannel"] = "rbxassetid://8425128737",
  232.     ["ReplicatedScriptService"] = "rbxassetid://8425128737",
  233.     ["CoreScript"] = "rbxassetid://8425128737",
  234.     ["CylinderMesh"] = "rbxassetid://8425128737",
  235.     ["Weld"] = "rbxassetid://8425128737",
  236.     ["QWidgetPluginGui"] = "rbxassetid://8425128737",
  237.     ["BoolValue"] = "rbxassetid://8425127573",
  238.     ["Pages"] = "rbxassetid://8425128737",
  239.     ["ChangeHistoryService"] = "rbxassetid://8425128737",
  240.     ["ClickDetector"] = "rbxassetid://8425119391",
  241.     ["Instance"] = "rbxassetid://8425128737",
  242.     ["Hopper"] = "rbxassetid://8425128737",
  243.     ["BackpackItem"] = "rbxassetid://8425128737",
  244.     ["SurfaceLight"] = "rbxassetid://8425125743",
  245.     ["Rotate"] = "rbxassetid://8425128737",
  246.     ["Keyframe"] = "rbxassetid://8425128737",
  247.     ["ShirtGraphic"] = "rbxassetid://8425119613",
  248.     ["LocalizationTable"] = "rbxassetid://8425244380",
  249.     ["PublishService"] = "rbxassetid://8425128737",
  250.     ["PluginMouse"] = "rbxassetid://8425128737",
  251.     ["BrickColorValue"] = "rbxassetid://8425127573",
  252.     ["AdService"] = "rbxassetid://8425128737",
  253.     ["WorldModel"] = "rbxassetid://8425128737",
  254.     ["PluginDebugService"] = "rbxassetid://8425128737",
  255.     ["CharacterAppearance"] = "rbxassetid://8425128737",
  256.     ["SelectionLasso"] = "rbxassetid://8425199900",
  257.     ["Stats"] = "rbxassetid://8425128737",
  258.     ["MessageBusConnection"] = "rbxassetid://8425128737",
  259.     ["Smoke"] = "rbxassetid://8425199288",
  260.     ["KeyframeSequenceProvider"] = "rbxassetid://8425128737",
  261.     ["TextBoxService"] = "rbxassetid://8425128737",
  262.     ["InputObject"] = "rbxassetid://8425128737",
  263.     ["NotificationService"] = "rbxassetid://8425128737",
  264.     ["Torque"] = "rbxassetid://8425242864",
  265.     ["BulkImportService"] = "rbxassetid://8425128737",
  266.     ["UniversalConstraint"] = "rbxassetid://8425261741",
  267.     ["PointLight"] = "rbxassetid://8425125743",
  268.     ["TweenBase"] = "rbxassetid://8425128737",
  269.     ["DoubleConstrainedValue"] = "rbxassetid://8425127573",
  270.     ["RocketPropulsion"] = "rbxassetid://8425128737",
  271.     ["CoreScriptSyncService"] = "rbxassetid://8425128737",
  272.     ["CanvasGroup"] = "rbxassetid://8425128737",
  273.     ["ReplicatedFirst"] = "rbxassetid://8425128737",
  274.     ["SpotLight"] = "rbxassetid://8425125743",
  275.     ["NegateOperation"] = "rbxassetid://8425196543",
  276.     ["CommandService"] = "rbxassetid://8425128737",
  277.     ["ChorusSoundEffect"] = "rbxassetid://8425247111",
  278.     ["Tool"] = "rbxassetid://8425124723",
  279.     ["Texture"] = "rbxassetid://8425126339",
  280.     ["Breakpoint"] = "rbxassetid://8425128737",
  281.     ["Script"] = "rbxassetid://8425127126",
  282.     ["Terrain"] = "rbxassetid://8425198124",
  283.     ["DataStoreInfo"] = "rbxassetid://8425128737",
  284.     ["ReflectionMetadataProperties"] = "rbxassetid://8425128737",
  285.     ["TextBox"] = "rbxassetid://8425128737",
  286.     ["DebuggerLuaResponse"] = "rbxassetid://8425128737",
  287.     ["FunctionalTest"] = "rbxassetid://8425128737",
  288.     ["DataModelPatchService"] = "rbxassetid://8425128737",
  289.     ["MouseService"] = "rbxassetid://8425128737",
  290.     ["LodDataEntity"] = "rbxassetid://8425128737",
  291.     ["UITextSizeConstraint"] = "rbxassetid://8425122723",
  292.     ["ReflectionMetadata"] = "rbxassetid://8425128737",
  293.     ["DataStoreKeyPages"] = "rbxassetid://8425128737",
  294.     ["NoCollisionConstraint"] = "rbxassetid://8425242510",
  295.     ["UIAspectRatioConstraint"] = "rbxassetid://8425122723",
  296.     ["RodConstraint"] = "rbxassetid://8425245873",
  297.     ["FileMesh"] = "rbxassetid://8425128737",
  298.     ["Shirt"] = "rbxassetid://8425118944",
  299.     ["SlidingBallConstraint"] = "rbxassetid://8425128737",
  300.     ["VirtualInputManager"] = "rbxassetid://8425128737",
  301.     ["GlobalDataStore"] = "rbxassetid://8425128737",
  302.     ["SolidModelContentProvider"] = "rbxassetid://8425128737",
  303.     ["SkateboardPlatform"] = "rbxassetid://8425128737",
  304.     ["DebuggerWatch"] = "rbxassetid://8425128737",
  305.     ["DataModelMesh"] = "rbxassetid://8425128737",
  306.     ["UGCValidationService"] = "rbxassetid://8425128737",
  307.     ["StudioScriptDebugEventListener"] = "rbxassetid://8425128737",
  308.     ["BaseWrap"] = "rbxassetid://8425128737",
  309.     ["Mouse"] = "rbxassetid://8425128737",
  310.     ["NonReplicatedCSGDictionaryService"] = "rbxassetid://8425128737",
  311.     ["Decal"] = "rbxassetid://8425126929",
  312.     ["ModuleScript"] = "rbxassetid://8425195794",
  313.     ["CharacterMesh"] = "rbxassetid://8425199087",
  314.     ["GuidRegistryService"] = "rbxassetid://8425128737",
  315.     ["GameSettings"] = "rbxassetid://8425128737",
  316.     ["MetaBreakpointContext"] = "rbxassetid://8425128737",
  317.     ["HandlesBase"] = "rbxassetid://8425128737",
  318.     ["PluginManager"] = "rbxassetid://8425128737",
  319.     ["AssetManagerService"] = "rbxassetid://8425128737",
  320.     ["PlayerScripts"] = "rbxassetid://8425195358",
  321.     ["FriendService"] = "rbxassetid://8425128737",
  322.     ["Speaker"] = "rbxassetid://8425128737",
  323.     ["UISizeConstraint"] = "rbxassetid://8425122723",
  324.     ["PVInstance"] = "rbxassetid://8425128737",
  325.     ["ILegacyStudioBridge"] = "rbxassetid://8425128737",
  326.     ["SurfaceAppearance"] = "rbxassetid://8425128737",
  327.     ["VehicleSeat"] = "rbxassetid://8425128737",
  328.     ["DebugSettings"] = "rbxassetid://8425128737",
  329.     ["ServerStorage"] = "rbxassetid://8425197217",
  330.     ["IntValue"] = "rbxassetid://8425127573",
  331.     ["FloorWire"] = "rbxassetid://8425128737",
  332.     ["LuauScriptAnalyzerService"] = "rbxassetid://8425128737",
  333.     ["LanguageService"] = "rbxassetid://8425128737",
  334.     ["CornerWedgePart"] = "rbxassetid://8425128556",
  335.     ["UIGridLayout"] = "rbxassetid://8425122723",
  336.     ["GlobalSettings"] = "rbxassetid://8425128737",
  337.     ["TestService"] = "rbxassetid://8425197356",
  338.     ["SoundGroup"] = "rbxassetid://8425246885",
  339.     ["GuiObject"] = "rbxassetid://8425128737",
  340.     ["SunRaysEffect"] = "rbxassetid://8425194473",
  341.     ["CorePackages"] = "rbxassetid://8425128737",
  342.     ["DraftsService"] = "rbxassetid://8425128737",
  343.     ["RunningAverageItemInt"] = "rbxassetid://8425128737",
  344.     ["PlayerMouse"] = "rbxassetid://8425128737",
  345.     ["AnalyticsService"] = "rbxassetid://8425128737",
  346.     ["PluginAction"] = "rbxassetid://8425128737",
  347.     ["AlignPosition"] = "rbxassetid://8425243989",
  348.     ["InsertService"] = "rbxassetid://8425128737",
  349.     ["Message"] = "rbxassetid://8425128737",
  350.     ["Player"] = "rbxassetid://8425125912",
  351.     ["ImporterJointSettings"] = "rbxassetid://8425128737",
  352.     ["File"] = "rbxassetid://8425128737",
  353.     ["OutfitPages"] = "rbxassetid://8425128737",
  354.     ["ManualSurfaceJointInstance"] = "rbxassetid://8425128737",
  355.     ["Highlight"] = "rbxassetid://8425260140",
  356.     ["MeshPart"] = "rbxassetid://8425128556",
  357.     ["AngularVelocity"] = "rbxassetid://8425128737",
  358.     ["Light"] = "rbxassetid://8425125743",
  359.     ["RobloxReplicatedStorage"] = "rbxassetid://8425128737",
  360.     ["ImporterRootSettings"] = "rbxassetid://8425128737",
  361.     ["ScriptService"] = "rbxassetid://8425128737",
  362.     ["HapticService"] = "rbxassetid://8425128737",
  363.     ["TeleportAsyncResult"] = "rbxassetid://8425128737",
  364.     ["DialogChoice"] = "rbxassetid://8425198503",
  365.     ["PackageService"] = "rbxassetid://8425128737",
  366.     ["EmotesPages"] = "rbxassetid://8425128737",
  367.     ["AnimationController"] = "rbxassetid://8425199087",
  368.     ["AvatarEditorService"] = "rbxassetid://8425128737",
  369.     ["Skin"] = "rbxassetid://8425128737",
  370.     ["Pants"] = "rbxassetid://8425118713",
  371.     ["Animation"] = "rbxassetid://8425199087",
  372.     ["RuntimeScriptService"] = "rbxassetid://8425128737",
  373.     ["HttpService"] = "rbxassetid://8425128737",
  374.     ["ReflectionMetadataClass"] = "rbxassetid://8425128737",
  375.     ["VoiceChatService"] = "rbxassetid://8425128737",
  376.     ["StudioService"] = "rbxassetid://8425128737",
  377.     ["Model"] = "rbxassetid://8425128273",
  378.     ["VirtualUser"] = "rbxassetid://8425128737",
  379.     ["VersionControlService"] = "rbxassetid://8425128737",
  380.     ["Snap"] = "rbxassetid://8425128737",
  381.     ["BodyAngularVelocity"] = "rbxassetid://8425125550",
  382.     ["VelocityMotor"] = "rbxassetid://8425128737",
  383.     ["StringValue"] = "rbxassetid://8425127573",
  384.     ["UIConstraint"] = "rbxassetid://8425122723",
  385.     ["IntConstrainedValue"] = "rbxassetid://8425127573",
  386.     ["Part"] = "rbxassetid://8425128556",
  387.     ["LineHandleAdornment"] = "rbxassetid://8425242061",
  388.     ["BinaryStringValue"] = "rbxassetid://8425127573",
  389.     ["StandardPages"] = "rbxassetid://8425128737",
  390.     ["UserService"] = "rbxassetid://8425128737",
  391.     ["UserInputService"] = "rbxassetid://8425128737",
  392.     ["UserGameSettings"] = "rbxassetid://8425128737",
  393.     ["UnvalidatedAssetService"] = "rbxassetid://8425128737",
  394.     ["DebuggerManager"] = "rbxassetid://8425128737",
  395.     ["TeleportOptions"] = "rbxassetid://8425128737",
  396.     ["TeleportService"] = "rbxassetid://8425128737",
  397.     ["Hint"] = "rbxassetid://8425128737",
  398.     ["DraggerService"] = "rbxassetid://8425128737",
  399.     ["BrowserService"] = "rbxassetid://8425128737",
  400.     ["TweenService"] = "rbxassetid://8425128737",
  401.     ["UIGridStyleLayout"] = "rbxassetid://8425122723",
  402.     ["MemoryStoreQueue"] = "rbxassetid://8425128737",
  403.     ["DataStoreObjectVersionInfo"] = "rbxassetid://8425128737",
  404.     ["RigidConstraint"] = "rbxassetid://8425128737",
  405.     ["RayValue"] = "rbxassetid://8425127573",
  406.     ["RotateP"] = "rbxassetid://8425128737",
  407.     ["PartOperation"] = "rbxassetid://8425128737",
  408.     ["UIComponent"] = "rbxassetid://8425122723",
  409.     ["UIBase"] = "rbxassetid://8425122723",
  410.     ["BodyForce"] = "rbxassetid://8425125550",
  411.     ["UIPageLayout"] = "rbxassetid://8425122723",
  412.     ["MarkerCurve"] = "rbxassetid://8425128737",
  413.     ["GroupService"] = "rbxassetid://8425128737",
  414.     ["Motor6D"] = "rbxassetid://8425242305",
  415.     ["RotateV"] = "rbxassetid://8425128737",
  416.     ["UIPadding"] = "rbxassetid://8425122723",
  417.     ["ToolboxService"] = "rbxassetid://8425128737",
  418.     ["TracerService"] = "rbxassetid://8425128737",
  419.     ["ClusterPacketCache"] = "rbxassetid://8425128737",
  420.     ["ImporterTextureSettings"] = "rbxassetid://8425128737",
  421.     ["EventIngestService"] = "rbxassetid://8425128737",
  422.     ["BallSocketConstraint"] = "rbxassetid://8425246730",
  423.     ["DataStoreService"] = "rbxassetid://8425128737",
  424.     ["StackFrame"] = "rbxassetid://8425128737",
  425.     ["ClientReplicator"] = "rbxassetid://8425128737",
  426.     ["FlagStandService"] = "rbxassetid://8425128737",
  427.     ["UIStroke"] = "rbxassetid://8425122723",
  428.     ["Sound"] = "rbxassetid://8425126142",
  429.     ["PhysicsService"] = "rbxassetid://8425128737",
  430.     ["TimerService"] = "rbxassetid://8425128737",
  431.     ["AnimationTrack"] = "rbxassetid://8425199087",
  432.     ["RemoteEvent"] = "rbxassetid://8425195933",
  433.     ["TextFilterResult"] = "rbxassetid://8425128737",
  434.     ["TextChatService"] = "rbxassetid://8425128737",
  435.     ["TextChannel"] = "rbxassetid://8425128737",
  436.     ["DataStoreIncrementOptions"] = "rbxassetid://8425128737",
  437.     ["BodyPosition"] = "rbxassetid://8425125550",
  438.     ["SurfaceGui"] = "rbxassetid://8425128737",
  439.     ["TemporaryScriptService"] = "rbxassetid://8425128737",
  440.     ["ScreenGui"] = "rbxassetid://8425117892",
  441.     ["DataStoreListingPages"] = "rbxassetid://8425128737",
  442.     ["TerrainRegion"] = "rbxassetid://8425128737",
  443.     ["HandleAdornment"] = "rbxassetid://8425128737",
  444.     ["TaskScheduler"] = "rbxassetid://8425128737",
  445.     ["StudioTheme"] = "rbxassetid://8425128737",
  446.     ["Visit"] = "rbxassetid://8425128737",
  447.     ["ChannelSelectorSoundEffect"] = "rbxassetid://8425247111",
  448.     ["ForceField"] = "rbxassetid://8425120289",
  449.     ["StudioDeviceEmulatorService"] = "rbxassetid://8425128737",
  450.     ["NumberPose"] = "rbxassetid://8425128737",
  451.     ["ControllerService"] = "rbxassetid://8425128737",
  452.     ["DebuggerVariable"] = "rbxassetid://8425128737",
  453.     ["Bone"] = "rbxassetid://8425263479",
  454.     ["StudioData"] = "rbxassetid://8425128737",
  455.     ["BodyVelocity"] = "rbxassetid://8425125550",
  456.     ["CurveAnimation"] = "rbxassetid://8425128737",
  457.     ["InternalContainer"] = "rbxassetid://8425128737",
  458.     ["CatalogPages"] = "rbxassetid://8425128737",
  459.     ["Studio"] = "rbxassetid://8425128737",
  460.     ["Color3Value"] = "rbxassetid://8425127573",
  461.     ["PVAdornment"] = "rbxassetid://8425128737",
  462.     ["PausedStateException"] = "rbxassetid://8425128737",
  463.     ["Platform"] = "rbxassetid://8425128737",
  464.     ["DepthOfFieldEffect"] = "rbxassetid://8425194473",
  465.     ["ScriptRegistrationService"] = "rbxassetid://8425128737",
  466.     ["StatsItem"] = "rbxassetid://8425128737",
  467.     ["PermissionsService"] = "rbxassetid://8425128737",
  468.     ["BodyThrust"] = "rbxassetid://8425125550",
  469.     ["Clothing"] = "rbxassetid://8425128737",
  470.     ["GuiButton"] = "rbxassetid://8425128737",
  471.     ["PlayerGui"] = "rbxassetid://8425118169",
  472.     ["StandalonePluginScripts"] = "rbxassetid://8425128737",
  473.     ["PathfindingModifier"] = "rbxassetid://8425260939",
  474.     ["IXPService"] = "rbxassetid://8425128737",
  475.     ["Frame"] = "rbxassetid://8425201815",
  476.     ["ConfigureServerService"] = "rbxassetid://8425128737",
  477.     ["MaterialVariant"] = "rbxassetid://8425260607",
  478.     ["GoogleAnalyticsConfiguration"] = "rbxassetid://8425128737",
  479.     ["JointsService"] = "rbxassetid://8425128737",
  480.     ["HttpRequest"] = "rbxassetid://8425128737",
  481.     ["SpawnerService"] = "rbxassetid://8425128737",
  482.     ["Sparkles"] = "rbxassetid://8425119133",
  483.     ["AlignOrientation"] = "rbxassetid://8425243741",
  484.     ["SoundService"] = "rbxassetid://8425121749",
  485.     ["SpecialMesh"] = "rbxassetid://8425126746",
  486.     ["GuiBase3d"] = "rbxassetid://8425128737",
  487.     ["SphereHandleAdornment"] = "rbxassetid://8425241156",
  488.     ["Animator"] = "rbxassetid://8425128737",
  489.     ["ReverbSoundEffect"] = "rbxassetid://8425247111",
  490.     ["PitchShiftSoundEffect"] = "rbxassetid://8425247111",
  491.     ["EqualizerSoundEffect"] = "rbxassetid://8425247111",
  492.     ["NetworkServer"] = "rbxassetid://8425125305",
  493.     ["DistortionSoundEffect"] = "rbxassetid://8425247111",
  494.     ["Beam"] = "rbxassetid://8425244609",
  495.     ["StarterPlayerScripts"] = "rbxassetid://8425128737",
  496.     ["Lighting"] = "rbxassetid://8425125743",
  497.     ["CustomEventReceiver"] = "rbxassetid://8425128737",
  498.     ["SoundEffect"] = "rbxassetid://8425247111",
  499.     ["BasePlayerGui"] = "rbxassetid://8425128737",
  500.     ["ParabolaAdornment"] = "rbxassetid://8425128737",
  501.     ["WedgePart"] = "rbxassetid://8425128556",
  502.     ["PausedStateBreakpoint"] = "rbxassetid://8425128737",
  503.     ["Trail"] = "rbxassetid://8425245307",
  504.     ["PluginGui"] = "rbxassetid://8425128737",
  505.     ["UnionOperation"] = "rbxassetid://8425128737",
  506.     ["DockWidgetPluginGui"] = "rbxassetid://8425128737",
  507.     ["AnimationClip"] = "rbxassetid://8425199087",
  508.     ["BodyColors"] = "rbxassetid://8425125550",
  509.     ["ServiceProvider"] = "rbxassetid://8425128737",
  510.     ["DebuggerConnection"] = "rbxassetid://8425128737",
  511.     ["FaceControls"] = "rbxassetid://8425260802",
  512.     ["AnimationClipProvider"] = "rbxassetid://8425199087",
  513.     ["CustomEvent"] = "rbxassetid://8425128737",
  514.     ["MemoryStoreService"] = "rbxassetid://8425128737",
  515.     ["ScriptDebugger"] = "rbxassetid://8425128737",
  516.     ["ScriptChangeService"] = "rbxassetid://8425128737",
  517.     ["VideoFrame"] = "rbxassetid://8425262172",
  518.     ["BloomEffect"] = "rbxassetid://8425194473",
  519.     ["Selection"] = "rbxassetid://8425128737",
  520.     ["Motor"] = "rbxassetid://8425128737",
  521.     ["Glue"] = "rbxassetid://8425128737",
  522.     ["FormFactorPart"] = "rbxassetid://8425128556",
  523.     ["GamepadService"] = "rbxassetid://8425128737",
  524.     ["RemoteFunction"] = "rbxassetid://8425196065",
  525.     ["HttpRbxApiService"] = "rbxassetid://8425128737",
  526.     ["CompressorSoundEffect"] = "rbxassetid://8425247111",
  527.     ["ReflectionMetadataEnumItem"] = "rbxassetid://8425128737",
  528.     ["VoiceSource"] = "rbxassetid://8425128737",
  529.     ["DebuggerBreakpoint"] = "rbxassetid://8425128737",
  530.     ["ReflectionMetadataItem"] = "rbxassetid://8425128737",
  531.     ["LogService"] = "rbxassetid://8425128737",
  532.     ["ReflectionMetadataEnums"] = "rbxassetid://8425128737",
  533.     ["PluginPolicyService"] = "rbxassetid://8425128737",
  534.     ["AppUpdateService"] = "rbxassetid://8425128737",
  535.     ["ScrollingFrame"] = "rbxassetid://8425128737",
  536.     ["RbxAnalyticsService"] = "rbxassetid://8425128737",
  537.     ["GuiService"] = "rbxassetid://8425128737",
  538.     ["SpringConstraint"] = "rbxassetid://8425245639",
  539.     ["ProximityPrompt"] = "rbxassetid://8425261619",
  540.     ["MemStorageService"] = "rbxassetid://8425128737",
  541.     ["HiddenSurfaceRemovalAsset"] = "rbxassetid://8425128737",
  542.     ["Tween"] = "rbxassetid://8425128737",
  543.     ["ProcessInstancePhysicsService"] = "rbxassetid://8425128737",
  544.     ["BlurEffect"] = "rbxassetid://8425194473",
  545.     ["StudioAssetService"] = "rbxassetid://8425128737",
  546.     ["PostEffect"] = "rbxassetid://8425194473",
  547.     ["PluginToolbarButton"] = "rbxassetid://8425128737",
  548.     ["ServerReplicator"] = "rbxassetid://8425128737",
  549.     ["ConeHandleAdornment"] = "rbxassetid://8425241536",
  550.     ["JointInstance"] = "rbxassetid://8425128737",
  551.     ["PluginDragEvent"] = "rbxassetid://8425128737",
  552.     ["SelectionPointLasso"] = "rbxassetid://8425128737",
  553.     ["GamePassService"] = "rbxassetid://8425128737",
  554.     ["Plugin"] = "rbxassetid://8425128737",
  555.     ["TextService"] = "rbxassetid://8425128737",
  556.     ["DataStorePages"] = "rbxassetid://8425128737",
  557.     ["DataStoreOptions"] = "rbxassetid://8425128737",
  558.     ["LoginService"] = "rbxassetid://8425128737",
  559.     ["LocalizationService"] = "rbxassetid://8425245462",
  560.     ["Camera"] = "rbxassetid://8425127348",
  561.     ["LinearVelocity"] = "rbxassetid://8425260294",
  562.     ["UICorner"] = "rbxassetid://8425122723",
  563.     ["SpawnLocation"] = "rbxassetid://8425122855",
  564.     ["NetworkClient"] = "rbxassetid://8425125061",
  565.     ["CalloutService"] = "rbxassetid://8425128737",
  566.     ["UITableLayout"] = "rbxassetid://8425122723",
  567.     ["ImporterBaseSettings"] = "rbxassetid://8425128737",
  568.     ["UIGradient"] = "rbxassetid://8425122723",
  569.     ["ContextActionService"] = "rbxassetid://8425128737",
  570.     ["LocalScript"] = "rbxassetid://8425124511",
  571.     ["BreakpointManager"] = "rbxassetid://8425128737",
  572.     ["BoxHandleAdornment"] = "rbxassetid://8425241336",
  573.     ["PackageLink"] = "rbxassetid://8425244193",
  574. }
  575.  
  576. -- MERELY
  577.  
  578. Option.Modifiable = true
  579.  
  580. -- END MERELY
  581.  
  582. -- general size of GUI objects, in pixels
  583. local GUI_SIZE = 16
  584. -- padding between items within each entry
  585. local ENTRY_PADDING = 1
  586. -- padding between each entry
  587. local ENTRY_MARGIN = 1
  588.  
  589. local explorerPanel = script.Parent
  590. local Input = game:GetService("UserInputService")
  591. local HoldingCtrl = false
  592. local HoldingShift = false
  593.  
  594. local DexOutput = Instance.new("Folder")
  595. DexOutput.Name = "Output"
  596. local DexOutputMain = Instance.new("ScreenGui", DexOutput)
  597. DexOutputMain.Name = "Dex Output"
  598.  
  599. if(not game:GetService("RunService"):IsStudio()) then
  600. function print(...)
  601.     local Obj = Instance.new("Dialog")
  602.     Obj.Parent = DexOutputMain
  603.     Obj.Name = ""
  604.     for i,v in pairs({...}) do
  605.         Obj.Name = Obj.Name .. tostring(v) .. " "
  606.     end
  607.     end
  608.     end
  609.  
  610. --[[
  611.  
  612. # Explorer Panel
  613.  
  614. A GUI panel that displays the game hierarchy.
  615.  
  616.  
  617. ## Selection Bindables
  618.  
  619. - `Function GetSelection ( )`
  620.  
  621.     Returns an array of objects representing the objects currently
  622.     selected in the panel.
  623.  
  624. - `Function SetSelection ( Objects selection )`
  625.  
  626.     Sets the objects that are selected in the panel. `selection` is an array
  627.     of objects.
  628.  
  629. - `Event SelectionChanged ( )`
  630.  
  631.     Fired after the selection changes.
  632.  
  633.  
  634. ## Option Bindables
  635.  
  636. - `Function GetOption ( string optionName )`
  637.  
  638.     If `optionName` is given, returns the value of that option. Otherwise,
  639.     returns a table of options and their current values.
  640.  
  641. - `Function SetOption ( string optionName, bool value )`
  642.  
  643.     Sets `optionName` to `value`.
  644.  
  645.     Options:
  646.  
  647.     - Modifiable
  648.  
  649.         Whether objects can be modified by the panel.
  650.  
  651.         Note that modifying objects depends on being able to select them. If
  652.         Selectable is false, then Actions will not be available. Reparenting
  653.         is still possible, but only for the dragged object.
  654.  
  655.     - Selectable
  656.  
  657.         Whether objects can be selected.
  658.  
  659.         If Modifiable is false, then left-clicking will perform a drag
  660.         selection.
  661.  
  662. ## Updates
  663.  
  664. - 2013-09-18
  665.     - Fixed explorer icons to match studio explorer.
  666.  
  667. - 2013-09-14
  668.     - Added GetOption and SetOption bindables.
  669.         - Option: Modifiable; sets whether objects can be modified by the panel.
  670.         - Option: Selectable; sets whether objects can be selected.
  671.     - Slight modification to left-click selection behavior.
  672.     - Improved layout and scaling.
  673.  
  674. - 2013-09-13
  675.     - Added drag to reparent objects.
  676.         - Left-click to select/deselect object.
  677.         - Left-click and drag unselected object to reparent single object.
  678.         - Left-click and drag selected object to move reparent entire selection.
  679.         - Right-click while dragging to cancel.
  680.  
  681. - 2013-09-11
  682.     - Added explorer panel header with actions.
  683.         - Added Cut action.
  684.         - Added Copy action.
  685.         - Added Paste action.
  686.         - Added Delete action.
  687.     - Added drag selection.
  688.         - Left-click: Add to selection on drag.
  689.         - Right-click: Add to or remove from selection on drag.
  690.     - Ensured SelectionChanged fires only when the selection actually changes.
  691.     - Added documentation and change log.
  692.     - Fixed thread issue.
  693.  
  694. - 2013-09-09
  695.     - Added basic multi-selection.
  696.         - Left-click to set selection.
  697.         - Right-click to add to or remove from selection.
  698.     - Removed "Selection" ObjectValue.
  699.         - Added GetSelection BindableFunction.
  700.         - Added SetSelection BindableFunction.
  701.         - Added SelectionChanged BindableEvent.
  702.     - Changed font to SourceSans.
  703.  
  704. - 2013-08-31
  705.     - Improved GUI sizing based off of `GUI_SIZE` constant.
  706.     - Automatic font size detection.
  707.  
  708. - 2013-08-27
  709.     - Initial explorer panel.
  710.  
  711.  
  712. ## Todo
  713.  
  714. - Sorting
  715.     - by ExplorerOrder
  716.     - by children
  717.     - by name
  718. - Drag objects to reparent
  719.  
  720. ]]
  721.  
  722. local ENTRY_SIZE = GUI_SIZE + ENTRY_PADDING*2
  723. local ENTRY_BOUND = ENTRY_SIZE + ENTRY_MARGIN
  724. local HEADER_SIZE = ENTRY_SIZE*2
  725.  
  726. local FONT = 'SourceSans'
  727. local FONT_SIZE do
  728.     local size = {8,9,10,11,12,14,18,24,36,48}
  729.     local s
  730.     local n = math.huge
  731.     for i = 1,#size do
  732.         if size[i] <= GUI_SIZE then
  733.             FONT_SIZE = i - 1
  734.         end
  735.     end
  736. end
  737.  
  738. local GuiColor = {
  739.     Background      = Color3.fromRGB(43, 43, 43);
  740.     Border          = Color3.fromRGB(20, 20, 20);
  741.     Selected        = Color3.fromRGB(5, 102, 141);
  742.     BorderSelected  = Color3.fromRGB(2, 128, 144);
  743.     Text            = Color3.fromRGB(245, 245, 245);
  744.     TextDisabled    = Color3.fromRGB(188, 188, 188);
  745.     TextSelected    = Color3.fromRGB(255, 255, 255);
  746.     Button          = Color3.fromRGB(33, 33, 33);
  747.     ButtonBorder    = Color3.fromRGB(133, 133, 133);
  748.     ButtonSelected  = Color3.fromRGB(0, 168, 150);
  749.     Field           = Color3.fromRGB(43, 43, 43);
  750.     FieldBorder     = Color3.fromRGB(50, 50, 50);
  751.     TitleBackground = Color3.fromRGB(11, 11, 11);
  752. }
  753.  
  754. --[[
  755. local GuiColor = {
  756.     Background      = Color3.new(233/255, 233/255, 233/255);
  757.     Border          = Color3.new(149/255, 149/255, 149/255);
  758.     Selected        = Color3.new( 96/255, 140/255, 211/255);
  759.     BorderSelected  = Color3.new( 86/255, 125/255, 188/255);
  760.     Text            = Color3.new(  0/255,   0/255,   0/255);
  761.     TextDisabled    = Color3.new(128/255, 128/255, 128/255);
  762.     TextSelected    = Color3.new(255/255, 255/255, 255/255);
  763.     Button          = Color3.new(221/255, 221/255, 221/255);
  764.     ButtonBorder    = Color3.new(149/255, 149/255, 149/255);
  765.     ButtonSelected  = Color3.new(255/255,   0/255,   0/255);
  766.     Field           = Color3.new(255/255, 255/255, 255/255);
  767.     FieldBorder     = Color3.new(191/255, 191/255, 191/255);
  768.     TitleBackground = Color3.new(178/255, 178/255, 178/255);
  769. }
  770. ]]
  771.  
  772. ----------------------------------------------------------------
  773. ----------------------------------------------------------------
  774. ----------------------------------------------------------------
  775. ----------------------------------------------------------------
  776. ---- Icon map constants
  777.  
  778. local MAP_ID = 483448923
  779.  
  780. -- Indices based on implementation of Icon function.
  781. local ACTION_CUT             = 160
  782. local ACTION_COPY            = 161
  783. local ACTION_PASTE           = 162
  784. local ACTION_DELETE          = 163
  785. local ACTION_SORT            = 164
  786. local ACTION_CUT_OVER        = 174
  787. local ACTION_COPY_OVER       = 175
  788. local ACTION_PASTE_OVER      = 176
  789. local ACTION_DELETE_OVER     = 177
  790. local ACTION_SORT_OVER       = 178
  791. local ACTION_EDITQUICKACCESS = 190
  792. local ACTION_FREEZE          = 188
  793. local ACTION_STARRED         = 189
  794. local ACTION_ADDSTAR         = 184
  795. local ACTION_ADDSTAR_OVER    = 187
  796.  
  797. local NODE_COLLAPSED      = 165
  798. local NODE_EXPANDED       = 166
  799. local NODE_COLLAPSED_OVER = 179
  800. local NODE_EXPANDED_OVER  = 180
  801.  
  802. local listOf = {
  803.     ACTION_CUT,ACTION_COPY,ACTION_PASTE,ACTION_DELETE,ACTION_SORT,ACTION_CUT_OVER,ACTION_COPY_OVER,
  804.     ACTION_PASTE_OVER,ACTION_DELETE_OVER,ACTION_SORT_OVER,ACTION_EDITQUICKACCESS,ACTION_FREEZE,ACTION_STARRED,
  805.     ACTION_ADDSTAR,ACTION_ADDSTAR_OVER,NODE_COLLAPSED,NODE_EXPANDED,NODE_COLLAPSED_OVER,NODE_EXPANDED_OVER
  806. }
  807.  
  808. local ExplorerIndex = {
  809.     ["Accessory"] = 32;
  810.     ["Accoutrement"] = 32;
  811.     ["AdService"] = 73;
  812.     ["Animation"] = 60;
  813.     ["AnimationController"] = 60;
  814.     ["AnimationTrack"] = 60;
  815.     ["Animator"] = 60;
  816.     ["ArcHandles"] = 56;
  817.     ["AssetService"] = 72;
  818.     ["Attachment"] = 34;
  819.     ["Backpack"] = 20;
  820.     ["BadgeService"] = 75;
  821.     ["BallSocketConstraint"] = 89;
  822.     ["BillboardGui"] = 64;
  823.     ["BinaryStringValue"] = 4;
  824.     ["BindableEvent"] = 67;
  825.     ["BindableFunction"] = 66;
  826.     ["BlockMesh"] = 8;
  827.     ["BloomEffect"] = 90;
  828.     ["BlurEffect"] = 90;
  829.     ["BodyAngularVelocity"] = 14;
  830.     ["BodyForce"] = 14;
  831.     ["BodyGyro"] = 14;
  832.     ["BodyPosition"] = 14;
  833.     ["BodyThrust"] = 14;
  834.     ["BodyVelocity"] = 14;
  835.     ["BoolValue"] = 4;
  836.     ["BoxHandleAdornment"] = 54;
  837.     ["BrickColorValue"] = 4;
  838.     ["Camera"] = 5;
  839.     ["CFrameValue"] = 4;
  840.     ["CharacterMesh"] = 60;
  841.     ["Chat"] = 33;
  842.     ["ClickDetector"] = 41;
  843.     ["CollectionService"] = 30;
  844.     ["Color3Value"] = 4;
  845.     ["ColorCorrectionEffect"] = 90;
  846.     ["ConeHandleAdornment"] = 54;
  847.     ["Configuration"] = 58;
  848.     ["ContentProvider"] = 72;
  849.     ["ContextActionService"] = 41;
  850.     ["CoreGui"] = 46;
  851.     ["CoreScript"] = 18;
  852.     ["CornerWedgePart"] = 1;
  853.     ["CustomEvent"] = 4;
  854.     ["CustomEventReceiver"] = 4;
  855.     ["CylinderHandleAdornment"] = 54;
  856.     ["CylinderMesh"] = 8;
  857.     ["CylindricalConstraint"] = 89;
  858.     ["Debris"] = 30;
  859.     ["Decal"] = 7;
  860.     ["Dialog"] = 62;
  861.     ["DialogChoice"] = 63;
  862.     ["DoubleConstrainedValue"] = 4;
  863.     ["Explosion"] = 36;
  864.     ["FileMesh"] = 8;
  865.     ["Fire"] = 61;
  866.     ["Flag"] = 38;
  867.     ["FlagStand"] = 39;
  868.     ["FloorWire"] = 4;
  869.     ["Folder"] = 70;
  870.     ["ForceField"] = 37;
  871.     ["Frame"] = 48;
  872.     ["GamePassService"] = 19;
  873.     ["Glue"] = 34;
  874.     ["GuiButton"] = 52;
  875.     ["GuiMain"] = 47;
  876.     ["GuiService"] = 47;
  877.     ["Handles"] = 53;
  878.     ["HapticService"] = 84;
  879.     ["Hat"] = 45;
  880.     ["HingeConstraint"] = 89;
  881.     ["Hint"] = 33;
  882.     ["HopperBin"] = 22;
  883.     ["HttpService"] = 76;
  884.     ["Humanoid"] = 9;
  885.     ["ImageButton"] = 52;
  886.     ["ImageLabel"] = 49;
  887.     ["InsertService"] = 72;
  888.     ["IntConstrainedValue"] = 4;
  889.     ["IntValue"] = 4;
  890.     ["JointInstance"] = 34;
  891.     ["JointsService"] = 34;
  892.     ["Keyframe"] = 60;
  893.     ["KeyframeSequence"] = 60;
  894.     ["KeyframeSequenceProvider"] = 60;
  895.     ["Lighting"] = 13;
  896.     ["LineHandleAdornment"] = 54;
  897.     ["LocalScript"] = 18;
  898.     ["LogService"] = 87;
  899.     ["MarketplaceService"] = 46;
  900.     ["Message"] = 33;
  901.     ["Model"] = 2;
  902.     ["ModuleScript"] = 71;
  903.     ["Motor"] = 34;
  904.     ["Motor6D"] = 34;
  905.     ["MoveToConstraint"] = 89;
  906.     ["NegateOperation"] = 78;
  907.     ["NetworkClient"] = 16;
  908.     ["NetworkReplicator"] = 29;
  909.     ["NetworkServer"] = 15;
  910.     ["NumberValue"] = 4;
  911.     ["ObjectValue"] = 4;
  912.     ["Pants"] = 44;
  913.     ["ParallelRampPart"] = 1;
  914.     ["Part"] = 1;
  915.     ["ParticleEmitter"] = 69;
  916.     ["PartPairLasso"] = 57;
  917.     ["PathfindingService"] = 37;
  918.     ["Platform"] = 35;
  919.     ["Player"] = 12;
  920.     ["PlayerGui"] = 46;
  921.     ["Players"] = 21;
  922.     ["PlayerScripts"] = 82;
  923.     ["PointLight"] = 13;
  924.     ["PointsService"] = 83;
  925.     ["Pose"] = 60;
  926.     ["PrismaticConstraint"] = 89;
  927.     ["PrismPart"] = 1;
  928.     ["PyramidPart"] = 1;
  929.     ["RayValue"] = 4;
  930.     ["ReflectionMetadata"] = 86;
  931.     ["ReflectionMetadataCallbacks"] = 86;
  932.     ["ReflectionMetadataClass"] = 86;
  933.     ["ReflectionMetadataClasses"] = 86;
  934.     ["ReflectionMetadataEnum"] = 86;
  935.     ["ReflectionMetadataEnumItem"] = 86;
  936.     ["ReflectionMetadataEnums"] = 86;
  937.     ["ReflectionMetadataEvents"] = 86;
  938.     ["ReflectionMetadataFunctions"] = 86;
  939.     ["ReflectionMetadataMember"] = 86;
  940.     ["ReflectionMetadataProperties"] = 86;
  941.     ["ReflectionMetadataYieldFunctions"] = 86;
  942.     ["RemoteEvent"] = 80;
  943.     ["RemoteFunction"] = 79;
  944.     ["ReplicatedFirst"] = 72;
  945.     ["ReplicatedStorage"] = 72;
  946.     ["RightAngleRampPart"] = 1;
  947.     ["RocketPropulsion"] = 14;
  948.     ["RodConstraint"] = 89;
  949.     ["RopeConstraint"] = 89;
  950.     ["Rotate"] = 34;
  951.     ["RotateP"] = 34;
  952.     ["RotateV"] = 34;
  953.     ["RunService"] = 66;
  954.     ["ScreenGui"] = 47;
  955.     ["Script"] = 6;
  956.     ["ScrollingFrame"] = 48;
  957.     ["Seat"] = 35;
  958.     ["Selection"] = 55;
  959.     ["SelectionBox"] = 54;
  960.     ["SelectionPartLasso"] = 57;
  961.     ["SelectionPointLasso"] = 57;
  962.     ["SelectionSphere"] = 54;
  963.     ["ServerScriptService"] = 0;
  964.     ["Shirt"] = 43;
  965.     ["ShirtGraphic"] = 40;
  966.     ["SkateboardPlatform"] = 35;
  967.     ["Sky"] = 28;
  968.     ["SlidingBallConstraint"] = 89;
  969.     ["Smoke"] = 59;
  970.     ["Snap"] = 34;
  971.     ["Sound"] = 11;
  972.     ["SoundService"] = 31;
  973.     ["Sparkles"] = 42;
  974.     ["SpawnLocation"] = 25;
  975.     ["SpecialMesh"] = 8;
  976.     ["SphereHandleAdornment"] = 54;
  977.     ["SpotLight"] = 13;
  978.     ["SpringConstraint"] = 89;
  979.     ["StarterCharacterScripts"] = 82;
  980.     ["StarterGear"] = 20;
  981.     ["StarterGui"] = 46;
  982.     ["StarterPack"] = 20;
  983.     ["StarterPlayer"] = 88;
  984.     ["StarterPlayerScripts"] = 82;
  985.     ["Status"] = 2;
  986.     ["StringValue"] = 4;
  987.     ["SunRaysEffect"] = 90;
  988.     ["SurfaceGui"] = 64;
  989.     ["SurfaceLight"] = 13;
  990.     ["SurfaceSelection"] = 55;
  991.     ["Team"] = 24;
  992.     ["Teams"] = 23;
  993.     ["TeleportService"] = 81;
  994.     ["Terrain"] = 65;
  995.     ["TerrainRegion"] = 65;
  996.     ["TestService"] = 68;
  997.     ["TextBox"] = 51;
  998.     ["TextButton"] = 51;
  999.     ["TextLabel"] = 50;
  1000.     ["Texture"] = 10;
  1001.     ["TextureTrail"] = 4;
  1002.     ["Tool"] = 17;
  1003.     ["TouchTransmitter"] = 37;
  1004.     ["TrussPart"] = 1;
  1005.     ["UnionOperation"] = 77;
  1006.     ["UserInputService"] = 84;
  1007.     ["Vector3Value"] = 4;
  1008.     ["VehicleSeat"] = 35;
  1009.     ["VelocityMotor"] = 34;
  1010.     ["WedgePart"] = 1;
  1011.     ["Weld"] = 34;
  1012.     ["Workspace"] = 19;
  1013. }
  1014.  
  1015. ----------------------------------------------------------------
  1016. ----------------------------------------------------------------
  1017. ----------------------------------------------------------------
  1018. ----------------------------------------------------------------
  1019. ----------------------------------------------------------------
  1020.  
  1021. function Create(ty,data)
  1022.     local obj
  1023.     if type(ty) == 'string' then
  1024.         obj = Instance.new(ty)
  1025.     else
  1026.         obj = ty
  1027.     end
  1028.     for k, v in pairs(data) do
  1029.         if type(k) == 'number' then
  1030.             v.Parent = obj
  1031.         else
  1032.             obj[k] = v
  1033.         end
  1034.     end
  1035.     return obj
  1036. end
  1037.  
  1038. local barActive = false
  1039. local activeOptions = {}
  1040.  
  1041. function createDDown(dBut, callback,...)
  1042.     if barActive then
  1043.         for i,v in pairs(activeOptions) do
  1044.             v:Destroy()
  1045.         end
  1046.         activeOptions = {}
  1047.         barActive = false
  1048.         return
  1049.     else
  1050.         barActive = true
  1051.     end
  1052.     local slots = {...}
  1053.     local base = dBut
  1054.     for i,v in pairs(slots) do
  1055.         local newOption = base:Clone()
  1056.         newOption.ZIndex = 5
  1057.         newOption.Name = "Option "..tostring(i)
  1058.         newOption.Parent = base.Parent.Parent.Parent
  1059.         newOption.BackgroundTransparency = 0
  1060.         newOption.ZIndex = 2
  1061.         table.insert(activeOptions,newOption)
  1062.         newOption.Position = UDim2.new(-0.4, dBut.Position.X.Offset, dBut.Position.Y.Scale, dBut.Position.Y.Offset + (#activeOptions * dBut.Size.Y.Offset))
  1063.         newOption.Text = slots[i]
  1064.         newOption.MouseButton1Down:connect(function()
  1065.             dBut.Text = slots[i]
  1066.             callback(slots[i])
  1067.             for i,v in pairs(activeOptions) do
  1068.                 v:Destroy()
  1069.             end
  1070.             activeOptions = {}
  1071.             barActive = false
  1072.         end)
  1073.     end
  1074. end
  1075.  
  1076. -- Connects a function to an event such that it fires asynchronously
  1077. function Connect(event,func)
  1078.     return event:connect(function(...)
  1079.         local a = {...}
  1080.         spawn(function() func(unpack(a)) end)
  1081.     end)
  1082. end
  1083.  
  1084. -- returns the ascendant ScreenGui of an object
  1085. function GetScreen(screen)
  1086.     if screen == nil then return nil end
  1087.     while not screen:IsA("ScreenGui") do
  1088.         screen = screen.Parent
  1089.         if screen == nil then return nil end
  1090.     end
  1091.     return screen
  1092. end
  1093.  
  1094. do
  1095.     local ZIndexLock = {}
  1096.     -- Sets the ZIndex of an object and its descendants. Objects are locked so
  1097.     -- that SetZIndexOnChanged doesn't spawn multiple threads that set the
  1098.     -- ZIndex of the same object.
  1099.     function SetZIndex(object,z)
  1100.         if not ZIndexLock[object] then
  1101.             ZIndexLock[object] = true
  1102.             if object:IsA'GuiObject' then
  1103.                 object.ZIndex = z
  1104.             end
  1105.             local children = object:GetChildren()
  1106.             for i = 1,#children do
  1107.                 SetZIndex(children[i],z)
  1108.             end
  1109.             ZIndexLock[object] = nil
  1110.         end
  1111.     end
  1112.  
  1113.     function SetZIndexOnChanged(object)
  1114.         return object.Changed:connect(function(p)
  1115.             if p == "ZIndex" then
  1116.                 SetZIndex(object,object.ZIndex)
  1117.             end
  1118.         end)
  1119.     end
  1120. end
  1121.  
  1122. ---- IconMap ----
  1123. -- Image size: 256px x 256px
  1124. -- Icon size: 16px x 16px
  1125. -- Padding between each icon: 2px
  1126. -- Padding around image edge: 1px
  1127. -- Total icons: 14 x 14 (196)
  1128.  
  1129. local find = function(n)
  1130.     for a,i in pairs(ExplorerIndex) do
  1131.         if(i == n) then
  1132.             return a;
  1133.         end
  1134.     end
  1135. end
  1136.  
  1137. local Icon do
  1138.     local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID
  1139.     game:GetService('ContentProvider'):Preload(iconMap)
  1140.     local iconDehash do
  1141.         -- 14 x 14, 0-based input, 0-based output
  1142.         local f=math.floor
  1143.         function iconDehash(h)
  1144.             return f(h/14%14),f(h%14)
  1145.         end
  1146.     end
  1147.  
  1148.     function Icon(IconFrame,index,obj,zIndex)
  1149.         local isNodeThing = table.find(listOf,index) ~= nil;
  1150.         local class;
  1151.         if(not isNodeThing) then
  1152.             class = find(index);
  1153.             if(not class) then
  1154.                 warn(index)
  1155.             end
  1156.         end
  1157.        
  1158.         local row,col = iconDehash(index)
  1159.         local mapSize = Vector2.new(256,256)
  1160.         local pad,border = 2,1
  1161.         local iconSize = 16
  1162.  
  1163.         local class = 'Frame'
  1164.         if type(IconFrame) == 'string' then
  1165.             class = IconFrame
  1166.             IconFrame = nil
  1167.         end
  1168.  
  1169.         if not IconFrame then
  1170.             IconFrame = Create(class,{
  1171.                 Name = "Icon";
  1172.                 BackgroundTransparency = 1;
  1173.                 ClipsDescendants = true;
  1174.                 Create('ImageLabel',{
  1175.                     Name = "IconMap";
  1176.                     Active = false;
  1177.                     BackgroundTransparency = 1;
  1178.                     Image = iconMap;
  1179.                     Size = UDim2.new(mapSize.x/iconSize,0,mapSize.y/iconSize,0),
  1180.                 });
  1181.             })
  1182.         end
  1183.        
  1184.         IconFrame.IconMap.Position = UDim2.new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0);
  1185.         if(fullListCustom[class or ""] and not isNodeThing) then
  1186.             if(obj) then
  1187.                 class = obj.ClassName;
  1188.             end
  1189.             IconFrame.IconMap.Position = UDim2.new(0,0,0,0);
  1190.             IconFrame.ClipsDescendants = false;
  1191.             IconFrame.IconMap.ImageTransparency = 1;
  1192.             local f = IconFrame.IconMap:FindFirstChild("CustomIcon") or Create("ImageLabel",{
  1193.                 Name  = "CustomIcon",
  1194.                 Active = false,
  1195.                 BackgroundTransparency = 1,
  1196.                 Size = UDim2.fromOffset(iconSize,iconSize),
  1197.                 Position = UDim2.new(0,0,0,0),
  1198.             })
  1199.             if(zIndex) then
  1200.                 f.ZIndex = zIndex;
  1201.             end
  1202.             f.Parent = IconFrame.IconMap;
  1203.             f.Image = fullListCustom[class]
  1204.             f:SetAttribute("Class",class)
  1205.         else
  1206.             IconFrame.ClipsDescendants = true;
  1207.             IconFrame.IconMap.ImageTransparency = 0;
  1208.         end
  1209.         return IconFrame
  1210.     end
  1211. end
  1212.  
  1213. ----------------------------------------------------------------
  1214. ----------------------------------------------------------------
  1215. ----------------------------------------------------------------
  1216. ----------------------------------------------------------------
  1217. ---- ScrollBar
  1218. do
  1219.     -- AutoButtonColor doesn't always reset properly
  1220.     local function ResetButtonColor(button)
  1221.         local active = button.Active
  1222.         button.Active = not active
  1223.         button.Active = active
  1224.     end
  1225.  
  1226.     local function ArrowGraphic(size,dir,scaled,template)
  1227.         local Frame = Create('Frame',{
  1228.             Name = "Arrow Graphic";
  1229.             BorderSizePixel = 0;
  1230.             Size = UDim2.new(0,size,0,size);
  1231.             Transparency = 1;
  1232.         })
  1233.         if not template then
  1234.             template = Instance.new("Frame")
  1235.             template.BorderSizePixel = 0
  1236.         end
  1237.  
  1238.         template.BackgroundColor3 = Color3.new(1, 1, 1);
  1239.  
  1240.         local transform
  1241.         if dir == nil or dir == 'Up' then
  1242.             function transform(p,s) return p,s end
  1243.         elseif dir == 'Down' then
  1244.             function transform(p,s) return UDim2.new(0,p.X.Offset,0,size-p.Y.Offset-1),s end
  1245.         elseif dir == 'Left' then
  1246.             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
  1247.         elseif dir == 'Right' then
  1248.             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
  1249.         end
  1250.  
  1251.         local scale
  1252.         if scaled then
  1253.             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
  1254.         else
  1255.             function scale(p,s) return p,s end
  1256.         end
  1257.  
  1258.         local o = math.floor(size/4)
  1259.         if size%2 == 0 then
  1260.             local n = size/2-1
  1261.             for i = 0,n do
  1262.                 local t = template:Clone()
  1263.                 local p,s = scale(transform(
  1264.                     UDim2.new(0,n-i,0,o+i),
  1265.                     UDim2.new(0,(i+1)*2,0,1)
  1266.                     ))
  1267.                 t.Position = p
  1268.                 t.Size = s
  1269.                 t.Parent = Frame
  1270.             end
  1271.         else
  1272.             local n = (size-1)/2
  1273.             for i = 0,n do
  1274.                 local t = template:Clone()
  1275.                 local p,s = scale(transform(
  1276.                     UDim2.new(0,n-i,0,o+i),
  1277.                     UDim2.new(0,i*2+1,0,1)
  1278.                     ))
  1279.                 t.Position = p
  1280.                 t.Size = s
  1281.                 t.Parent = Frame
  1282.             end
  1283.         end
  1284.         if size%4 > 1 then
  1285.             local t = template:Clone()
  1286.             local p,s = scale(transform(
  1287.                 UDim2.new(0,0,0,size-o-1),
  1288.                 UDim2.new(0,size,0,1)
  1289.                 ))
  1290.             t.Position = p
  1291.             t.Size = s
  1292.             t.Parent = Frame
  1293.         end
  1294.  
  1295.         for i,v in pairs(Frame:GetChildren()) do
  1296.             v.BackgroundColor3 = Color3.new(1, 1, 1);
  1297.         end
  1298.  
  1299.         return Frame
  1300.     end
  1301.  
  1302.  
  1303.     local function GripGraphic(size,dir,spacing,scaled,template)
  1304.         local Frame = Create('Frame',{
  1305.             Name = "Grip Graphic";
  1306.             BorderSizePixel = 0;
  1307.             Size = UDim2.new(0,size.x,0,size.y);
  1308.             Transparency = 1;
  1309.         })
  1310.         if not template then
  1311.             template = Instance.new("Frame")
  1312.             template.BorderSizePixel = 0
  1313.         end
  1314.  
  1315.         spacing = spacing or 2
  1316.  
  1317.         local scale
  1318.         if scaled then
  1319.             function scale(p) return UDim2.new(p.X.Offset/size.x,0,p.Y.Offset/size.y,0) end
  1320.         else
  1321.             function scale(p) return p end
  1322.         end
  1323.  
  1324.         if dir == 'Vertical' then
  1325.             for i=0,size.x-1,spacing do
  1326.                 local t = template:Clone()
  1327.                 t.Size = scale(UDim2.new(0,1,0,size.y))
  1328.                 t.Position = scale(UDim2.new(0,i,0,0))
  1329.                 t.Parent = Frame
  1330.             end
  1331.         elseif dir == nil or dir == 'Horizontal' then
  1332.             for i=0,size.y-1,spacing do
  1333.                 local t = template:Clone()
  1334.                 t.Size = scale(UDim2.new(0,size.x,0,1))
  1335.                 t.Position = scale(UDim2.new(0,0,0,i))
  1336.                 t.Parent = Frame
  1337.             end
  1338.         end
  1339.  
  1340.         return Frame
  1341.     end
  1342.  
  1343.     local mt = {
  1344.         __index = {
  1345.             GetScrollPercent = function(self)
  1346.                 return self.ScrollIndex/(self.TotalSpace-self.VisibleSpace)
  1347.             end;
  1348.             CanScrollDown = function(self)
  1349.                 return self.ScrollIndex + self.VisibleSpace < self.TotalSpace
  1350.             end;
  1351.             CanScrollUp = function(self)
  1352.                 return self.ScrollIndex > 0
  1353.             end;
  1354.             ScrollDown = function(self)
  1355.                 self.ScrollIndex = self.ScrollIndex + self.PageIncrement
  1356.                 self:Update()
  1357.             end;
  1358.             ScrollUp = function(self)
  1359.                 self.ScrollIndex = self.ScrollIndex - self.PageIncrement
  1360.                 self:Update()
  1361.             end;
  1362.             ScrollTo = function(self,index)
  1363.                 self.ScrollIndex = index
  1364.                 self:Update()
  1365.             end;
  1366.             SetScrollPercent = function(self,percent)
  1367.                 self.ScrollIndex = math.floor((self.TotalSpace - self.VisibleSpace)*percent + 0.5)
  1368.                 self:Update()
  1369.             end;
  1370.         };
  1371.     }
  1372.     mt.__index.CanScrollRight = mt.__index.CanScrollDown
  1373.     mt.__index.CanScrollLeft = mt.__index.CanScrollUp
  1374.     mt.__index.ScrollLeft = mt.__index.ScrollUp
  1375.     mt.__index.ScrollRight = mt.__index.ScrollDown
  1376.  
  1377.     function ScrollBar(horizontal)
  1378.         -- create row scroll bar
  1379.         local ScrollFrame = Create('Frame',{
  1380.             Name = "ScrollFrame";
  1381.             BorderSizePixel = 0;
  1382.             Position = horizontal and UDim2.new(0,0,1,-GUI_SIZE) or UDim2.new(1,-GUI_SIZE,0,0);
  1383.             Size = horizontal and UDim2.new(1,0,0,GUI_SIZE) or UDim2.new(0,GUI_SIZE,1,0);
  1384.             BackgroundTransparency = 1;
  1385.             Create('ImageButton',{
  1386.                 Name = "ScrollDown";
  1387.                 Position = horizontal and UDim2.new(1,-GUI_SIZE,0,0) or UDim2.new(0,0,1,-GUI_SIZE);
  1388.                 Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
  1389.                 BackgroundColor3 = GuiColor.Button;
  1390.                 BorderColor3 = GuiColor.Border;
  1391.                 --BorderSizePixel = 0;
  1392.             });
  1393.             Create('ImageButton',{
  1394.                 Name = "ScrollUp";
  1395.                 Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
  1396.                 BackgroundColor3 = GuiColor.Button;
  1397.                 BorderColor3 = GuiColor.Border;
  1398.                 --BorderSizePixel = 0;
  1399.             });
  1400.             Create('ImageButton',{
  1401.                 Name = "ScrollBar";
  1402.                 Size = horizontal and UDim2.new(1,-GUI_SIZE*2,1,0) or UDim2.new(1,0,1,-GUI_SIZE*2);
  1403.                 Position = horizontal and UDim2.new(0,GUI_SIZE,0,0) or UDim2.new(0,0,0,GUI_SIZE);
  1404.                 AutoButtonColor = false;
  1405.                 BackgroundColor3 = Color3.new(1/4, 1/4, 1/4);
  1406.                 BorderColor3 = GuiColor.Border;
  1407.                 --BorderSizePixel = 0;
  1408.                 Create('ImageButton',{
  1409.                     Name = "ScrollThumb";
  1410.                     AutoButtonColor = false;
  1411.                     Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
  1412.                     BackgroundColor3 = GuiColor.Button;
  1413.                     BorderColor3 = GuiColor.Border;
  1414.                     --BorderSizePixel = 0;
  1415.                 });
  1416.             });
  1417.         })
  1418.  
  1419.         local graphicTemplate = Create('Frame',{
  1420.             Name="Graphic";
  1421.             BorderSizePixel = 0;
  1422.             BackgroundColor3 = GuiColor.Border;
  1423.         })
  1424.         local graphicSize = GUI_SIZE/2
  1425.  
  1426.         local ScrollDownFrame = ScrollFrame.ScrollDown
  1427.         local ScrollDownGraphic = ArrowGraphic(graphicSize,horizontal and 'Right' or 'Down',true,graphicTemplate)
  1428.         ScrollDownGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
  1429.         ScrollDownGraphic.Parent = ScrollDownFrame
  1430.         local ScrollUpFrame = ScrollFrame.ScrollUp
  1431.         local ScrollUpGraphic = ArrowGraphic(graphicSize,horizontal and 'Left' or 'Up',true,graphicTemplate)
  1432.         ScrollUpGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
  1433.         ScrollUpGraphic.Parent = ScrollUpFrame
  1434.         local ScrollBarFrame = ScrollFrame.ScrollBar
  1435.         local ScrollThumbFrame = ScrollBarFrame.ScrollThumb
  1436.         do
  1437.             local size = GUI_SIZE*3/8
  1438.             local Decal = GripGraphic(Vector2.new(size,size),horizontal and 'Vertical' or 'Horizontal',2,graphicTemplate)
  1439.             Decal.Position = UDim2.new(0.5,-size/2,0.5,-size/2)
  1440.             Decal.Parent = ScrollThumbFrame
  1441.         end
  1442.  
  1443.         local Class = setmetatable({
  1444.             GUI = ScrollFrame;
  1445.             ScrollIndex = 0;
  1446.             VisibleSpace = 0;
  1447.             TotalSpace = 0;
  1448.             PageIncrement = 1;
  1449.         },mt)
  1450.  
  1451.         local UpdateScrollThumb
  1452.         if horizontal then
  1453.             function UpdateScrollThumb()
  1454.                 ScrollThumbFrame.Size = UDim2.new(Class.VisibleSpace/Class.TotalSpace,0,0,GUI_SIZE)
  1455.                 if ScrollThumbFrame.AbsoluteSize.x < GUI_SIZE then
  1456.                     ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
  1457.                 end
  1458.                 local barSize = ScrollBarFrame.AbsoluteSize.x
  1459.                 ScrollThumbFrame.Position = UDim2.new(Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.x)/barSize,0,0,0)
  1460.             end
  1461.         else
  1462.             function UpdateScrollThumb()
  1463.                 ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,Class.VisibleSpace/Class.TotalSpace,0)
  1464.                 if ScrollThumbFrame.AbsoluteSize.y < GUI_SIZE then
  1465.                     ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
  1466.                 end
  1467.                 local barSize = ScrollBarFrame.AbsoluteSize.y
  1468.                 ScrollThumbFrame.Position = UDim2.new(0,0,Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.y)/barSize,0)
  1469.             end
  1470.         end
  1471.  
  1472.         local lastDown
  1473.         local lastUp
  1474.         local scrollStyle = {BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0}
  1475.         local scrollStyle_ds = {BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0.7}
  1476.  
  1477.         local function Update()
  1478.             local t = Class.TotalSpace
  1479.             local v = Class.VisibleSpace
  1480.             local s = Class.ScrollIndex
  1481.             if v <= t then
  1482.                 if s > 0 then
  1483.                     if s + v > t then
  1484.                         Class.ScrollIndex = t - v
  1485.                     end
  1486.                 else
  1487.                     Class.ScrollIndex = 0
  1488.                 end
  1489.             else
  1490.                 Class.ScrollIndex = 0
  1491.             end
  1492.  
  1493.             if Class.UpdateCallback then
  1494.                 if Class.UpdateCallback(Class) == false then
  1495.                     return
  1496.                 end
  1497.             end
  1498.  
  1499.             local down = Class:CanScrollDown()
  1500.             local up = Class:CanScrollUp()
  1501.             if down ~= lastDown then
  1502.                 lastDown = down
  1503.                 ScrollDownFrame.Active = down
  1504.                 ScrollDownFrame.AutoButtonColor = down
  1505.                 local children = ScrollDownGraphic:GetChildren()
  1506.                 local style = down and scrollStyle or scrollStyle_ds
  1507.                 for i = 1,#children do
  1508.                     Create(children[i],style)
  1509.                 end
  1510.             end
  1511.             if up ~= lastUp then
  1512.                 lastUp = up
  1513.                 ScrollUpFrame.Active = up
  1514.                 ScrollUpFrame.AutoButtonColor = up
  1515.                 local children = ScrollUpGraphic:GetChildren()
  1516.                 local style = up and scrollStyle or scrollStyle_ds
  1517.                 for i = 1,#children do
  1518.                     Create(children[i],style)
  1519.                 end
  1520.             end
  1521.             ScrollThumbFrame.Visible = down or up
  1522.             UpdateScrollThumb()
  1523.         end
  1524.         Class.Update = Update
  1525.  
  1526.         SetZIndexOnChanged(ScrollFrame)
  1527.  
  1528.         local MouseDrag = Create('ImageButton',{
  1529.             Name = "MouseDrag";
  1530.             Position = UDim2.new(-0.25,0,-0.25,0);
  1531.             Size = UDim2.new(1.5,0,1.5,0);
  1532.             Transparency = 1;
  1533.             AutoButtonColor = false;
  1534.             Active = true;
  1535.             ZIndex = 10;
  1536.         })
  1537.  
  1538.         local scrollEventID = 0
  1539.         ScrollDownFrame.MouseButton1Down:connect(function()
  1540.             scrollEventID = tick()
  1541.             local current = scrollEventID
  1542.             local up_con
  1543.             up_con = MouseDrag.MouseButton1Up:connect(function()
  1544.                 scrollEventID = tick()
  1545.                 MouseDrag.Parent = nil
  1546.                 ResetButtonColor(ScrollDownFrame)
  1547.                 up_con:disconnect(); drag = nil
  1548.             end)
  1549.             MouseDrag.Parent = GetScreen(ScrollFrame)
  1550.             Class:ScrollDown()
  1551.             wait(0.2) -- delay before auto scroll
  1552.             while scrollEventID == current do
  1553.                 Class:ScrollDown()
  1554.                 if not Class:CanScrollDown() then break end
  1555.                 wait()
  1556.             end
  1557.         end)
  1558.  
  1559.         ScrollDownFrame.MouseButton1Up:connect(function()
  1560.             scrollEventID = tick()
  1561.         end)
  1562.  
  1563.         ScrollUpFrame.MouseButton1Down:connect(function()
  1564.             scrollEventID = tick()
  1565.             local current = scrollEventID
  1566.             local up_con
  1567.             up_con = MouseDrag.MouseButton1Up:connect(function()
  1568.                 scrollEventID = tick()
  1569.                 MouseDrag.Parent = nil
  1570.                 ResetButtonColor(ScrollUpFrame)
  1571.                 up_con:disconnect(); drag = nil
  1572.             end)
  1573.             MouseDrag.Parent = GetScreen(ScrollFrame)
  1574.             Class:ScrollUp()
  1575.             wait(0.2)
  1576.             while scrollEventID == current do
  1577.                 Class:ScrollUp()
  1578.                 if not Class:CanScrollUp() then break end
  1579.                 wait()
  1580.             end
  1581.         end)
  1582.  
  1583.         ScrollUpFrame.MouseButton1Up:connect(function()
  1584.             scrollEventID = tick()
  1585.         end)
  1586.  
  1587.         if horizontal then
  1588.             ScrollBarFrame.MouseButton1Down:connect(function(x,y)
  1589.                 scrollEventID = tick()
  1590.                 local current = scrollEventID
  1591.                 local up_con
  1592.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  1593.                     scrollEventID = tick()
  1594.                     MouseDrag.Parent = nil
  1595.                     ResetButtonColor(ScrollUpFrame)
  1596.                     up_con:disconnect(); drag = nil
  1597.                 end)
  1598.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  1599.                 if x > ScrollThumbFrame.AbsolutePosition.x then
  1600.                     Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1601.                     wait(0.2)
  1602.                     while scrollEventID == current do
  1603.                         if x < ScrollThumbFrame.AbsolutePosition.x + ScrollThumbFrame.AbsoluteSize.x then break end
  1604.                         Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1605.                         wait()
  1606.                     end
  1607.                 else
  1608.                     Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1609.                     wait(0.2)
  1610.                     while scrollEventID == current do
  1611.                         if x > ScrollThumbFrame.AbsolutePosition.x then break end
  1612.                         Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1613.                         wait()
  1614.                     end
  1615.                 end
  1616.             end)
  1617.         else
  1618.             ScrollBarFrame.MouseButton1Down:connect(function(x,y)
  1619.                 scrollEventID = tick()
  1620.                 local current = scrollEventID
  1621.                 local up_con
  1622.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  1623.                     scrollEventID = tick()
  1624.                     MouseDrag.Parent = nil
  1625.                     ResetButtonColor(ScrollUpFrame)
  1626.                     up_con:disconnect(); drag = nil
  1627.                 end)
  1628.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  1629.                 if y > ScrollThumbFrame.AbsolutePosition.y then
  1630.                     Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1631.                     wait(0.2)
  1632.                     while scrollEventID == current do
  1633.                         if y < ScrollThumbFrame.AbsolutePosition.y + ScrollThumbFrame.AbsoluteSize.y then break end
  1634.                         Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1635.                         wait()
  1636.                     end
  1637.                 else
  1638.                     Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1639.                     wait(0.2)
  1640.                     while scrollEventID == current do
  1641.                         if y > ScrollThumbFrame.AbsolutePosition.y then break end
  1642.                         Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1643.                         wait()
  1644.                     end
  1645.                 end
  1646.             end)
  1647.         end
  1648.  
  1649.         if horizontal then
  1650.             ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
  1651.                 scrollEventID = tick()
  1652.                 local mouse_offset = x - ScrollThumbFrame.AbsolutePosition.x
  1653.                 local drag_con
  1654.                 local up_con
  1655.                 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
  1656.                     local bar_abs_pos = ScrollBarFrame.AbsolutePosition.x
  1657.                     local bar_drag = ScrollBarFrame.AbsoluteSize.x - ScrollThumbFrame.AbsoluteSize.x
  1658.                     local bar_abs_one = bar_abs_pos + bar_drag
  1659.                     x = x - mouse_offset
  1660.                     x = x < bar_abs_pos and bar_abs_pos or x > bar_abs_one and bar_abs_one or x
  1661.                     x = x - bar_abs_pos
  1662.                     Class:SetScrollPercent(x/(bar_drag))
  1663.                 end)
  1664.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  1665.                     scrollEventID = tick()
  1666.                     MouseDrag.Parent = nil
  1667.                     ResetButtonColor(ScrollThumbFrame)
  1668.                     drag_con:disconnect(); drag_con = nil
  1669.                     up_con:disconnect(); drag = nil
  1670.                 end)
  1671.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  1672.             end)
  1673.         else
  1674.             ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
  1675.                 scrollEventID = tick()
  1676.                 local mouse_offset = y - ScrollThumbFrame.AbsolutePosition.y
  1677.                 local drag_con
  1678.                 local up_con
  1679.                 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
  1680.                     local bar_abs_pos = ScrollBarFrame.AbsolutePosition.y
  1681.                     local bar_drag = ScrollBarFrame.AbsoluteSize.y - ScrollThumbFrame.AbsoluteSize.y
  1682.                     local bar_abs_one = bar_abs_pos + bar_drag
  1683.                     y = y - mouse_offset
  1684.                     y = y < bar_abs_pos and bar_abs_pos or y > bar_abs_one and bar_abs_one or y
  1685.                     y = y - bar_abs_pos
  1686.                     Class:SetScrollPercent(y/(bar_drag))
  1687.                 end)
  1688.                 up_con = MouseDrag.MouseButton1Up:connect(function()
  1689.                     scrollEventID = tick()
  1690.                     MouseDrag.Parent = nil
  1691.                     ResetButtonColor(ScrollThumbFrame)
  1692.                     drag_con:disconnect(); drag_con = nil
  1693.                     up_con:disconnect(); drag = nil
  1694.                 end)
  1695.                 MouseDrag.Parent = GetScreen(ScrollFrame)
  1696.             end)
  1697.         end
  1698.  
  1699.         function Class:Destroy()
  1700.             ScrollFrame:Destroy()
  1701.             MouseDrag:Destroy()
  1702.             for k in pairs(Class) do
  1703.                 Class[k] = nil
  1704.             end
  1705.             setmetatable(Class,nil)
  1706.         end
  1707.  
  1708.         Update()
  1709.  
  1710.         return Class
  1711.     end
  1712. end
  1713.  
  1714. ----------------------------------------------------------------
  1715. ----------------------------------------------------------------
  1716. ----------------------------------------------------------------
  1717. ----------------------------------------------------------------
  1718. ---- Explorer panel
  1719.  
  1720. Create(explorerPanel,{
  1721.     BackgroundColor3 = GuiColor.Field;
  1722.     BorderColor3 = GuiColor.Border;
  1723.     Active = true;
  1724. })
  1725.  
  1726. local SettingsRemote = explorerPanel.Parent:WaitForChild("SettingsPanel"):WaitForChild("GetSetting")
  1727. local GetApiRemote = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("GetApi")
  1728. local GetAwaitRemote = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("GetAwaiting")
  1729. local bindSetAwaiting = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("SetAwaiting")
  1730.  
  1731. local SaveInstanceWindow = explorerPanel.Parent:WaitForChild("SaveInstance")
  1732. local ConfirmationWindow = explorerPanel.Parent:WaitForChild("Confirmation")
  1733. local CautionWindow = explorerPanel.Parent:WaitForChild("Caution")
  1734. local TableCautionWindow = explorerPanel.Parent:WaitForChild("TableCaution")
  1735.  
  1736. local RemoteWindow = explorerPanel.Parent:WaitForChild("CallRemote")
  1737.  
  1738. local ScriptEditor = explorerPanel.Parent:WaitForChild("ScriptEditor")
  1739. local ScriptEditorEvent = ScriptEditor:WaitForChild("OpenScript")
  1740.  
  1741. local CurrentSaveInstanceWindow
  1742. local CurrentRemoteWindow
  1743.  
  1744. local lastSelectedNode
  1745.  
  1746. local DexStorage
  1747. local DexStorageMain
  1748. local DexStorageEnabled
  1749.  
  1750. if saveinstance then DexStorageEnabled = true end
  1751.  
  1752. local _decompile = decompile;
  1753.  
  1754. function decompile(s, ...)
  1755.     if SettingsRemote:Invoke'UseNewDecompiler' then
  1756.         return _decompile(s, 'new');
  1757.     else
  1758.         return _decompile(s, 'legacy');
  1759.     end
  1760. end
  1761.  
  1762. if DexStorageEnabled then
  1763.     DexStorage = Instance.new("Folder")
  1764.     DexStorage.Name = "Dex"
  1765.     DexStorageMain = Instance.new("Folder",DexStorage)
  1766.     DexStorageMain.Name = "DexStorage"
  1767. end
  1768.  
  1769. local RunningScriptsStorage
  1770. local RunningScriptsStorageMain
  1771. local RunningScriptsStorageEnabled
  1772.  
  1773. if getscripts then RunningScriptsStorageEnabled = true end
  1774.  
  1775. if RunningScriptsStorageEnabled then
  1776.     RunningScriptsStorage = Instance.new("Folder")
  1777.     RunningScriptsStorage.Name = "Dex Internal Storage"
  1778.     RunningScriptsStorageMain = Instance.new("Folder", RunningScriptsStorage)
  1779.     RunningScriptsStorageMain.Name = "Running Scripts"
  1780. end
  1781.  
  1782. local LoadedModulesStorage
  1783. local LoadedModulesStorageMain
  1784. local LoadedModulesStorageEnabled
  1785.  
  1786. if getloadedmodules then LoadedModulesStorageEnabled = true end
  1787.  
  1788. if LoadedModulesStorageEnabled then
  1789.     LoadedModulesStorage = Instance.new("Folder")
  1790.     LoadedModulesStorage.Name = "Dex Internal Storage"
  1791.     LoadedModulesStorageMain = Instance.new("Folder", LoadedModulesStorage)
  1792.     LoadedModulesStorageMain.Name = "Loaded Modules"
  1793. end
  1794.  
  1795. local NilStorage
  1796. local NilStorageMain
  1797. local NilStorageEnabled
  1798.  
  1799. if getnilinstances then NilStorageEnabled = true end
  1800.  
  1801. if NilStorageEnabled then
  1802.     NilStorage = Instance.new("Folder")
  1803.     NilStorage.Name = "Dex Internal Storage"
  1804.     NilStorageMain = Instance.new("Folder",NilStorage)
  1805.     NilStorageMain.Name = "Nil Instances"
  1806. end
  1807.  
  1808. local listFrame = Create('Frame',{
  1809.     Name = "List";
  1810.     BorderSizePixel = 0;
  1811.     BackgroundTransparency = 1;
  1812.     ClipsDescendants = true;
  1813.     Position = UDim2.new(0,0,0,HEADER_SIZE);
  1814.     Size = UDim2.new(1,-GUI_SIZE,1,-HEADER_SIZE);
  1815.     Parent = explorerPanel;
  1816. })
  1817.  
  1818. local scrollBar = ScrollBar(false)
  1819. scrollBar.PageIncrement = 1
  1820. Create(scrollBar.GUI,{
  1821.     Position = UDim2.new(1,-GUI_SIZE,0,HEADER_SIZE);
  1822.     Size = UDim2.new(0,GUI_SIZE,1,-HEADER_SIZE);
  1823.     Parent = explorerPanel;
  1824. })
  1825.  
  1826. local scrollBarH = ScrollBar(true)
  1827. scrollBarH.PageIncrement = GUI_SIZE
  1828. Create(scrollBarH.GUI,{
  1829.     Position = UDim2.new(0,0,1,-GUI_SIZE);
  1830.     Size = UDim2.new(1,-GUI_SIZE,0,GUI_SIZE);
  1831.     Visible = false;
  1832.     Parent = explorerPanel;
  1833. })
  1834.  
  1835. local headerFrame = Create('Frame',{
  1836.     Name = "Header";
  1837.     BorderSizePixel = 0;
  1838.     BackgroundColor3 = GuiColor.Background;
  1839.     BorderColor3 = GuiColor.Border;
  1840.     Position = UDim2.new(0,0,0,0);
  1841.     Size = UDim2.new(1,0,0,HEADER_SIZE);
  1842.     Parent = explorerPanel;
  1843.     Create('TextLabel',{
  1844.         Text = "Explorer";
  1845.         BackgroundTransparency = 1;
  1846.         TextColor3 = GuiColor.Text;
  1847.         TextXAlignment = 'Left';
  1848.         Font = FONT;
  1849.         FontSize = FONT_SIZE;
  1850.         Position = UDim2.new(0,4,0,0);
  1851.         Size = UDim2.new(1,-4,0.5,0);
  1852.     });
  1853. })
  1854.  
  1855. local explorerFilter =  Create('TextBox',{
  1856.     Text = "Filter Workspace";
  1857.     BackgroundTransparency = 0.8;
  1858.     TextColor3 = GuiColor.Text;
  1859.     TextXAlignment = 'Left';
  1860.     Font = FONT;
  1861.     FontSize = FONT_SIZE;
  1862.     Position = UDim2.new(0,4,0.5,0);
  1863.     Size = UDim2.new(1,-8,0.5,-2);
  1864. });
  1865. explorerFilter.Parent = headerFrame
  1866.  
  1867. SetZIndexOnChanged(explorerPanel)
  1868.  
  1869. local function CreateColor3(r, g, b) return Color3.new(r/255,g/255,b/255) end
  1870.  
  1871. local Styles = {
  1872.     Font = Enum.Font.Arial;
  1873.     Margin = 5;
  1874.     Black = CreateColor3(0,0,0);
  1875.     Black2 = CreateColor3(24, 24, 24);
  1876.     White = CreateColor3(244,244,244);
  1877.     Hover = CreateColor3(2, 128, 144);
  1878.     Hover2 = CreateColor3(5, 102, 141);
  1879. }
  1880.  
  1881. local Row = {
  1882.     Font = Styles.Font;
  1883.     FontSize = Enum.FontSize.Size14;
  1884.     TextXAlignment = Enum.TextXAlignment.Left;
  1885.     TextColor = Styles.White;
  1886.     TextColorOver = Styles.White;
  1887.     TextLockedColor = CreateColor3(155,155,155);
  1888.     Height = 24;
  1889.     BorderColor = CreateColor3(216/4,216/4,216/4);
  1890.     BackgroundColor = Styles.Black2;
  1891.     BackgroundColorAlternate = CreateColor3(32, 32, 32);
  1892.     BackgroundColorMouseover = CreateColor3(40, 40, 40);
  1893.     TitleMarginLeft = 15;
  1894. }
  1895.  
  1896. local DropDown = {
  1897.     Font = Styles.Font;
  1898.     FontSize = Enum.FontSize.Size14;
  1899.     TextColor = CreateColor3(255,255,255);
  1900.     TextColorOver = Styles.White;
  1901.     TextXAlignment = Enum.TextXAlignment.Left;
  1902.     Height = 20;
  1903.     BackColor = Styles.Black2;
  1904.     BackColorOver = Styles.Hover2;
  1905.     BorderColor = CreateColor3(45,45,45);
  1906.     BorderSizePixel = 2;
  1907.     ArrowColor = CreateColor3(160/2,160/2,160/2);
  1908.     ArrowColorOver = Styles.Hover;
  1909. }
  1910.  
  1911. local BrickColors = {
  1912.     BoxSize = 13;
  1913.     BorderSizePixel = 1;
  1914.     BorderColor = CreateColor3(160/3,160/3,160/3);
  1915.     FrameColor = CreateColor3(160/3,160/3,160/3);
  1916.     Size = 20;
  1917.     Padding = 4;
  1918.     ColorsPerRow = 8;
  1919.     OuterBorder = 1;
  1920.     OuterBorderColor = Styles.Black;
  1921. }
  1922.  
  1923. local currentRightClickMenu
  1924. local CurrentInsertObjectWindow
  1925. local CurrentFunctionCallerWindow
  1926.  
  1927. local RbxApi
  1928.  
  1929. function ClassCanCreate(IName)
  1930.     local success,err = pcall(function() Instance.new(IName) end)
  1931.     if err then
  1932.         return false
  1933.     else
  1934.         return true
  1935.     end
  1936. end
  1937.  
  1938. function GetClasses()
  1939.     if RbxApi == nil then return {} end
  1940.     local classTable = {}
  1941.     for i,v in pairs(RbxApi.Classes) do
  1942.         if ClassCanCreate(v.Name) then
  1943.             table.insert(classTable,v.Name)
  1944.         end
  1945.     end
  1946.     return classTable
  1947. end
  1948.  
  1949. local function sortAlphabetic(t, property)
  1950.     table.sort(t,
  1951.         function(x,y) return x[property] < y[property]
  1952.         end)
  1953. end
  1954.  
  1955. local function FunctionIsHidden(functionData)
  1956.     local tags = functionData["tags"]
  1957.     for _,name in pairs(tags) do
  1958.         if name == "deprecated"
  1959.             or name == "hidden"
  1960.             or name == "writeonly" then
  1961.             return true
  1962.         end
  1963.     end
  1964.     return false
  1965. end
  1966.  
  1967. local function GetAllFunctions(className)
  1968.     local class = RbxApi.Classes[className]
  1969.     local functions = {}
  1970.  
  1971.     if not class then return functions end
  1972.  
  1973.     while class do
  1974.         if class.Name == "Instance" then break end
  1975.         for _,nextFunction in pairs(class.Functions) do
  1976.             if not FunctionIsHidden(nextFunction) then
  1977.                 table.insert(functions, nextFunction)
  1978.             end
  1979.         end
  1980.         class = RbxApi.Classes[class.Superclass]
  1981.     end
  1982.  
  1983.     sortAlphabetic(functions, "Name")
  1984.  
  1985.     return functions
  1986. end
  1987.  
  1988. function GetFunctions()
  1989.     if RbxApi == nil then return {} end
  1990.     local List = SelectionVar():Get()
  1991.  
  1992.     if #List == 0 then return end
  1993.  
  1994.     local MyObject = List[1]
  1995.  
  1996.     local functionTable = {}
  1997.     for i,v in pairs(GetAllFunctions(MyObject.ClassName)) do
  1998.         table.insert(functionTable,v)
  1999.     end
  2000.     return functionTable
  2001. end
  2002.  
  2003. function CreateInsertObjectMenu(choices, currentChoice, readOnly, onClick)
  2004.     local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  2005.     local totalSize = explorerPanel.Parent.AbsoluteSize.y
  2006.     if #choices == 0 then return end
  2007.  
  2008.     table.sort(choices, function(a,b) return a < b end)
  2009.  
  2010.     local frame = Instance.new("Frame")
  2011.     frame.Name = "InsertObject"
  2012.     frame.Size = UDim2.new(0, 200, 1, 0)
  2013.     frame.BackgroundTransparency = 1
  2014.     frame.Active = true
  2015.  
  2016.     local menu = nil
  2017.     local arrow = nil
  2018.     local expanded = false
  2019.     local margin = DropDown.BorderSizePixel;
  2020.  
  2021.     --[[
  2022.     local button = Instance.new("TextButton")
  2023.     button.Font = Row.Font
  2024.     button.FontSize = Row.FontSize
  2025.     button.TextXAlignment = Row.TextXAlignment
  2026.     button.BackgroundTransparency = 1
  2027.     button.TextColor3 = Row.TextColor
  2028.     if readOnly then
  2029.         button.TextColor3 = Row.TextLockedColor
  2030.     end
  2031.     button.Text = currentChoice
  2032.     button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
  2033.     button.Position = UDim2.new(0, Styles.Margin, 0, 0)
  2034.     button.Parent = frame
  2035.     --]]
  2036.  
  2037.     local function hideMenu()
  2038.         expanded = false
  2039.         --showArrow(DropDown.ArrowColor)
  2040.         if frame then
  2041.             --frame:Destroy()
  2042.             CurrentInsertObjectWindow.Visible = false
  2043.         end
  2044.     end
  2045.  
  2046.     local function showMenu()
  2047.         expanded = true
  2048.         menu = Instance.new("ScrollingFrame")
  2049.         menu.Size = UDim2.new(0,200,1,0)
  2050.         menu.CanvasSize = UDim2.new(0, 200, 0, #choices * DropDown.Height)
  2051.         menu.Position = UDim2.new(0, margin, 0, 0)
  2052.         menu.BackgroundTransparency = 0
  2053.         menu.BackgroundColor3 = DropDown.BackColor
  2054.         menu.BorderColor3 = DropDown.BorderColor
  2055.         menu.BorderSizePixel = DropDown.BorderSizePixel
  2056.         menu.TopImage = "rbxasset://textures/blackBkg_square.png"
  2057.         menu.MidImage = "rbxasset://textures/blackBkg_square.png"
  2058.         menu.BottomImage = "rbxasset://textures/blackBkg_square.png"
  2059.         menu.Active = true
  2060.         menu.ZIndex = 5
  2061.         menu.Parent = frame
  2062.  
  2063.         --local parentFrameHeight = script.Parent.List.Size.Y.Offset
  2064.         --local rowHeight = mouse.Y
  2065.         --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
  2066.         --  menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
  2067.         --end
  2068.  
  2069.         local function choice(name)
  2070.             onClick(name)
  2071.             hideMenu()
  2072.         end
  2073.  
  2074.         for i,name in pairs(choices) do
  2075.             local option = CreateRightClickMenuItem(name, function()
  2076.                 choice(name)
  2077.             end,1)
  2078.             option.Size = UDim2.new(1, 0, 0, 20)
  2079.             option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
  2080.             option.ZIndex = menu.ZIndex
  2081.             option.Parent = menu
  2082.         end
  2083.     end
  2084.  
  2085.  
  2086.     showMenu()
  2087.  
  2088.  
  2089.     return frame
  2090. end
  2091.  
  2092. function CreateFunctionCallerMenu(choices, currentChoice, readOnly, onClick)
  2093.     local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  2094.     local totalSize = explorerPanel.Parent.AbsoluteSize.y
  2095.     if #choices == 0 then return end
  2096.  
  2097.     table.sort(choices, function(a,b) return a.Name < b.Name end)
  2098.  
  2099.     local frame = Instance.new("Frame")
  2100.     frame.Name = "InsertObject"
  2101.     frame.Size = UDim2.new(0, 200, 1, 0)
  2102.     frame.BackgroundTransparency = 1
  2103.     frame.Active = true
  2104.  
  2105.     local menu = nil
  2106.     local arrow = nil
  2107.     local expanded = false
  2108.     local margin = DropDown.BorderSizePixel;
  2109.  
  2110.     local function hideMenu()
  2111.         expanded = false
  2112.         --showArrow(DropDown.ArrowColor)
  2113.         if frame then
  2114.             --frame:Destroy()
  2115.             CurrentInsertObjectWindow.Visible = false
  2116.         end
  2117.     end
  2118.  
  2119.     local function showMenu()
  2120.         expanded = true
  2121.         menu = Instance.new("ScrollingFrame")
  2122.         menu.Size = UDim2.new(0,300,1,0)
  2123.         menu.CanvasSize = UDim2.new(0, 300, 0, #choices * DropDown.Height)
  2124.         menu.Position = UDim2.new(0, margin, 0, 0)
  2125.         menu.BackgroundTransparency = 0
  2126.         menu.BackgroundColor3 = DropDown.BackColor
  2127.         menu.BorderColor3 = DropDown.BorderColor
  2128.         menu.BorderSizePixel = DropDown.BorderSizePixel
  2129.         menu.TopImage = "rbxasset://textures/blackBkg_square.png"
  2130.         menu.MidImage = "rbxasset://textures/blackBkg_square.png"
  2131.         menu.BottomImage = "rbxasset://textures/blackBkg_square.png"
  2132.         menu.Active = true
  2133.         menu.ZIndex = 5
  2134.         menu.Parent = frame
  2135.  
  2136.         --local parentFrameHeight = script.Parent.List.Size.Y.Offset
  2137.         --local rowHeight = mouse.Y
  2138.         --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
  2139.         --  menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
  2140.         --end
  2141.  
  2142.         local function GetParameters(functionData)
  2143.             local paraString = ""
  2144.             paraString = paraString.."("
  2145.             for i,v in pairs(functionData.Arguments) do
  2146.                 paraString = paraString..v.Type.." "..v.Name
  2147.                 if i < #functionData.Arguments then
  2148.                     paraString = paraString..", "
  2149.                 end
  2150.             end
  2151.             paraString = paraString..")"
  2152.             return paraString
  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.ReturnType.." "..name.Name..GetParameters(name), function()
  2162.                 choice(name)
  2163.             end,2)
  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 CreateInsertObject()
  2179.     if not CurrentInsertObjectWindow then return end
  2180.     CurrentInsertObjectWindow.Visible = true
  2181.     if currentRightClickMenu and CurrentInsertObjectWindow.Visible then
  2182.         CurrentInsertObjectWindow.Position = UDim2.new(0,currentRightClickMenu.Position.X.Offset-currentRightClickMenu.Size.X.Offset-2,0,0)
  2183.     end
  2184.     if CurrentInsertObjectWindow.Visible then
  2185.         CurrentInsertObjectWindow.Parent = explorerPanel.Parent
  2186.     end
  2187. end
  2188.  
  2189. function CreateFunctionCaller(oh)
  2190.     if CurrentFunctionCallerWindow then
  2191.         CurrentFunctionCallerWindow:Destroy()
  2192.         CurrentFunctionCallerWindow = nil
  2193.     end
  2194.     CurrentFunctionCallerWindow = CreateFunctionCallerMenu(
  2195.         GetFunctions(),
  2196.         "",
  2197.         false,
  2198.         function(option)
  2199.             CurrentFunctionCallerWindow:Destroy()
  2200.             CurrentFunctionCallerWindow = nil
  2201.             local list = SelectionVar():Get()
  2202.             for i,v in pairs(list) do
  2203.                 pcall(function() print("Function called.", pcall(function() v[option.Name](v) end)) end)
  2204.             end
  2205.  
  2206.             DestroyRightClick()
  2207.         end
  2208.     )
  2209.     if currentRightClickMenu and CurrentFunctionCallerWindow then
  2210.         CurrentFunctionCallerWindow.Position = UDim2.new(0,currentRightClickMenu.Position.X.Offset-currentRightClickMenu.Size.X.Offset*1.5-2,0,0)
  2211.     end
  2212.     if CurrentFunctionCallerWindow then
  2213.         CurrentFunctionCallerWindow.Parent = explorerPanel.Parent
  2214.     end
  2215. end
  2216.  
  2217. local a = {}
  2218. local n = function(c)
  2219.     a[c] = a[c] or {ClassName = c}
  2220.     return a[c]
  2221. end
  2222. function CreateRightClickMenuItem(text, onClick, insObj)
  2223.     local button = Instance.new("TextButton")
  2224.     button.Font = DropDown.Font
  2225.     button.FontSize = DropDown.FontSize
  2226.     button.TextColor3 = DropDown.TextColor
  2227.     button.TextXAlignment = DropDown.TextXAlignment
  2228.     button.BackgroundColor3 = DropDown.BackColor
  2229.     button.AutoButtonColor = false
  2230.     button.BorderSizePixel = 0
  2231.     button.Active = true
  2232.     button.Text = text
  2233.  
  2234.     if insObj == 1 then
  2235.         local newIcon = Icon(nil,ExplorerIndex[text] or 0,(n(button.Text)),20)
  2236.         newIcon.Position = UDim2.new(0,0,0,2)
  2237.         newIcon.Size = UDim2.new(0,16,0,16)
  2238.         newIcon.IconMap.ZIndex = 5
  2239.         newIcon.Parent = button
  2240.         button.Text = "     "..button.Text
  2241.     elseif insObj == 2 then
  2242.         button.FontSize = Enum.FontSize.Size11
  2243.     end
  2244.  
  2245.     button.MouseEnter:connect(function()
  2246.         button.TextColor3 = DropDown.TextColorOver
  2247.         button.BackgroundColor3 = DropDown.BackColorOver
  2248.         if not insObj and CurrentInsertObjectWindow then
  2249.             if CurrentInsertObjectWindow.Visible == false and button.Text == "Insert Object" then
  2250.                 CreateInsertObject()
  2251.             elseif CurrentInsertObjectWindow.Visible and button.Text ~= "Insert Object" then
  2252.                 CurrentInsertObjectWindow.Visible = false
  2253.             end
  2254.         end
  2255.         if not insObj then
  2256.             if CurrentFunctionCallerWindow and button.Text ~= "Call Function" then
  2257.                 CurrentFunctionCallerWindow:Destroy()
  2258.                 CurrentFunctionCallerWindow = nil
  2259.             elseif button.Text == "Call Function" then
  2260.                 CreateFunctionCaller()
  2261.             end
  2262.         end
  2263.     end)
  2264.     button.MouseLeave:connect(function()
  2265.         button.TextColor3 = DropDown.TextColor
  2266.         button.BackgroundColor3 = DropDown.BackColor
  2267.     end)
  2268.     button.MouseButton1Click:connect(function()
  2269.         button.TextColor3 = DropDown.TextColor
  2270.         button.BackgroundColor3 = DropDown.BackColor
  2271.         onClick(text)
  2272.     end)   
  2273.     return button
  2274. end
  2275.  
  2276. function CreateRightClickMenu(choices, currentChoice, readOnly, onClick)
  2277.     local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  2278.  
  2279.     local frame = Instance.new("Frame")
  2280.     frame.Name = "DropDown"
  2281.     frame.Size = UDim2.new(0, 200, 1, 0)
  2282.     frame.BackgroundTransparency = 1
  2283.     frame.Active = true
  2284.  
  2285.     local menu = nil
  2286.     local arrow = nil
  2287.     local expanded = false
  2288.     local margin = DropDown.BorderSizePixel;
  2289.  
  2290.     --[[
  2291.     local button = Instance.new("TextButton")
  2292.     button.Font = Row.Font
  2293.     button.FontSize = Row.FontSize
  2294.     button.TextXAlignment = Row.TextXAlignment
  2295.     button.BackgroundTransparency = 1
  2296.     button.TextColor3 = Row.TextColor
  2297.     if readOnly then
  2298.         button.TextColor3 = Row.TextLockedColor
  2299.     end
  2300.     button.Text = currentChoice
  2301.     button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
  2302.     button.Position = UDim2.new(0, Styles.Margin, 0, 0)
  2303.     button.Parent = frame
  2304.     --]]
  2305.  
  2306.     local function hideMenu()
  2307.         expanded = false
  2308.         --showArrow(DropDown.ArrowColor)
  2309.         if frame then
  2310.             frame:Destroy()
  2311.             DestroyRightClick()
  2312.         end
  2313.     end
  2314.  
  2315.     local function showMenu()
  2316.         expanded = true
  2317.         menu = Instance.new("Frame")
  2318.         menu.Size = UDim2.new(0, 200, 0, #choices * DropDown.Height)
  2319.         menu.Position = UDim2.new(0, margin, 0, 5)
  2320.         menu.BackgroundTransparency = 0
  2321.         menu.BackgroundColor3 = DropDown.BackColor
  2322.         menu.BorderColor3 = DropDown.BorderColor
  2323.         menu.BorderSizePixel = DropDown.BorderSizePixel
  2324.         menu.Active = true
  2325.         menu.ZIndex = 5
  2326.         menu.Parent = frame
  2327.  
  2328.         --local parentFrameHeight = script.Parent.List.Size.Y.Offset
  2329.         --local rowHeight = mouse.Y
  2330.         --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
  2331.         --  menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
  2332.         --end
  2333.  
  2334.         local function choice(name)
  2335.             onClick(name)
  2336.             hideMenu()
  2337.         end
  2338.  
  2339.         for i,name in pairs(choices) do
  2340.             local option = CreateRightClickMenuItem(name, function()
  2341.                 choice(name)
  2342.             end)
  2343.             option.Size = UDim2.new(1, 0, 0, 20)
  2344.             option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
  2345.             option.ZIndex = menu.ZIndex
  2346.             option.Parent = menu
  2347.         end
  2348.     end
  2349.  
  2350.  
  2351.     showMenu()
  2352.  
  2353.  
  2354.     return frame
  2355. end
  2356.  
  2357. function checkMouseInGui(gui)
  2358.     if gui == nil then return false end
  2359.     local plrMouse = game:GetService("Players").LocalPlayer:GetMouse()
  2360.     local guiPosition = gui.AbsolutePosition
  2361.     local guiSize = gui.AbsoluteSize   
  2362.  
  2363.     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
  2364.         return true
  2365.     else
  2366.         return false
  2367.     end
  2368. end
  2369.  
  2370. local clipboard = {}
  2371. local function delete(o)
  2372.     o.Parent = nil
  2373. end
  2374.  
  2375. local getTextWidth do
  2376.     local text = Create('TextLabel',{
  2377.         Name = "TextWidth";
  2378.         TextXAlignment = 'Left';
  2379.         TextYAlignment = 'Center';
  2380.         Font = FONT;
  2381.         FontSize = FONT_SIZE;
  2382.         Text = "";
  2383.         Position = UDim2.new(0,0,0,0);
  2384.         Size = UDim2.new(1,0,1,0);
  2385.         Visible = false;
  2386.         Parent = explorerPanel;
  2387.     })
  2388.     function getTextWidth(s)
  2389.         text.Text = s
  2390.         return text.TextBounds.x
  2391.     end
  2392. end
  2393.  
  2394. local nameScanned = false
  2395. -- Holds the game tree converted to a list.
  2396. local TreeList = {}
  2397. -- Matches objects to their tree node representation.
  2398. local NodeLookup = {}
  2399.  
  2400. local nodeWidth = 0
  2401.  
  2402. local QuickButtons = {}
  2403.  
  2404. function filteringWorkspace()
  2405.     if explorerFilter.Text ~= "" and explorerFilter.Text ~= "Filter Workspace" then
  2406.         return true
  2407.     end
  2408.     return false
  2409. end
  2410.  
  2411. function lookForAName(obj,name)
  2412.     for i,v in pairs(obj:GetChildren()) do
  2413.         if string.find(string.lower(v.Name),string.lower(name)) then nameScanned = true end
  2414.         lookForAName(v,name)
  2415.     end
  2416. end
  2417.  
  2418. function scanName(obj)
  2419.     nameScanned = false
  2420.     if string.find(string.lower(obj.Name),string.lower(explorerFilter.Text)) then
  2421.         nameScanned = true
  2422.     else
  2423.         lookForAName(obj,explorerFilter.Text)
  2424.     end
  2425.     return nameScanned
  2426. end
  2427.  
  2428. function updateActions()
  2429.     for i,v in pairs(QuickButtons) do
  2430.         if v.Cond() then
  2431.             v.Toggle(true)
  2432.         else
  2433.             v.Toggle(false)
  2434.         end
  2435.     end
  2436. end
  2437.  
  2438. local updateList,rawUpdateList,updateScroll,rawUpdateSize do
  2439.     local function r(t)
  2440.         for i = 1,#t do
  2441.             if not filteringWorkspace() or scanName(t[i].Object) then
  2442.                 TreeList[#TreeList+1] = t[i]
  2443.  
  2444.                 local w = (t[i].Depth)*(2+ENTRY_PADDING+GUI_SIZE) + 2 + ENTRY_SIZE + 4 + getTextWidth(t[i].Object.Name) + 4
  2445.                 if w > nodeWidth then
  2446.                     nodeWidth = w
  2447.                 end
  2448.                 if t[i].Expanded or filteringWorkspace() then
  2449.                     r(t[i])
  2450.                 end
  2451.             end
  2452.         end
  2453.     end
  2454.  
  2455.     function rawUpdateSize()
  2456.         scrollBarH.TotalSpace = nodeWidth
  2457.         scrollBarH.VisibleSpace = listFrame.AbsoluteSize.x
  2458.         scrollBarH:Update()
  2459.         local visible = scrollBarH:CanScrollDown() or scrollBarH:CanScrollUp()
  2460.         scrollBarH.GUI.Visible = visible
  2461.  
  2462.         listFrame.Size = UDim2.new(1,-GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
  2463.  
  2464.         scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
  2465.         scrollBar.GUI.Size = UDim2.new(0,GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
  2466.  
  2467.         scrollBar.TotalSpace = #TreeList+1
  2468.         scrollBar:Update()
  2469.     end
  2470.  
  2471.     function rawUpdateList()
  2472.         -- Clear then repopulate the entire list. It appears to be fast enough.
  2473.         TreeList = {}
  2474.         nodeWidth = 0
  2475.         r(NodeLookup[workspace.Parent])
  2476.         r(NodeLookup[DexOutput])
  2477.         if DexStorageEnabled then
  2478.             r(NodeLookup[DexStorage])
  2479.         end
  2480.         if NilStorageEnabled then
  2481.             r(NodeLookup[NilStorage])
  2482.         end
  2483.         if RunningScriptsStorageEnabled then
  2484.             r(NodeLookup[RunningScriptsStorage])
  2485.         end
  2486.         if LoadedModulesStorageEnabled then
  2487.             r(NodeLookup[LoadedModulesStorage])
  2488.         end
  2489.         rawUpdateSize()
  2490.         updateActions()
  2491.     end
  2492.  
  2493.     -- Adding or removing large models will cause many updates to occur. We
  2494.     -- can reduce the number of updates by creating a delay, then dropping any
  2495.     -- updates that occur during the delay.
  2496.     local updatingList = false
  2497.     function updateList()
  2498.         if updatingList or filteringWorkspace() then return end
  2499.         updatingList = true
  2500.         task.wait(0.5)
  2501.         updatingList = false
  2502.         rawUpdateList()
  2503.     end
  2504.  
  2505.     local updatingScroll = false
  2506.     function updateScroll()
  2507.         if updatingScroll then return end
  2508.         updatingScroll = true
  2509.         task.wait(0.5)
  2510.         updatingScroll = false
  2511.         scrollBar:Update()
  2512.     end
  2513. end
  2514.  
  2515. local Selection do
  2516.     local bindGetSelection = explorerPanel:FindFirstChild("GetSelection")
  2517.     if not bindGetSelection then
  2518.         bindGetSelection = Create('BindableFunction',{Name = "GetSelection"})
  2519.         bindGetSelection.Parent = explorerPanel
  2520.     end
  2521.  
  2522.     local bindSetSelection = explorerPanel:FindFirstChild("SetSelection")
  2523.     if not bindSetSelection then
  2524.         bindSetSelection = Create('BindableFunction',{Name = "SetSelection"})
  2525.         bindSetSelection.Parent = explorerPanel
  2526.     end
  2527.  
  2528.     local bindSelectionChanged = explorerPanel:FindFirstChild("SelectionChanged")
  2529.     if not bindSelectionChanged then
  2530.         bindSelectionChanged = Create('BindableEvent',{Name = "SelectionChanged"})
  2531.         bindSelectionChanged.Parent = explorerPanel
  2532.     end
  2533.  
  2534.     local SelectionList = {}
  2535.     local SelectionSet = {}
  2536.     local Updates = true
  2537.     Selection = {
  2538.         Selected = SelectionSet;
  2539.         List = SelectionList;
  2540.     }
  2541.  
  2542.     local function addObject(object)
  2543.         -- list update
  2544.         local lupdate = false
  2545.         -- scroll update
  2546.         local supdate = false
  2547.  
  2548.         if not SelectionSet[object] then
  2549.             local node = NodeLookup[object]
  2550.             if node then
  2551.                 table.insert(SelectionList,object)
  2552.                 SelectionSet[object] = true
  2553.                 node.Selected = true
  2554.  
  2555.                 -- expand all ancestors so that selected node becomes visible
  2556.                 node = node.Parent
  2557.                 while node do
  2558.                     if not node.Expanded then
  2559.                         node.Expanded = true
  2560.                         lupdate = true
  2561.                     end
  2562.                     node = node.Parent
  2563.                 end
  2564.                 supdate = true
  2565.             end
  2566.         end
  2567.         return lupdate,supdate
  2568.     end
  2569.  
  2570.     function Selection:Set(objects)
  2571.         local lupdate = false
  2572.         local supdate = false
  2573.  
  2574.         if #SelectionList > 0 then
  2575.             for i = 1,#SelectionList do
  2576.                 local object = SelectionList[i]
  2577.                 local node = NodeLookup[object]
  2578.                 if node then
  2579.                     node.Selected = false
  2580.                     SelectionSet[object] = nil
  2581.                 end
  2582.             end
  2583.  
  2584.             SelectionList = {}
  2585.             Selection.List = SelectionList
  2586.             supdate = true
  2587.         end
  2588.  
  2589.         for i = 1,#objects do
  2590.             local l,s = addObject(objects[i])
  2591.             lupdate = l or lupdate
  2592.             supdate = s or supdate
  2593.         end
  2594.  
  2595.         if lupdate then
  2596.             rawUpdateList()
  2597.             supdate = true
  2598.         elseif supdate then
  2599.             scrollBar:Update()
  2600.         end
  2601.  
  2602.         if supdate then
  2603.             bindSelectionChanged:Fire()
  2604.             updateActions()
  2605.         end
  2606.     end
  2607.  
  2608.     function Selection:Add(object)
  2609.         local l,s = addObject(object)
  2610.         if l then
  2611.             rawUpdateList()
  2612.             if Updates then
  2613.                 bindSelectionChanged:Fire()
  2614.                 updateActions()
  2615.             end
  2616.         elseif s then
  2617.             scrollBar:Update()
  2618.             if Updates then
  2619.                 bindSelectionChanged:Fire()
  2620.                 updateActions()
  2621.             end
  2622.         end
  2623.     end
  2624.  
  2625.     function Selection:StopUpdates()
  2626.         Updates = false
  2627.     end
  2628.  
  2629.     function Selection:ResumeUpdates()
  2630.         Updates = true
  2631.         bindSelectionChanged:Fire()
  2632.         updateActions()
  2633.     end
  2634.  
  2635.     function Selection:Remove(object,noupdate)
  2636.         if SelectionSet[object] then
  2637.             local node = NodeLookup[object]
  2638.             if node then
  2639.                 node.Selected = false
  2640.                 SelectionSet[object] = nil
  2641.                 for i = 1,#SelectionList do
  2642.                     if SelectionList[i] == object then
  2643.                         table.remove(SelectionList,i)
  2644.                         break
  2645.                     end
  2646.                 end
  2647.  
  2648.                 if not noupdate then
  2649.                     scrollBar:Update()
  2650.                 end
  2651.                 bindSelectionChanged:Fire()
  2652.                 updateActions()
  2653.             end
  2654.         end
  2655.     end
  2656.  
  2657.     function Selection:Get()
  2658.         local list = {}
  2659.         for i = 1,#SelectionList do
  2660.             list[i] = SelectionList[i]
  2661.         end
  2662.         return list
  2663.     end
  2664.  
  2665.     bindSetSelection.OnInvoke = function(...)
  2666.         Selection:Set(...)
  2667.     end
  2668.  
  2669.     bindGetSelection.OnInvoke = function()
  2670.         return Selection:Get()
  2671.     end
  2672. end
  2673.  
  2674. function CreateCaution(title,msg)
  2675.     local newCaution = CautionWindow
  2676.     newCaution.Visible = true
  2677.     newCaution.Title.Text = title
  2678.     newCaution.MainWindow.Desc.Text = msg
  2679.     newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
  2680.         newCaution.Visible = false
  2681.     end)
  2682. end
  2683.  
  2684. function CreateTableCaution(title,msg)
  2685.     if type(msg) ~= "table" then return CreateCaution(title,tostring(msg)) end
  2686.     local newCaution = TableCautionWindow:Clone()
  2687.     newCaution.Title.Text = title
  2688.  
  2689.     local TableList = newCaution.MainWindow.TableResults
  2690.     local TableTemplate = newCaution.MainWindow.TableTemplate
  2691.  
  2692.     for i,v in pairs(msg) do
  2693.         local newResult = TableTemplate:Clone()
  2694.         newResult.Type.Text = type(v)
  2695.         newResult.Value.Text = tostring(v)
  2696.         newResult.Position = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
  2697.         newResult.Parent = TableList
  2698.         TableList.CanvasSize = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
  2699.         newResult.Visible = true
  2700.     end
  2701.     newCaution.Parent = explorerPanel.Parent
  2702.     newCaution.Visible = true
  2703.     newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
  2704.         newCaution:Destroy()
  2705.     end)
  2706. end
  2707.  
  2708. local function Split(str, delimiter)
  2709.     local start = 1
  2710.     local t = {}
  2711.     while true do
  2712.         local pos = string.find (str, delimiter, start, true)
  2713.         if not pos then
  2714.             break
  2715.         end
  2716.         table.insert (t, string.sub (str, start, pos - 1))
  2717.         start = pos + string.len (delimiter)
  2718.     end
  2719.     table.insert (t, string.sub (str, start))
  2720.     return t
  2721. end
  2722.  
  2723. local function ToValue(value,type)
  2724.     if type == "Vector2" then
  2725.         local list = Split(value,",")
  2726.         if #list < 2 then return nil end
  2727.         local x = tonumber(list[1]) or 0
  2728.         local y = tonumber(list[2]) or 0
  2729.         return Vector2.new(x,y)
  2730.     elseif type == "Vector3" then
  2731.         local list = Split(value,",")
  2732.         if #list < 3 then return nil end
  2733.         local x = tonumber(list[1]) or 0
  2734.         local y = tonumber(list[2]) or 0
  2735.         local z = tonumber(list[3]) or 0
  2736.         return Vector3.new(x,y,z)
  2737.     elseif type == "Color3" then
  2738.         local list = Split(value,",")
  2739.         if #list < 3 then return nil end
  2740.         local r = tonumber(list[1]) or 0
  2741.         local g = tonumber(list[2]) or 0
  2742.         local b = tonumber(list[3]) or 0
  2743.         return Color3.new(r/255,g/255, b/255)
  2744.     elseif type == "UDim2" then
  2745.         local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
  2746.         if #list < 4 then return nil end
  2747.         local xScale = tonumber(list[1]) or 0
  2748.         local xOffset = tonumber(list[2]) or 0
  2749.         local yScale = tonumber(list[3]) or 0
  2750.         local yOffset = tonumber(list[4]) or 0
  2751.         return UDim2.new(xScale, xOffset, yScale, yOffset)
  2752.     elseif type == "Number" then
  2753.         return tonumber(value)
  2754.     elseif type == "String" then
  2755.         return value
  2756.     elseif type == "NumberRange" then
  2757.         local list = Split(value,",")
  2758.         if #list == 1 then
  2759.             if tonumber(list[1]) == nil then return nil end
  2760.             local newVal = tonumber(list[1]) or 0
  2761.             return NumberRange.new(newVal)
  2762.         end
  2763.         if #list < 2 then return nil end
  2764.         local x = tonumber(list[1]) or 0
  2765.         local y = tonumber(list[2]) or 0
  2766.         return NumberRange.new(x,y)
  2767.     elseif type == "Script" then
  2768.         local success,err = ypcall(function()
  2769.             _G.D_E_X_DONOTUSETHISPLEASE = nil
  2770.             loadstring(
  2771.                 "_G.D_E_X_DONOTUSETHISPLEASE = "..value
  2772.             )()
  2773.             return _G.D_E_X_DONOTUSETHISPLEASE
  2774.         end)
  2775.         if err then
  2776.             return nil
  2777.         end
  2778.     else
  2779.         return nil
  2780.     end
  2781. end
  2782.  
  2783. local function ToPropValue(value,type)
  2784.     if type == "Vector2" then
  2785.         local list = Split(value,",")
  2786.         if #list < 2 then return nil end
  2787.         local x = tonumber(list[1]) or 0
  2788.         local y = tonumber(list[2]) or 0
  2789.         return Vector2.new(x,y)
  2790.     elseif type == "Vector3" then
  2791.         local list = Split(value,",")
  2792.         if #list < 3 then return nil end
  2793.         local x = tonumber(list[1]) or 0
  2794.         local y = tonumber(list[2]) or 0
  2795.         local z = tonumber(list[3]) or 0
  2796.         return Vector3.new(x,y,z)
  2797.     elseif type == "Color3" then
  2798.         local list = Split(value,",")
  2799.         if #list < 3 then return nil end
  2800.         local r = tonumber(list[1]) or 0
  2801.         local g = tonumber(list[2]) or 0
  2802.         local b = tonumber(list[3]) or 0
  2803.         return Color3.new(r/255,g/255, b/255)
  2804.     elseif type == "UDim2" then
  2805.         local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
  2806.         if #list < 4 then return nil end
  2807.         local xScale = tonumber(list[1]) or 0
  2808.         local xOffset = tonumber(list[2]) or 0
  2809.         local yScale = tonumber(list[3]) or 0
  2810.         local yOffset = tonumber(list[4]) or 0
  2811.         return UDim2.new(xScale, xOffset, yScale, yOffset)
  2812.     elseif type == "Content" then
  2813.         return value
  2814.     elseif type == "float" or type == "int" or type == "double" then
  2815.         return tonumber(value)
  2816.     elseif type == "string" then
  2817.         return value
  2818.     elseif type == "NumberRange" then
  2819.         local list = Split(value,",")
  2820.         if #list == 1 then
  2821.             if tonumber(list[1]) == nil then return nil end
  2822.             local newVal = tonumber(list[1]) or 0
  2823.             return NumberRange.new(newVal)
  2824.         end
  2825.         if #list < 2 then return nil end
  2826.         local x = tonumber(list[1]) or 0
  2827.         local y = tonumber(list[2]) or 0
  2828.         return NumberRange.new(x,y)
  2829.     elseif string.sub(value,1,4) == "Enum" then
  2830.         local getEnum = value
  2831.         while true do
  2832.             local x,y = string.find(getEnum,".")
  2833.             if y then
  2834.                 getEnum = string.sub(getEnum,y+1)
  2835.             else
  2836.                 break
  2837.             end
  2838.         end
  2839.         print(getEnum)
  2840.         return getEnum
  2841.     else
  2842.         return nil
  2843.     end
  2844. end
  2845.  
  2846. function PromptRemoteCaller(inst)
  2847.     if CurrentRemoteWindow then
  2848.         CurrentRemoteWindow:Destroy()
  2849.         CurrentRemoteWindow = nil
  2850.     end
  2851.     CurrentRemoteWindow = RemoteWindow:Clone()
  2852.     CurrentRemoteWindow.Parent = explorerPanel.Parent
  2853.     CurrentRemoteWindow.Visible = true
  2854.  
  2855.     local displayValues = false
  2856.  
  2857.     local ArgumentList = CurrentRemoteWindow.MainWindow.Arguments
  2858.     local ArgumentTemplate = CurrentRemoteWindow.MainWindow.ArgumentTemplate
  2859.  
  2860.     if inst:IsA("RemoteEvent") then
  2861.         CurrentRemoteWindow.Title.Text = "Fire Event"
  2862.         CurrentRemoteWindow.MainWindow.Ok.Text = "Fire"
  2863.         CurrentRemoteWindow.MainWindow.DisplayReturned.Visible = false
  2864.         CurrentRemoteWindow.MainWindow.Desc2.Visible = false
  2865.     end
  2866.  
  2867.     local newArgument = ArgumentTemplate:Clone()
  2868.     newArgument.Parent = ArgumentList
  2869.     newArgument.Visible = true
  2870.     newArgument.Type.MouseButton1Down:connect(function()
  2871.         createDDown(newArgument.Type,function(choice)
  2872.             newArgument.Type.Text = choice
  2873.         end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
  2874.     end)
  2875.  
  2876.     CurrentRemoteWindow.MainWindow.Ok.MouseButton1Up:connect(function()
  2877.         if CurrentRemoteWindow and inst.Parent ~= nil then
  2878.             local MyArguments = {}
  2879.             for i,v in pairs(ArgumentList:GetChildren()) do
  2880.                 table.insert(MyArguments,ToValue(v.Value.Text,v.Type.Text))
  2881.             end
  2882.             if inst:IsA("RemoteFunction") then
  2883.                 if displayValues then
  2884.                     spawn(function()
  2885.                         local myResults = inst:InvokeServer(unpack(MyArguments))
  2886.                         if myResults then
  2887.                             CreateTableCaution("Remote Caller",myResults)
  2888.                         else
  2889.                             CreateCaution("Remote Caller","This remote did not return anything.")
  2890.                         end
  2891.                     end)
  2892.                 else
  2893.                     spawn(function()
  2894.                         inst:InvokeServer(unpack(MyArguments))
  2895.                     end)
  2896.                 end
  2897.             else
  2898.                 inst:FireServer(unpack(MyArguments))
  2899.             end
  2900.             CurrentRemoteWindow:Destroy()
  2901.             CurrentRemoteWindow = nil
  2902.         end
  2903.     end)
  2904.  
  2905.     CurrentRemoteWindow.MainWindow.Add.MouseButton1Up:connect(function()
  2906.         if CurrentRemoteWindow then
  2907.             local newArgument = ArgumentTemplate:Clone()
  2908.             newArgument.Position = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
  2909.             newArgument.Parent = ArgumentList
  2910.             ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
  2911.             newArgument.Visible = true
  2912.             newArgument.Type.MouseButton1Down:connect(function()
  2913.                 createDDown(newArgument.Type,function(choice)
  2914.                     newArgument.Type.Text = choice
  2915.                 end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
  2916.             end)
  2917.         end
  2918.     end)
  2919.  
  2920.     CurrentRemoteWindow.MainWindow.Subtract.MouseButton1Up:connect(function()
  2921.         if CurrentRemoteWindow then
  2922.             if #ArgumentList:GetChildren() > 1 then
  2923.                 ArgumentList:GetChildren()[#ArgumentList:GetChildren()]:Destroy()
  2924.                 ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
  2925.             end
  2926.         end
  2927.     end)
  2928.  
  2929.     CurrentRemoteWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
  2930.         if CurrentRemoteWindow then
  2931.             CurrentRemoteWindow:Destroy()
  2932.             CurrentRemoteWindow = nil
  2933.         end
  2934.     end)
  2935.  
  2936.     CurrentRemoteWindow.MainWindow.DisplayReturned.MouseButton1Up:connect(function()
  2937.         if displayValues then
  2938.             displayValues = false
  2939.             CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = false
  2940.         else
  2941.             displayValues = true
  2942.             CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = true
  2943.         end
  2944.     end)
  2945. end
  2946.  
  2947. function PromptSaveInstance(inst)
  2948.     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
  2949.     if CurrentSaveInstanceWindow then
  2950.         CurrentSaveInstanceWindow:Destroy()
  2951.         CurrentSaveInstanceWindow = nil
  2952.         if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
  2953.             explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
  2954.         end
  2955.     end
  2956.     CurrentSaveInstanceWindow = SaveInstanceWindow:Clone()
  2957.     CurrentSaveInstanceWindow.Parent = explorerPanel.Parent
  2958.     CurrentSaveInstanceWindow.Visible = true
  2959.  
  2960.     local filename = CurrentSaveInstanceWindow.MainWindow.FileName
  2961.     local saveObjects = true
  2962.     local overwriteCaution = false
  2963.  
  2964.     CurrentSaveInstanceWindow.MainWindow.Save.MouseButton1Up:connect(function()
  2965.         --[[if readfile and getelysianpath then
  2966.             if readfile(getelysianpath()..filename.Text..".rbxmx") then
  2967.                 if not overwriteCaution then
  2968.                     overwriteCaution = true
  2969.                     local newCaution = ConfirmationWindow:Clone()
  2970.                     newCaution.Name = "SaveInstanceOverwriteCaution"
  2971.                     newCaution.MainWindow.Desc.Text = "The file, "..filename.Text..".rbxmx, already exists. Overwrite?"
  2972.                     newCaution.Parent = explorerPanel.Parent
  2973.                     newCaution.Visible = true
  2974.                     newCaution.MainWindow.Yes.MouseButton1Up:connect(function()
  2975.                         ypcall(function()
  2976.                             SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
  2977.                         end)
  2978.                         overwriteCaution = false
  2979.                         newCaution:Destroy()
  2980.                         if CurrentSaveInstanceWindow then
  2981.                             CurrentSaveInstanceWindow:Destroy()
  2982.                             CurrentSaveInstanceWindow = nil
  2983.                         end
  2984.                     end)
  2985.                     newCaution.MainWindow.No.MouseButton1Up:connect(function()
  2986.                         overwriteCaution = false
  2987.                         newCaution:Destroy()
  2988.                     end)
  2989.                 end
  2990.             else
  2991.                 ypcall(function()
  2992.                     SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
  2993.                 end)
  2994.                 if CurrentSaveInstanceWindow then
  2995.                     CurrentSaveInstanceWindow:Destroy()
  2996.                     CurrentSaveInstanceWindow = nil
  2997.                     if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
  2998.                         explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
  2999.                     end
  3000.                 end
  3001.             end
  3002.         else
  3003.             ypcall(function()
  3004.                 if SaveInstance then
  3005.                     SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
  3006.                 else
  3007.                     _G.SaveInstance(inst,filename.Text,not saveObjects)
  3008.                 end
  3009.             end)
  3010.             if CurrentSaveInstanceWindow then
  3011.                 CurrentSaveInstanceWindow:Destroy()
  3012.                 CurrentSaveInstanceWindow = nil
  3013.                 if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
  3014.                     explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
  3015.                 end
  3016.             end
  3017.         end]]
  3018.     end)
  3019.     CurrentSaveInstanceWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
  3020.         if CurrentSaveInstanceWindow then
  3021.             CurrentSaveInstanceWindow:Destroy()
  3022.             CurrentSaveInstanceWindow = nil
  3023.             if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
  3024.                 explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
  3025.             end
  3026.         end
  3027.     end)
  3028.     CurrentSaveInstanceWindow.MainWindow.SaveObjects.MouseButton1Up:connect(function()
  3029.         if saveObjects then
  3030.             saveObjects = false
  3031.             CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = false
  3032.         else
  3033.             saveObjects = true
  3034.             CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = true
  3035.         end
  3036.     end)
  3037. end
  3038.  
  3039. function DestroyRightClick()
  3040.     if currentRightClickMenu then
  3041.         currentRightClickMenu:Destroy()
  3042.         currentRightClickMenu = nil
  3043.     end
  3044.     if CurrentInsertObjectWindow and CurrentInsertObjectWindow.Visible then
  3045.         CurrentInsertObjectWindow.Visible = false
  3046.     end
  3047. end
  3048.  
  3049. local tabChar = "    "
  3050.  
  3051. local function getSmaller(a, b, notLast)
  3052.     local aByte = a:byte() or -1
  3053.     local bByte = b:byte() or -1
  3054.     if aByte == bByte then
  3055.         if notLast and #a == 1 and #b == 1 then
  3056.             return -1
  3057.         elseif #b == 1 then
  3058.             return false
  3059.         elseif #a == 1 then
  3060.             return true
  3061.         else
  3062.             return getSmaller(a:sub(2), b:sub(2), notLast)
  3063.         end
  3064.     else
  3065.         return aByte < bByte
  3066.     end
  3067. end
  3068.  
  3069. local function parseData(obj, numTabs, isKey, overflow, noTables, forceDict)
  3070.     local objType = typeof(obj)
  3071.     local objStr = tostring(obj)
  3072.     if objType == "table" then
  3073.         if noTables then
  3074.             return objStr
  3075.         end
  3076.         local isCyclic = overflow[obj]
  3077.         overflow[obj] = true
  3078.         local out = {}
  3079.         local nextIndex = 1
  3080.         local isDict = false
  3081.         local hasTables = false
  3082.         local data = {}
  3083.  
  3084.         for key, val in next, obj do
  3085.             if not hasTables and typeof(val) == "table" then
  3086.                 hasTables = true
  3087.             end
  3088.  
  3089.             if not isDict and key ~= nextIndex then
  3090.                 isDict = true
  3091.             else
  3092.                 nextIndex = nextIndex + 1
  3093.             end
  3094.  
  3095.             data[#data+1] = {key, val}
  3096.         end
  3097.  
  3098.         if isDict or hasTables or forceDict then
  3099.             out[#out+1] = (isCyclic and "Cyclic " or "") .. "{"
  3100.             table.sort(data, function(a, b)
  3101.                 local aType = typeof(a[2])
  3102.                 local bType = typeof(b[2])
  3103.                 if bType == "string" and aType ~= "string" then
  3104.                     return false
  3105.                 end
  3106.                 local res = getSmaller(aType, bType, true)
  3107.                 if res == -1 then
  3108.                     return getSmaller(tostring(a[1]), tostring(b[1]))
  3109.                 else
  3110.                     return res
  3111.                 end
  3112.             end)
  3113.             for i = 1, #data do
  3114.                 local arr = data[i]
  3115.                 local nowKey = arr[1]
  3116.                 local nowVal = arr[2]
  3117.                 local parseKey = parseData(nowKey, numTabs+1, true, overflow, isCyclic)
  3118.                 local parseVal = parseData(nowVal, numTabs+1, false, overflow, isCyclic)
  3119.                 if isDict then
  3120.                     local nowValType = typeof(nowVal)
  3121.                     local preStr = ""
  3122.                     local postStr = ""
  3123.                     if i > 1 and (nowValType == "table" or typeof(data[i-1][2]) ~= nowValType) then
  3124.                         preStr = "\n"
  3125.                     end
  3126.                     if i < #data and nowValType == "table" and typeof(data[i+1][2]) ~= "table" and typeof(data[i+1][2]) == nowValType then
  3127.                         postStr = "\n"
  3128.                     end
  3129.                     out[#out+1] = preStr .. string.rep(tabChar, numTabs+1) .. parseKey .. " = " .. parseVal .. ";" .. postStr
  3130.                 else
  3131.                     out[#out+1] = string.rep(tabChar, numTabs+1) .. parseVal .. ";"
  3132.                 end
  3133.             end
  3134.             out[#out+1] = string.rep(tabChar, numTabs) .. "}"
  3135.         else
  3136.             local data2 = {}
  3137.             for i = 1, #data do
  3138.                 local arr = data[i]
  3139.                 local nowVal = arr[2]
  3140.                 local parseVal = parseData(nowVal, 0, false, overflow, isCyclic)
  3141.                 data2[#data2+1] = parseVal
  3142.             end
  3143.             out[#out+1] = "{" .. table.concat(data2, ", ") .. "}"
  3144.         end
  3145.  
  3146.         return table.concat(out, "\n")
  3147.     else
  3148.         local returnVal = nil
  3149.         if (objType == "string" or objType == "Content") and (not isKey or tonumber(obj:sub(1, 1))) then
  3150.             local retVal = '"' .. objStr .. '"'
  3151.             if isKey then
  3152.                 retVal = "[" .. retVal .. "]"
  3153.             end
  3154.             returnVal = retVal
  3155.         elseif objType == "EnumItem" then
  3156.             returnVal = "Enum." .. tostring(obj.EnumType) .. "." .. obj.Name
  3157.         elseif objType == "Enum" then
  3158.             returnVal = "Enum." .. objStr
  3159.         elseif objType == "Instance" then
  3160.             returnVal = obj.Parent and obj:GetFullName() or obj.ClassName
  3161.         elseif objType == "CFrame" then
  3162.             returnVal = "CFrame.new(" .. objStr .. ")"
  3163.         elseif objType == "Vector3" then
  3164.             returnVal = "Vector3.new(" .. objStr .. ")"
  3165.         elseif objType == "Vector2" then
  3166.             returnVal = "Vector2.new(" .. objStr .. ")"
  3167.         elseif objType == "UDim2" then
  3168.             returnVal = "UDim2.new(" .. objStr:gsub("[{}]", "") .. ")"
  3169.         elseif objType == "BrickColor" then
  3170.             returnVal = "BrickColor.new(\"" .. objStr .. "\")"
  3171.         elseif objType == "Color3" then
  3172.             returnVal = "Color3.new(" .. objStr .. ")"
  3173.         elseif objType == "NumberRange" then
  3174.             returnVal = "NumberRange.new(" .. objStr:gsub("^%s*(.-)%s*$", "%1"):gsub(" ", ", ") .. ")"
  3175.         elseif objType == "PhysicalProperties" then
  3176.             returnVal = "PhysicalProperties.new(" .. objStr .. ")"
  3177.         else
  3178.             returnVal = objStr
  3179.         end
  3180.         return returnVal
  3181.     end
  3182. end
  3183.  
  3184. function tableToString(t)
  3185.     local success, result = pcall(function()
  3186.         return parseData(t, 0, false, {}, nil, false)
  3187.     end)
  3188.     return success and result or 'error';
  3189. end
  3190.  
  3191. local HasSpecial = function(string)
  3192.     return (string:match("%c") or string:match("%s") or string:match("%p")) ~= nil
  3193. end
  3194.  
  3195. local GetPath = function(Instance) -- ripped from some random script
  3196.     local Obj = Instance
  3197.     local string = {}
  3198.     local temp = {}
  3199.     local error = false
  3200.  
  3201.     while Obj ~= game do
  3202.         if Obj == nil then
  3203.             error = true
  3204.             break
  3205.         end
  3206.         table.insert(temp, Obj.Parent == game and Obj.ClassName or tostring(Obj))
  3207.         Obj = Obj.Parent
  3208.     end
  3209.  
  3210.     table.insert(string, "game:GetService(\"" .. temp[#temp] .. "\")")
  3211.  
  3212.     for i = #temp - 1, 1, -1 do
  3213.         table.insert(string, HasSpecial(temp[i]) and "[\"" .. temp[i] .. "\"]" or "." .. temp[i])
  3214.     end
  3215.  
  3216.     return (error and "nil -- Path contained an invalid instance" or table.concat(string, ""))
  3217. end
  3218.  
  3219. function rightClickMenu(sObj)
  3220.     local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  3221.  
  3222.     local extra = ((sObj == RunningScriptsStorageMain or sObj == LoadedModulesStorageMain or sObj == NilStorageMain) and 'Refresh Instances' or nil)
  3223.  
  3224.     currentRightClickMenu = CreateRightClickMenu(
  3225.         {
  3226.             'Cut',
  3227.             'Copy',
  3228.             'Paste Into',
  3229.             'Duplicate',
  3230.             'Delete',
  3231.             -- 'Group',
  3232.             -- 'Ungroup',
  3233.             'Select Children',
  3234.             'Teleport To',
  3235.             -- 'Insert Part',
  3236.             'Insert Object',
  3237.             'View Script',
  3238.             'Save Script',
  3239.             -- 'Save Instance',
  3240.             'Copy Path',
  3241.             'Call Function',
  3242.             'Call Remote',
  3243.             extra
  3244.         },
  3245.         "",
  3246.         false,
  3247.         function(option)
  3248.             if option == "Cut" then
  3249.                 if not Option.Modifiable then return end
  3250.                 clipboard = {}
  3251.                 local list = Selection.List
  3252.                 local cut = {}
  3253.                 for i = 1,#list do
  3254.                     local obj = list[i]:Clone()
  3255.                     if obj then
  3256.                         table.insert(clipboard,obj)
  3257.                         table.insert(cut,list[i])
  3258.                     end
  3259.                 end
  3260.                 for i = 1,#cut do
  3261.                     pcall(delete,cut[i])
  3262.                 end
  3263.                 updateActions()
  3264.             elseif option == "Copy" then
  3265.                 if not Option.Modifiable then return end
  3266.                 clipboard = {}
  3267.                 local list = Selection.List
  3268.                 for i = 1,#list do
  3269.                     table.insert(clipboard,list[i]:Clone())
  3270.                 end
  3271.                 updateActions()
  3272.             elseif option == "Paste Into" then
  3273.                 if not Option.Modifiable then return end
  3274.                 local parent = Selection.List[1] or workspace
  3275.                 for i = 1,#clipboard do
  3276.                     clipboard[i]:Clone().Parent = parent
  3277.                 end
  3278.             elseif option == "Duplicate" then
  3279.                 if not Option.Modifiable then return end
  3280.                 local list = Selection:Get()
  3281.                 for i = 1,#list do
  3282.                     list[i]:Clone().Parent = Selection.List[1].Parent or workspace
  3283.                 end
  3284.             elseif option == "Delete" then
  3285.                 if not Option.Modifiable then return end
  3286.                 local list = Selection:Get()
  3287.                 for i = 1,#list do
  3288.                     pcall(delete,list[i])
  3289.                 end
  3290.                 Selection:Set({})
  3291.             elseif option == "Group" then
  3292.                 if not Option.Modifiable then return end
  3293.                 local newModel = Instance.new("Model")
  3294.                 local list = Selection:Get()
  3295.                 newModel.Parent = Selection.List[1].Parent or workspace
  3296.                 for i = 1,#list do
  3297.                     list[i].Parent = newModel
  3298.                 end
  3299.                 Selection:Set({})
  3300.             elseif option == "Ungroup" then
  3301.                 if not Option.Modifiable then return end
  3302.                 local ungrouped = {}
  3303.                 local list = Selection:Get()
  3304.                 for i = 1,#list do
  3305.                     if list[i]:IsA("Model") then
  3306.                         for i2,v2 in pairs(list[i]:GetChildren()) do
  3307.                             v2.Parent = list[i].Parent or workspace
  3308.                             table.insert(ungrouped,v2)
  3309.                         end    
  3310.                         pcall(delete,list[i])          
  3311.                     end
  3312.                 end
  3313.                 Selection:Set({})
  3314.                 if SettingsRemote:Invoke("SelectUngrouped") then
  3315.                     for i,v in pairs(ungrouped) do
  3316.                         Selection:Add(v)
  3317.                     end
  3318.                 end
  3319.             elseif option == "Select Children" then
  3320.                 if not Option.Modifiable then return end
  3321.                 local list = Selection:Get()
  3322.                 Selection:Set({})
  3323.                 Selection:StopUpdates()
  3324.                 for i = 1,#list do
  3325.                     for i2,v2 in pairs(list[i]:GetChildren()) do
  3326.                         Selection:Add(v2)
  3327.                     end
  3328.                 end
  3329.                 Selection:ResumeUpdates()
  3330.             elseif option == "Teleport To" then
  3331.                 if not Option.Modifiable then return end
  3332.                 local list = Selection:Get()
  3333.                 for i = 1,#list do
  3334.                     if list[i]:IsA("BasePart") then
  3335.                         pcall(function()
  3336.                             game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = list[i].CFrame * CFrame.new(0, 3, 0);
  3337.                         end)
  3338.                         break
  3339.                     end
  3340.                 end
  3341.             elseif option == "Insert Part" then
  3342.                 if not Option.Modifiable then return end
  3343.                 local insertedParts = {}
  3344.                 local list = Selection:Get()
  3345.                 for i = 1,#list do
  3346.                     pcall(function()
  3347.                         local newPart = Instance.new("Part")
  3348.                         newPart.Parent = list[i]
  3349.                         newPart.CFrame = CFrame.new(game:GetService("Players").LocalPlayer.Character.Head.Position) + Vector3.new(0,3,0)
  3350.                         table.insert(insertedParts,newPart)
  3351.                     end)
  3352.                 end
  3353.             elseif option == "Save Instance" then
  3354.                 if not Option.Modifiable then return end
  3355.                 local list = Selection:Get()
  3356.                 if #list == 1 then
  3357.                     list[1].Archivable = true
  3358.                     ypcall(function()PromptSaveInstance(list[1]:Clone())end)
  3359.                 elseif #list > 1 then
  3360.                     local newModel = Instance.new("Model")
  3361.                     newModel.Name = "SavedInstances"
  3362.                     for i = 1,#list do
  3363.                         ypcall(function()
  3364.                             list[i].Archivable = true
  3365.                             list[i]:Clone().Parent = newModel
  3366.                         end)
  3367.                     end
  3368.                     PromptSaveInstance(newModel)
  3369.                 end
  3370.             elseif option == 'Copy Path' then
  3371.                 if not Option.Modifiable then return end
  3372.                 local list = Selection:Get()
  3373.                 local paths = {};
  3374.                 for i = 1,#list do
  3375.                     paths[#paths + 1] = GetPath(list[i]);
  3376.                 end
  3377.                 if #paths > 1 then
  3378.                     setclipboard(tableToString(paths))
  3379.                 elseif #paths == 1 then
  3380.                     setclipboard(paths[1])
  3381.                 end
  3382.             elseif option == "Call Remote" then
  3383.                 if not Option.Modifiable then return end
  3384.                 local list = Selection:Get()
  3385.                 for i = 1,#list do
  3386.                     if list[i]:IsA("RemoteFunction") or list[i]:IsA("RemoteEvent") then
  3387.                         PromptRemoteCaller(list[i])
  3388.                         break
  3389.                     end
  3390.                 end
  3391.             elseif option == "View Script" then
  3392.                 if not Option.Modifiable then return end
  3393.                 local list = Selection:Get()
  3394.                 for i = 1,#list do
  3395.                     if list[i]:IsA("LocalScript") or list[i]:IsA("ModuleScript") then
  3396.                         ScriptEditorEvent:Fire(list[i])
  3397.                     end
  3398.                 end
  3399.             elseif option == "Save Script" then
  3400.                 if not Option.Modifiable then return end
  3401.                 local list = Selection:Get()
  3402.                 for i = 1,#list do
  3403.                     if list[i]:IsA("LocalScript") or list[i]:IsA("ModuleScript") then
  3404.                         writefile(game.PlaceId .. '_' .. list[i].Name:gsub('%W', '') .. '_' .. math.random(100000, 999999) .. '.lua', decompile(list[i]));
  3405.                     end
  3406.                 end
  3407.             elseif option == 'Refresh Instances' then
  3408.                 if sObj == NilStorageMain then
  3409.                     for i, v in pairs(getnilinstances()) do
  3410.                         if v ~= DexOutput and v ~= DexOutputMain and v ~= DexStorage and v ~= DexStorageMain and v ~= RunningScriptsStorage and v ~= RunningScriptsStorageMain and v ~= LoadedModulesStorage and v ~= LoadedModulesStorageMain and v ~= NilStorage and v ~= NilStorageMain then
  3411.                             pcall(function()
  3412.                                 v:clone().Parent = NilStorageMain;
  3413.                             end)
  3414.                         end
  3415.                     end
  3416.                 elseif sObj == RunningScriptsStorageMain then
  3417.                     for i,v in pairs(getscripts()) do
  3418.                         if v ~= RunningScriptsStorage and v ~= LoadedModulesStorage and v ~= DexStorage and v ~= UpvalueStorage then
  3419.                             if (v:IsA'LocalScript' or v:IsA'ModuleScript' or v:IsA'Script') then
  3420.                                 v.Archivable = true;
  3421.                                 local ls = v:clone()
  3422.                                 if v:IsA'LocalScript' or v:IsA'Script' then ls.Disabled = true; end
  3423.                                 ls.Parent = RunningScriptsStorageMain
  3424.                             end
  3425.                         end
  3426.                     end
  3427.                 elseif sObj == LoadedModulesStorageMain then
  3428.                     for i,v in pairs(getloadedmodules()) do
  3429.                         if v ~= RunningScriptsStorage and v ~= LoadedModulesStorage and v ~= DexStorage and v ~= UpvalueStorage then
  3430.                             if (v:IsA'LocalScript' or v:IsA'ModuleScript' or v:IsA'Script') then
  3431.                                 v.Archivable = true;
  3432.                                 local ls = v:clone()
  3433.                                 if v:IsA'LocalScript' or v:IsA'Script' then ls.Disabled = true; end
  3434.                                 ls.Parent = LoadedModulesStorageMain
  3435.                             end
  3436.                         end
  3437.                     end
  3438.                 end
  3439.             end
  3440.         end)
  3441.     currentRightClickMenu.Parent = explorerPanel.Parent
  3442.     currentRightClickMenu.Position = UDim2.new(0,mouse.X,0,mouse.Y)
  3443.     if currentRightClickMenu.AbsolutePosition.X + currentRightClickMenu.AbsoluteSize.X > explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X then
  3444.         currentRightClickMenu.Position = UDim2.new(0, explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X - currentRightClickMenu.AbsoluteSize.X, 0, mouse.Y)
  3445.     end
  3446. end
  3447.  
  3448. local function cancelReparentDrag()end
  3449. local function cancelSelectDrag()end
  3450. do
  3451.     local listEntries = {}
  3452.     local nameConnLookup = {}
  3453.  
  3454.     local mouseDrag = Create('ImageButton',{
  3455.         Name = "MouseDrag";
  3456.         Position = UDim2.new(-0.25,0,-0.25,0);
  3457.         Size = UDim2.new(1.5,0,1.5,0);
  3458.         Transparency = 1;
  3459.         AutoButtonColor = false;
  3460.         Active = true;
  3461.         ZIndex = 10;
  3462.     })
  3463.     local function dragSelect(last,add,button)
  3464.         local connDrag
  3465.         local conUp
  3466.  
  3467.         conDrag = mouseDrag.MouseMoved:connect(function(x,y)
  3468.             local pos = Vector2.new(x,y) - listFrame.AbsolutePosition
  3469.             local size = listFrame.AbsoluteSize
  3470.             if pos.x < 0 or pos.x > size.x or pos.y < 0 or pos.y > size.y then return end
  3471.  
  3472.             local i = math.ceil(pos.y/ENTRY_BOUND) + scrollBar.ScrollIndex
  3473.             -- Mouse may have made a large step, so interpolate between the
  3474.             -- last index and the current.
  3475.             for n = i<last and i or last, i>last and i or last do
  3476.                 local node = TreeList[n]
  3477.                 if node then
  3478.                     if add then
  3479.                         Selection:Add(node.Object)
  3480.                     else
  3481.                         Selection:Remove(node.Object)
  3482.                     end
  3483.                 end
  3484.             end
  3485.             last = i
  3486.         end)
  3487.  
  3488.         function cancelSelectDrag()
  3489.             mouseDrag.Parent = nil
  3490.             conDrag:disconnect()
  3491.             conUp:disconnect()
  3492.             function cancelSelectDrag()end
  3493.         end
  3494.  
  3495.         conUp = mouseDrag[button]:connect(cancelSelectDrag)
  3496.  
  3497.         mouseDrag.Parent = GetScreen(listFrame)
  3498.     end
  3499.  
  3500.     local function dragReparent(object,dragGhost,clickPos,ghostOffset)
  3501.         local connDrag
  3502.         local conUp
  3503.         local conUp2
  3504.  
  3505.         local parentIndex = nil
  3506.         local dragged = false
  3507.  
  3508.         local parentHighlight = Create('Frame',{
  3509.             Transparency = 1;
  3510.             Visible = false;
  3511.             Create('Frame',{
  3512.                 BorderSizePixel = 0;
  3513.                 BackgroundColor3 = Color3.new(0,0,0);
  3514.                 BackgroundTransparency = 0.1;
  3515.                 Position = UDim2.new(0,0,0,0);
  3516.                 Size = UDim2.new(1,0,0,1);
  3517.             });
  3518.             Create('Frame',{
  3519.                 BorderSizePixel = 0;
  3520.                 BackgroundColor3 = Color3.new(0,0,0);
  3521.                 BackgroundTransparency = 0.1;
  3522.                 Position = UDim2.new(1,0,0,0);
  3523.                 Size = UDim2.new(0,1,1,0);
  3524.             });
  3525.             Create('Frame',{
  3526.                 BorderSizePixel = 0;
  3527.                 BackgroundColor3 = Color3.new(0,0,0);
  3528.                 BackgroundTransparency = 0.1;
  3529.                 Position = UDim2.new(0,0,1,0);
  3530.                 Size = UDim2.new(1,0,0,1);
  3531.             });
  3532.             Create('Frame',{
  3533.                 BorderSizePixel = 0;
  3534.                 BackgroundColor3 = Color3.new(0,0,0);
  3535.                 BackgroundTransparency = 0.1;
  3536.                 Position = UDim2.new(0,0,0,0);
  3537.                 Size = UDim2.new(0,1,1,0);
  3538.             });
  3539.         })
  3540.         SetZIndex(parentHighlight,9)
  3541.  
  3542.         conDrag = mouseDrag.MouseMoved:connect(function(x,y)
  3543.             local dragPos = Vector2.new(x,y)
  3544.             if dragged then
  3545.                 local pos = dragPos - listFrame.AbsolutePosition
  3546.                 local size = listFrame.AbsoluteSize
  3547.  
  3548.                 parentIndex = nil
  3549.                 parentHighlight.Visible = false
  3550.                 if pos.x >= 0 and pos.x <= size.x and pos.y >= 0 and pos.y <= size.y + ENTRY_SIZE*2 then
  3551.                     local i = math.ceil(pos.y/ENTRY_BOUND-2)
  3552.                     local node = TreeList[i + scrollBar.ScrollIndex]
  3553.                     if node and node.Object ~= object and not object:IsAncestorOf(node.Object) then
  3554.                         parentIndex = i
  3555.                         local entry = listEntries[i]
  3556.                         if entry then
  3557.                             parentHighlight.Visible = true
  3558.                             parentHighlight.Position = UDim2.new(0,1,0,entry.AbsolutePosition.y-listFrame.AbsolutePosition.y)
  3559.                             parentHighlight.Size = UDim2.new(0,size.x-4,0,entry.AbsoluteSize.y)
  3560.                         end
  3561.                     end
  3562.                 end
  3563.  
  3564.                 dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
  3565.             elseif (clickPos-dragPos).magnitude > 8 then
  3566.                 dragged = true
  3567.                 SetZIndex(dragGhost,9)
  3568.                 dragGhost.IndentFrame.Transparency = 0.25
  3569.                 dragGhost.IndentFrame.EntryText.TextColor3 = GuiColor.TextSelected
  3570.                 dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
  3571.                 dragGhost.Parent = GetScreen(listFrame)
  3572.                 parentHighlight.Parent = listFrame
  3573.             end
  3574.         end)
  3575.  
  3576.         function cancelReparentDrag()
  3577.             mouseDrag.Parent = nil
  3578.             conDrag:disconnect()
  3579.             conUp:disconnect()
  3580.             conUp2:disconnect()
  3581.             dragGhost:Destroy()
  3582.             parentHighlight:Destroy()
  3583.             function cancelReparentDrag()end
  3584.         end
  3585.  
  3586.         local wasSelected = Selection.Selected[object]
  3587.         if not wasSelected and Option.Selectable then
  3588.             Selection:Set({object})
  3589.         end
  3590.  
  3591.         conUp = mouseDrag.MouseButton1Up:connect(function()
  3592.             cancelReparentDrag()
  3593.             if dragged then
  3594.                 if parentIndex then
  3595.                     local parentNode = TreeList[parentIndex + scrollBar.ScrollIndex]
  3596.                     if parentNode then
  3597.                         parentNode.Expanded = true
  3598.  
  3599.                         local parentObj = parentNode.Object
  3600.                         local function parent(a,b)
  3601.                             a.Parent = b
  3602.                         end
  3603.                         if Option.Selectable then
  3604.                             local list = Selection.List
  3605.                             for i = 1,#list do
  3606.                                 pcall(parent,list[i],parentObj)
  3607.                             end
  3608.                         else
  3609.                             pcall(parent,object,parentObj)
  3610.                         end
  3611.                     end
  3612.                 end
  3613.             else
  3614.                 -- do selection click
  3615.                 if wasSelected and Option.Selectable then
  3616.                     Selection:Set({})
  3617.                 end
  3618.             end
  3619.         end)
  3620.         conUp2 = mouseDrag.MouseButton2Down:connect(function()
  3621.             cancelReparentDrag()
  3622.         end)
  3623.  
  3624.         mouseDrag.Parent = GetScreen(listFrame)
  3625.     end
  3626.  
  3627.     local entryTemplate = Create('ImageButton',{
  3628.         Name = "Entry";
  3629.         Transparency = 1;
  3630.         AutoButtonColor = false;
  3631.         Position = UDim2.new(0,0,0,0);
  3632.         Size = UDim2.new(1,0,0,ENTRY_SIZE);
  3633.         Create('Frame',{
  3634.             Name = "IndentFrame";
  3635.             BackgroundTransparency = 1;
  3636.             BackgroundColor3 = GuiColor.Selected;
  3637.             BorderColor3 = GuiColor.BorderSelected;
  3638.             Position = UDim2.new(0,0,0,0);
  3639.             Size = UDim2.new(1,0,1,0);
  3640.             Create(Icon('ImageButton',0),{
  3641.                 Name = "Expand";
  3642.                 AutoButtonColor = false;
  3643.                 Position = UDim2.new(0,-GUI_SIZE,0.5,-GUI_SIZE/2);
  3644.                 Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
  3645.             });
  3646.             Create(Icon(nil,0),{
  3647.                 Name = "ExplorerIcon";
  3648.                 Position = UDim2.new(0,2+ENTRY_PADDING,0.5,-GUI_SIZE/2);
  3649.                 Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
  3650.             });
  3651.             Create('TextLabel',{
  3652.                 Name = "EntryText";
  3653.                 BackgroundTransparency = 1;
  3654.                 TextColor3 = GuiColor.Text;
  3655.                 TextXAlignment = 'Left';
  3656.                 TextYAlignment = 'Center';
  3657.                 Font = FONT;
  3658.                 FontSize = FONT_SIZE;
  3659.                 Text = "";
  3660.                 Position = UDim2.new(0,2+ENTRY_SIZE+4,0,0);
  3661.                 Size = UDim2.new(1,-2,1,0);
  3662.             });
  3663.         });
  3664.     })
  3665.  
  3666.     function scrollBar.UpdateCallback(self)
  3667.         for i = 1,self.VisibleSpace do
  3668.             local node = TreeList[i + self.ScrollIndex]
  3669.             if node then
  3670.                 local entry = listEntries[i]
  3671.                 if not entry then
  3672.                     entry = Create(entryTemplate:Clone(),{
  3673.                         Position = UDim2.new(0,2,0,ENTRY_BOUND*(i-1)+2);
  3674.                         Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE);
  3675.                         ZIndex = listFrame.ZIndex;
  3676.                     })
  3677.                     listEntries[i] = entry
  3678.  
  3679.                     local expand = entry.IndentFrame.Expand
  3680.                     expand.MouseEnter:connect(function()
  3681.                         local node = TreeList[i + self.ScrollIndex]
  3682.                         if #node > 0 then
  3683.                             if node.Expanded then
  3684.                                 Icon(expand,NODE_EXPANDED_OVER)
  3685.                             else
  3686.                                 Icon(expand,NODE_COLLAPSED_OVER)
  3687.                             end
  3688.                         end
  3689.                     end)
  3690.                     expand.MouseLeave:connect(function()
  3691.                         local node = TreeList[i + self.ScrollIndex]
  3692.                         if #node > 0 then
  3693.                             if node.Expanded then
  3694.                                 Icon(expand,NODE_EXPANDED)
  3695.                             else
  3696.                                 Icon(expand,NODE_COLLAPSED)
  3697.                             end
  3698.                         end
  3699.                     end)
  3700.                     expand.MouseButton1Down:connect(function()
  3701.                         local node = TreeList[i + self.ScrollIndex]
  3702.                         if #node > 0 then
  3703.                             node.Expanded = not node.Expanded
  3704.                             if node.Object == explorerPanel.Parent and node.Expanded then
  3705.                                 CreateCaution("Warning","Please be careful when editing instances inside here, this is like the System32 of Dex and modifying objects here can break Dex.")
  3706.                             end
  3707.                             -- use raw update so the list updates instantly
  3708.                             rawUpdateList()
  3709.                         end
  3710.                     end)
  3711.  
  3712.                     entry.MouseButton1Down:connect(function(x,y)
  3713.                         local node = TreeList[i + self.ScrollIndex]
  3714.                         DestroyRightClick()
  3715.                         if GetAwaitRemote:Invoke() then
  3716.                             bindSetAwaiting:Fire(node.Object)
  3717.                             return
  3718.                         end
  3719.  
  3720.                         if not HoldingShift then
  3721.                             lastSelectedNode = i + self.ScrollIndex
  3722.                         end
  3723.  
  3724.                         if HoldingShift and not filteringWorkspace() then
  3725.                             if lastSelectedNode then
  3726.                                 if i + self.ScrollIndex - lastSelectedNode > 0 then
  3727.                                     Selection:StopUpdates()
  3728.                                     for i2 = 1, i + self.ScrollIndex - lastSelectedNode do
  3729.                                         local newNode = TreeList[lastSelectedNode + i2]
  3730.                                         if newNode then
  3731.                                             Selection:Add(newNode.Object)
  3732.                                         end
  3733.                                     end
  3734.                                     Selection:ResumeUpdates()
  3735.                                 else
  3736.                                     Selection:StopUpdates()
  3737.                                     for i2 = i + self.ScrollIndex - lastSelectedNode, 1 do
  3738.                                         local newNode = TreeList[lastSelectedNode + i2]
  3739.                                         if newNode then
  3740.                                             Selection:Add(newNode.Object)
  3741.                                         end
  3742.                                     end
  3743.                                     Selection:ResumeUpdates()
  3744.                                 end
  3745.                             end
  3746.                             return
  3747.                         end
  3748.  
  3749.                         if HoldingCtrl then
  3750.                             if Selection.Selected[node.Object] then
  3751.                                 Selection:Remove(node.Object)
  3752.                             else
  3753.                                 Selection:Add(node.Object)
  3754.                             end
  3755.                             return
  3756.                         end
  3757.                         if Option.Modifiable then
  3758.                             local pos = Vector2.new(x,y)
  3759.                             dragReparent(node.Object,entry:Clone(),pos,entry.AbsolutePosition-pos)
  3760.                         elseif Option.Selectable then
  3761.                             if Selection.Selected[node.Object] then
  3762.                                 Selection:Set({})
  3763.                             else
  3764.                                 Selection:Set({node.Object})
  3765.                             end
  3766.                             dragSelect(i+self.ScrollIndex,true,'MouseButton1Up')
  3767.                         end
  3768.                     end)
  3769.  
  3770.                     entry.MouseButton2Down:connect(function()
  3771.                         if not Option.Selectable then return end
  3772.  
  3773.                         DestroyRightClick()
  3774.  
  3775.                         curSelect = entry
  3776.  
  3777.                         local node = TreeList[i + self.ScrollIndex]
  3778.  
  3779.                         if GetAwaitRemote:Invoke() then
  3780.                             bindSetAwaiting:Fire(node.Object)
  3781.                             return
  3782.                         end
  3783.  
  3784.                         if not Selection.Selected[node.Object] then
  3785.                             Selection:Set({node.Object})
  3786.                         end
  3787.                     end)
  3788.  
  3789.  
  3790.                     entry.MouseButton2Up:connect(function()
  3791.                         if not Option.Selectable then return end
  3792.  
  3793.                         local node = TreeList[i + self.ScrollIndex]
  3794.  
  3795.                         if checkMouseInGui(curSelect) then
  3796.                             rightClickMenu(node.Object)
  3797.                         end
  3798.                     end)
  3799.  
  3800.                     entry.Parent = listFrame
  3801.                 end
  3802.  
  3803.                 entry.Visible = true
  3804.  
  3805.                 local object = node.Object
  3806.  
  3807.                 -- update expand icon
  3808.                 if #node == 0 then
  3809.                     entry.IndentFrame.Expand.Visible = false
  3810.                 elseif node.Expanded then
  3811.                     Icon(entry.IndentFrame.Expand,NODE_EXPANDED)
  3812.                     entry.IndentFrame.Expand.Visible = true
  3813.                 else
  3814.                     Icon(entry.IndentFrame.Expand,NODE_COLLAPSED)
  3815.                     entry.IndentFrame.Expand.Visible = true
  3816.                 end
  3817.  
  3818.                 -- update explorer icon
  3819.                 Icon(entry.IndentFrame.ExplorerIcon,ExplorerIndex[object.ClassName] or 0,object)
  3820.  
  3821.                 -- update indentation
  3822.                 local w = (node.Depth)*(2+ENTRY_PADDING+GUI_SIZE)
  3823.                 entry.IndentFrame.Position = UDim2.new(0,w,0,0)
  3824.                 entry.IndentFrame.Size = UDim2.new(1,-w,1,0)
  3825.  
  3826.                 -- update name change detection
  3827.                 if nameConnLookup[entry] then
  3828.                     nameConnLookup[entry]:disconnect()
  3829.                 end
  3830.                 local text = entry.IndentFrame.EntryText
  3831.                 text.Text = object.Name
  3832.                 nameConnLookup[entry] = node.Object.Changed:connect(function(p)
  3833.                     if p == 'Name' then
  3834.                         text.Text = object.Name
  3835.                     end
  3836.                 end)
  3837.  
  3838.                 -- update selection
  3839.                 entry.IndentFrame.Transparency = node.Selected and 0 or 1
  3840.                 text.TextColor3 = GuiColor[node.Selected and 'TextSelected' or 'Text']
  3841.  
  3842.                 entry.Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE)
  3843.             elseif listEntries[i] then
  3844.                 listEntries[i].Visible = false
  3845.             end
  3846.         end
  3847.         for i = self.VisibleSpace+1,self.TotalSpace do
  3848.             local entry = listEntries[i]
  3849.             if entry then
  3850.                 listEntries[i] = nil
  3851.                 entry:Destroy()
  3852.             end
  3853.         end
  3854.     end
  3855.  
  3856.     function scrollBarH.UpdateCallback(self)
  3857.         for i = 1,scrollBar.VisibleSpace do
  3858.             local node = TreeList[i + scrollBar.ScrollIndex]
  3859.             if node then
  3860.                 local entry = listEntries[i]
  3861.                 if entry then
  3862.                     entry.Position = UDim2.new(0,2 - scrollBarH.ScrollIndex,0,ENTRY_BOUND*(i-1)+2)
  3863.                 end
  3864.             end
  3865.         end
  3866.     end
  3867.  
  3868.     Connect(listFrame.Changed,function(p)
  3869.         if p == 'AbsoluteSize' then
  3870.             rawUpdateSize()
  3871.         end
  3872.     end)
  3873.  
  3874.     local wheelAmount = 6
  3875.     explorerPanel.MouseWheelForward:connect(function()
  3876.         if scrollBar.VisibleSpace - 1 > wheelAmount then
  3877.             scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount)
  3878.         else
  3879.             scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace)
  3880.         end
  3881.     end)
  3882.     explorerPanel.MouseWheelBackward:connect(function()
  3883.         if scrollBar.VisibleSpace - 1 > wheelAmount then
  3884.             scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount)
  3885.         else
  3886.             scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace)
  3887.         end
  3888.     end)
  3889. end
  3890.  
  3891. ----------------------------------------------------------------
  3892. ----------------------------------------------------------------
  3893. ----------------------------------------------------------------
  3894. ----------------------------------------------------------------
  3895. ---- Object detection
  3896.  
  3897. -- Inserts `v` into `t` at `i`. Also sets `Index` field in `v`.
  3898. local function insert(t,i,v)
  3899.     for n = #t,i,-1 do
  3900.         local v = t[n]
  3901.         v.Index = n+1
  3902.         t[n+1] = v
  3903.     end
  3904.     v.Index = i
  3905.     t[i] = v
  3906. end
  3907.  
  3908. -- Removes `i` from `t`. Also sets `Index` field in removed value.
  3909. local function remove(t,i)
  3910.     local v = t[i]
  3911.     for n = i+1,#t do
  3912.         local v = t[n]
  3913.         v.Index = n-1
  3914.         t[n-1] = v
  3915.     end
  3916.     t[#t] = nil
  3917.     v.Index = 0
  3918.     return v
  3919. end
  3920.  
  3921. -- Returns how deep `o` is in the tree.
  3922. local function depth(o)
  3923.     local d = -1
  3924.     while o do
  3925.         o = o.Parent
  3926.         d = d + 1
  3927.     end
  3928.     return d
  3929. end
  3930.  
  3931.  
  3932. local connLookup = {}
  3933.  
  3934. -- Returns whether a node would be present in the tree list
  3935. local function nodeIsVisible(node)
  3936.     local visible = true
  3937.     node = node.Parent
  3938.     while node and visible do
  3939.         visible = visible and node.Expanded
  3940.         node = node.Parent
  3941.     end
  3942.     return visible
  3943. end
  3944.  
  3945. -- Removes an object's tree node. Called when the object stops existing in the
  3946. -- game tree.
  3947. local function removeObject(object)
  3948.     local objectNode = NodeLookup[object]
  3949.     if not objectNode then
  3950.         return
  3951.     end
  3952.  
  3953.     local visible = nodeIsVisible(objectNode)
  3954.  
  3955.     Selection:Remove(object,true)
  3956.  
  3957.     local parent = objectNode.Parent
  3958.     remove(parent,objectNode.Index)
  3959.     NodeLookup[object] = nil
  3960.     connLookup[object]:disconnect()
  3961.     connLookup[object] = nil
  3962.  
  3963.     if visible then
  3964.         updateList()
  3965.     elseif nodeIsVisible(parent) then
  3966.         updateScroll()
  3967.     end
  3968. end
  3969.  
  3970. -- Moves a tree node to a new parent. Called when an existing object's parent
  3971. -- changes.
  3972. local function moveObject(object,parent)
  3973.     local objectNode = NodeLookup[object]
  3974.     if not objectNode then
  3975.         return
  3976.     end
  3977.  
  3978.     local parentNode = NodeLookup[parent]
  3979.     if not parentNode then
  3980.         return
  3981.     end
  3982.  
  3983.     local visible = nodeIsVisible(objectNode)
  3984.  
  3985.     remove(objectNode.Parent,objectNode.Index)
  3986.     objectNode.Parent = parentNode
  3987.  
  3988.     objectNode.Depth = depth(object)
  3989.     local function r(node,d)
  3990.         for i = 1,#node do
  3991.             node[i].Depth = d
  3992.             r(node[i],d+1)
  3993.         end
  3994.     end
  3995.     r(objectNode,objectNode.Depth+1)
  3996.  
  3997.     insert(parentNode,#parentNode+1,objectNode)
  3998.  
  3999.     if visible or nodeIsVisible(objectNode) then
  4000.         updateList()
  4001.     elseif nodeIsVisible(objectNode.Parent) then
  4002.         updateScroll()
  4003.     end
  4004. end
  4005.  
  4006. local InstanceBlacklist = {
  4007.     'Instance';
  4008.     'VRService';
  4009.     'ContextActionService';
  4010.     'AssetService';
  4011.     'TouchInputService';
  4012.     'ScriptContext';
  4013.     'FilteredSelection';
  4014.     'MeshContentProvider';
  4015.     'SolidModelContentProvider';
  4016.     'AnalyticsService';
  4017.     'RobloxReplicatedStorage';
  4018.     'GamepadService';
  4019.     'HapticService';
  4020.     'ChangeHistoryService';
  4021.     'Visit';
  4022.     'SocialService';
  4023.     'SpawnerService';
  4024.     'FriendService';
  4025.     'Geometry';
  4026.     'BadgeService';
  4027.     'PhysicsService';
  4028.     'CollectionService';
  4029.     'TeleportService';
  4030.     'HttpRbxApiService';
  4031.     'TweenService';
  4032.     'TextService';
  4033.     'NotificationService';
  4034.     'AdService';
  4035.     'CSGDictionaryService';
  4036.     'ControllerService';
  4037.     'RuntimeScriptService';
  4038.     'ScriptService';
  4039.     'MouseService';
  4040.     'KeyboardService';
  4041.     'CookiesService';
  4042.     'TimerService';
  4043.     'GamePassService';
  4044.     'KeyframeSequenceProvider';
  4045.     'NonReplicatedCSGDictionaryService';
  4046.     'GuidRegistryService';
  4047.     'PathfindingService';
  4048.     'GroupService';
  4049. }
  4050.  
  4051. for i, v in ipairs(InstanceBlacklist) do
  4052.     InstanceBlacklist[v] = true;
  4053.     InstanceBlacklist[i] = nil;
  4054. end
  4055.  
  4056. -- ScriptContext['/Libraries/LibraryRegistration/LibraryRegistration']
  4057. -- This RobloxLocked object lets me index its properties for some reason
  4058.  
  4059. local function check(object)
  4060.     return object.AncestryChanged
  4061. end
  4062.  
  4063. -- Creates a new tree node from an object. Called when an object starts
  4064. -- existing in the game tree.
  4065. local function addObject(object,noupdate)
  4066.     local s,e = pcall(function()
  4067.     if object.Parent == game and InstanceBlacklist[object.ClassName] or object.ClassName == '' then
  4068.         return true;
  4069.         end
  4070.     end)
  4071.     if(s) then
  4072.         if(e) then
  4073.             return;
  4074.         end
  4075.     else
  4076.         return;
  4077.     end
  4078.  
  4079.     if script then
  4080.         -- protect against naughty RobloxLocked objects
  4081.         local s = pcall(check,object)
  4082.         if not s then
  4083.             return
  4084.         end
  4085.     end
  4086.  
  4087.     local parentNode = NodeLookup[object.Parent]
  4088.     if not parentNode then
  4089.         return
  4090.     end
  4091.  
  4092.     local objectNode = {
  4093.         Object = object;
  4094.         Parent = parentNode;
  4095.         Index = 0;
  4096.         Expanded = false;
  4097.         Selected = false;
  4098.         Depth = depth(object);
  4099.     }
  4100.  
  4101.     connLookup[object] = Connect(object.AncestryChanged,function(c,p)
  4102.         if c == object then
  4103.             if p == nil then
  4104.                 removeObject(c)
  4105.             else
  4106.                 moveObject(c,p)
  4107.             end
  4108.         end
  4109.     end)
  4110.  
  4111.     NodeLookup[object] = objectNode
  4112.     insert(parentNode,#parentNode+1,objectNode)
  4113.  
  4114.     if not noupdate then
  4115.         if nodeIsVisible(objectNode) then
  4116.             updateList()
  4117.         elseif nodeIsVisible(objectNode.Parent) then
  4118.             updateScroll()
  4119.         end
  4120.     end
  4121. end
  4122.  
  4123. local function makeObject(obj,par)
  4124.     local newObject = Instance.new(obj.ClassName)
  4125.     for i,v in pairs(obj.Properties) do
  4126.         ypcall(function()
  4127.             local newProp
  4128.             newProp = ToPropValue(v.Value,v.Type)
  4129.             newObject[v.Name] = newProp
  4130.         end)
  4131.     end
  4132.     newObject.Parent = par
  4133. end
  4134.  
  4135. local function writeObject(obj)
  4136.     local newObject = {ClassName = obj.ClassName, Properties = {}}
  4137.     for i,v in pairs(RbxApi.GetProperties(obj.className)) do
  4138.         if v["Name"] ~= "Parent" then
  4139.             print("thispassed")
  4140.             table.insert(newObject.Properties,{Name = v["Name"], Type = v["ValueType"], Value = tostring(obj[v["Name"]])})
  4141.         end
  4142.     end
  4143.     return newObject
  4144. end
  4145.  
  4146. local function buildDexStorage()
  4147.     local localDexStorage
  4148.  
  4149.     local success,err = ypcall(function()
  4150.         localDexStorage = game:GetObjects("rbxasset://DexStorage.rbxm")[1]
  4151.     end)
  4152.  
  4153.     if success and localDexStorage then
  4154.         for i,v in pairs(localDexStorage:GetChildren()) do
  4155.             ypcall(function()
  4156.                 v.Parent = DexStorageMain
  4157.             end)
  4158.         end
  4159.     end
  4160.  
  4161.     updateDexStorageListeners()
  4162.     --[[
  4163.     local localDexStorage = readfile(getelysianpath().."DexStorage.txt")--game:GetService("CookiesService"):GetCookieValue("DexStorage")
  4164.     --local success,err = pcall(function()
  4165.         if localDexStorage then
  4166.             local objTable = game:GetService("HttpService"):JSONDecode(localDexStorage)
  4167.             for i,v in pairs(objTable) do
  4168.                 makeObject(v,DexStorageMain)
  4169.             end
  4170.         end
  4171.     --end)
  4172.     --]]
  4173. end
  4174.  
  4175. local dexStorageDebounce = false
  4176. local dexStorageListeners = {}
  4177.  
  4178. local function updateDexStorage()
  4179.     if dexStorageDebounce then return end
  4180.     dexStorageDebounce = true  
  4181.  
  4182.     wait()
  4183.  
  4184.     pcall(function()
  4185.         -- saveinstance("content//DexStorage.rbxm",DexStorageMain)
  4186.     end)
  4187.  
  4188.     updateDexStorageListeners()
  4189.  
  4190.     dexStorageDebounce = false
  4191.     --[[
  4192.     local success,err = ypcall(function()
  4193.         local objs = {}
  4194.         for i,v in pairs(DexStorageMain:GetChildren()) do
  4195.             table.insert(objs,writeObject(v))
  4196.         end
  4197.         writefile(getelysianpath().."DexStorage.txt",game:GetService("HttpService"):JSONEncode(objs))
  4198.         --game:GetService("CookiesService"):SetCookieValue("DexStorage",game:GetService("HttpService"):JSONEncode(objs))
  4199.     end)
  4200.     if err then
  4201.         CreateCaution("DexStorage Save Fail!","DexStorage broke! If you see this message, report to Raspberry Pi!")
  4202.     end
  4203.     print("hi")
  4204.     --]]
  4205. end
  4206.  
  4207. function updateDexStorageListeners()
  4208.     for i,v in pairs(dexStorageListeners) do
  4209.         v:Disconnect()
  4210.     end
  4211.     dexStorageListeners = {}
  4212.     for i,v in pairs(DexStorageMain:GetChildren()) do
  4213.         pcall(function()
  4214.             local ev = v.Changed:connect(updateDexStorage)
  4215.             table.insert(dexStorageListeners,ev)
  4216.         end)
  4217.     end
  4218. end
  4219.  
  4220. do
  4221.     NodeLookup[workspace.Parent] = {
  4222.         Object = workspace.Parent;
  4223.         Parent = nil;
  4224.         Index = 0;
  4225.         Expanded = true;
  4226.     }
  4227.  
  4228.     NodeLookup[DexOutput] = {
  4229.         Object = DexOutput;
  4230.         Parent = nil;
  4231.         Index = 0;
  4232.         Expanded = true;
  4233.     }
  4234.  
  4235.     if DexStorageEnabled then
  4236.         NodeLookup[DexStorage] = {
  4237.             Object = DexStorage;
  4238.             Parent = nil;
  4239.             Index = 0;
  4240.             Expanded = true;
  4241.         }
  4242.     end
  4243.  
  4244.     if NilStorageEnabled then
  4245.         NodeLookup[NilStorage] = {
  4246.             Object = NilStorage;
  4247.             Parent = nil;
  4248.             Index = 0;
  4249.             Expanded = true;
  4250.         }
  4251.     end
  4252.  
  4253.     if RunningScriptsStorageEnabled then
  4254.         NodeLookup[RunningScriptsStorage] = {
  4255.             Object = RunningScriptsStorage;
  4256.             Parent = nil;
  4257.             Index = 0;
  4258.             Expanded = true;
  4259.         }
  4260.     end
  4261.  
  4262.     if LoadedModulesStorageEnabled then
  4263.         NodeLookup[LoadedModulesStorage] = {
  4264.             Object = LoadedModulesStorage;
  4265.             Parent = nil;
  4266.             Index = 0;
  4267.             Expanded = true;
  4268.         }
  4269.     end
  4270.  
  4271.     Connect(game.DescendantAdded,addObject)
  4272.     Connect(game.DescendantRemoving,removeObject)
  4273.  
  4274.     Connect(DexOutput.DescendantAdded,addObject)
  4275.     Connect(DexOutput.DescendantRemoving,removeObject)
  4276.  
  4277.     if DexStorageEnabled then
  4278.         --[[
  4279.         if readfile(getelysianpath().."DexStorage.txt") == nil then
  4280.             writefile(getelysianpath().."DexStorage.txt","")
  4281.         end
  4282.         --]]
  4283.  
  4284.         buildDexStorage()
  4285.  
  4286.         Connect(DexStorage.DescendantAdded,addObject)
  4287.         Connect(DexStorage.DescendantRemoving,removeObject)
  4288.  
  4289.         Connect(DexStorage.DescendantAdded,updateDexStorage)
  4290.         Connect(DexStorage.DescendantRemoving,updateDexStorage)
  4291.     end
  4292.  
  4293.     if NilStorageEnabled then
  4294.         Connect(NilStorage.DescendantAdded,addObject)
  4295.         Connect(NilStorage.DescendantRemoving,removeObject)    
  4296.  
  4297.         --[[local currentTable = get_nil_instances()   
  4298.        
  4299.         spawn(function()
  4300.             while wait() do
  4301.                 if #currentTable ~= #get_nil_instances() then
  4302.                     currentTable = get_nil_instances()
  4303.                     --NilStorageMain:ClearAllChildren()
  4304.                     for i,v in pairs(get_nil_instances()) do
  4305.                         if v ~= NilStorage and v ~= DexStorage then
  4306.                             pcall(function()
  4307.                                 v.Parent = NilStorageMain
  4308.                             end)
  4309.                             --[ [
  4310.                             local newNil = v
  4311.                             newNil.Archivable = true
  4312.                             newNil:Clone().Parent = NilStorageMain
  4313.                             -- ] ]
  4314.                         end
  4315.                     end
  4316.                 end
  4317.             end
  4318.         end)]]
  4319.     end
  4320.     if RunningScriptsStorageEnabled then
  4321.         Connect(RunningScriptsStorage.DescendantAdded,addObject)
  4322.         Connect(RunningScriptsStorage.DescendantRemoving,removeObject)
  4323.     end
  4324.     if LoadedModulesStorageEnabled then
  4325.         Connect(LoadedModulesStorage.DescendantAdded,addObject)
  4326.         Connect(LoadedModulesStorage.DescendantRemoving,removeObject)
  4327.     end
  4328.  
  4329.     local function get(o)
  4330.         return o:GetDescendants()
  4331.     end
  4332.  
  4333.     local function r(o)
  4334.         local s,children = pcall(get, o)
  4335.         if s then
  4336.             for i = 1,#children do
  4337.                 addObject(children[i],true);
  4338.             end
  4339.         end
  4340.     end
  4341.  
  4342.     r(workspace.Parent)
  4343.     r(DexOutput)
  4344.     if DexStorageEnabled then
  4345.         r(DexStorage)
  4346.     end
  4347.     if NilStorageEnabled then
  4348.         r(NilStorage)
  4349.     end
  4350.     if RunningScriptsStorageEnabled then
  4351.         r(RunningScriptsStorage)
  4352.     end
  4353.     if LoadedModulesStorageEnabled then
  4354.         r(LoadedModulesStorage)
  4355.     end
  4356.  
  4357.     scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
  4358.     updateList()
  4359. end
  4360.  
  4361. ----------------------------------------------------------------
  4362. ----------------------------------------------------------------
  4363. ----------------------------------------------------------------
  4364. ----------------------------------------------------------------
  4365. ---- Actions
  4366.  
  4367. local actionButtons do
  4368.     actionButtons = {}
  4369.  
  4370.     local totalActions = 1
  4371.     local currentActions = totalActions
  4372.     local function makeButton(icon,over,name,vis,cond)
  4373.         local buttonEnabled = false
  4374.  
  4375.         local button = Create(Icon('ImageButton',icon),{
  4376.             Name = name .. "Button";
  4377.             Visible = Option.Modifiable and Option.Selectable;
  4378.             Position = UDim2.new(1,-(GUI_SIZE+2)*currentActions+2,0.25,-GUI_SIZE/2);
  4379.             Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
  4380.             Parent = headerFrame;
  4381.         })
  4382.  
  4383.         local tipText = Create('TextLabel',{
  4384.             Name = name .. "Text";
  4385.             Text = name;
  4386.             Visible = false;
  4387.             BackgroundTransparency = 1;
  4388.             TextXAlignment = 'Right';
  4389.             Font = FONT;
  4390.             FontSize = FONT_SIZE;
  4391.             Position = UDim2.new(0,0,0,0);
  4392.             Size = UDim2.new(1,-(GUI_SIZE+2)*totalActions,1,0);
  4393.             Parent = headerFrame;
  4394.         })
  4395.  
  4396.  
  4397.         button.MouseEnter:connect(function()
  4398.             if buttonEnabled then
  4399.                 button.BackgroundTransparency = 0.9
  4400.             end
  4401.             --Icon(button,over)
  4402.             --tipText.Visible = true
  4403.         end)
  4404.         button.MouseLeave:connect(function()
  4405.             button.BackgroundTransparency = 1
  4406.             --Icon(button,icon)
  4407.             --tipText.Visible = false
  4408.         end)
  4409.  
  4410.         currentActions = currentActions + 1
  4411.         actionButtons[#actionButtons+1] = {Obj = button,Cond = cond}
  4412.         QuickButtons[#actionButtons+1] = {Obj = button,Cond = cond, Toggle = function(on)
  4413.             if on then
  4414.                 buttonEnabled = true
  4415.                 Icon(button,over)
  4416.             else
  4417.                 buttonEnabled = false
  4418.                 Icon(button,icon)
  4419.             end
  4420.         end}
  4421.         return button
  4422.     end
  4423.  
  4424.     --local clipboard = {}
  4425.     local function delete(o)
  4426.         o.Parent = nil
  4427.     end
  4428.  
  4429.     makeButton(ACTION_EDITQUICKACCESS,ACTION_EDITQUICKACCESS,"Options",true,function()return true end).MouseButton1Click:connect(function()
  4430.  
  4431.     end)
  4432.  
  4433.  
  4434.     -- DELETE
  4435.     makeButton(ACTION_DELETE,ACTION_DELETE_OVER,"Delete",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
  4436.         if not Option.Modifiable then return end
  4437.         local list = Selection:Get()
  4438.         for i = 1,#list do
  4439.             pcall(delete,list[i])
  4440.         end
  4441.         Selection:Set({})
  4442.     end)
  4443.  
  4444.     -- PASTE
  4445.     makeButton(ACTION_PASTE,ACTION_PASTE_OVER,"Paste",true,function() return #Selection:Get() > 0 and #clipboard > 0 end).MouseButton1Click:connect(function()
  4446.         if not Option.Modifiable then return end
  4447.         local parent = Selection.List[1] or workspace
  4448.         for i = 1,#clipboard do
  4449.             clipboard[i]:Clone().Parent = parent
  4450.         end
  4451.     end)
  4452.  
  4453.     -- COPY
  4454.     makeButton(ACTION_COPY,ACTION_COPY_OVER,"Copy",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
  4455.         if not Option.Modifiable then return end
  4456.         clipboard = {}
  4457.         local list = Selection.List
  4458.         for i = 1,#list do
  4459.             table.insert(clipboard,list[i]:Clone())
  4460.         end
  4461.         updateActions()
  4462.     end)
  4463.  
  4464.     -- CUT
  4465.     makeButton(ACTION_CUT,ACTION_CUT_OVER,"Cut",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
  4466.         if not Option.Modifiable then return end
  4467.         clipboard = {}
  4468.         local list = Selection.List
  4469.         local cut = {}
  4470.         for i = 1,#list do
  4471.             local obj = list[i]:Clone()
  4472.             if obj then
  4473.                 table.insert(clipboard,obj)
  4474.                 table.insert(cut,list[i])
  4475.             end
  4476.         end
  4477.         for i = 1,#cut do
  4478.             pcall(delete,cut[i])
  4479.         end
  4480.         updateActions()
  4481.     end)
  4482.  
  4483.     -- FREEZE
  4484.     makeButton(ACTION_FREEZE,ACTION_FREEZE,"Freeze",true,function() return true end)
  4485.  
  4486.     -- ADD/REMOVE STARRED
  4487.     makeButton(ACTION_ADDSTAR,ACTION_ADDSTAR_OVER,"Star",true,function() return #Selection:Get() > 0 end)
  4488.  
  4489.     -- STARRED
  4490.     makeButton(ACTION_STARRED,ACTION_STARRED,"Starred",true,function() return true end)
  4491.  
  4492.  
  4493.     -- SORT
  4494.     -- local actionSort = makeButton(ACTION_SORT,ACTION_SORT_OVER,"Sort")
  4495. end
  4496.  
  4497. ----------------------------------------------------------------
  4498. ----------------------------------------------------------------
  4499. ----------------------------------------------------------------
  4500. ----------------------------------------------------------------
  4501. ---- Option Bindables
  4502.  
  4503. do
  4504.     local optionCallback = {
  4505.         Modifiable = function(value)
  4506.             for i = 1,#actionButtons do
  4507.                 actionButtons[i].Obj.Visible = value and Option.Selectable
  4508.             end
  4509.             cancelReparentDrag()
  4510.         end;
  4511.         Selectable = function(value)
  4512.             for i = 1,#actionButtons do
  4513.                 actionButtons[i].Obj.Visible = value and Option.Modifiable
  4514.             end
  4515.             cancelSelectDrag()
  4516.             Selection:Set({})
  4517.         end;
  4518.     }
  4519.  
  4520.     local bindSetOption = explorerPanel:FindFirstChild("SetOption")
  4521.     if not bindSetOption then
  4522.         bindSetOption = Create('BindableFunction',{Name = "SetOption"})
  4523.         bindSetOption.Parent = explorerPanel
  4524.     end
  4525.  
  4526.     bindSetOption.OnInvoke = function(optionName,value)
  4527.         if optionCallback[optionName] then
  4528.             Option[optionName] = value
  4529.             optionCallback[optionName](value)
  4530.         end
  4531.     end
  4532.  
  4533.     local bindGetOption = explorerPanel:FindFirstChild("GetOption")
  4534.     if not bindGetOption then
  4535.         bindGetOption = Create('BindableFunction',{Name = "GetOption"})
  4536.         bindGetOption.Parent = explorerPanel
  4537.     end
  4538.  
  4539.     bindGetOption.OnInvoke = function(optionName)
  4540.         if optionName then
  4541.             return Option[optionName]
  4542.         else
  4543.             local options = {}
  4544.             for k,v in pairs(Option) do
  4545.                 options[k] = v
  4546.             end
  4547.             return options
  4548.         end
  4549.     end
  4550. end
  4551.  
  4552. function SelectionVar()
  4553.     return Selection
  4554. end
  4555.  
  4556. Input.InputBegan:connect(function(key)
  4557.     if key.KeyCode == Enum.KeyCode.LeftControl then
  4558.         HoldingCtrl = true
  4559.     end
  4560.     if key.KeyCode == Enum.KeyCode.LeftShift then
  4561.         HoldingShift = true
  4562.     end
  4563. end)
  4564.  
  4565. Input.InputEnded:connect(function(key)
  4566.     if key.KeyCode == Enum.KeyCode.LeftControl then
  4567.         HoldingCtrl = false
  4568.     end
  4569.     if key.KeyCode == Enum.KeyCode.LeftShift then
  4570.         HoldingShift = false
  4571.     end
  4572. end)
  4573.  
  4574. while RbxApi == nil do
  4575.     RbxApi = GetApiRemote:Invoke()
  4576.     wait()
  4577. end
  4578.  
  4579. --[[
  4580. explorerFilter.Changed:connect(function(prop)
  4581.     if prop == "Text" then
  4582.         rawUpdateList()
  4583.     end
  4584. end)
  4585. ]] -- literally just free lag
  4586.  
  4587. explorerFilter.FocusLost:Connect(function(EnterPressed)
  4588.     if EnterPressed then
  4589.         rawUpdateList()
  4590.     end
  4591. end)
  4592.  
  4593. CurrentInsertObjectWindow = CreateInsertObjectMenu(
  4594.     GetClasses(),
  4595.     "",
  4596.     false,
  4597.     function(option)
  4598.         CurrentInsertObjectWindow.Visible = false
  4599.         local list = SelectionVar():Get()
  4600.         for i = 1,#list do
  4601.             pcall(function() Instance.new(option,list[i]) end)
  4602.         end
  4603.         DestroyRightClick()
  4604.     end
  4605. )
Add Comment
Please, Sign In to add comment