Advertisement
okban

script

Jan 22nd, 2018
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 95.68 KB | None | 0 0
  1. function sandbox(var,func)
  2. local env = getfenv(func)
  3. local newenv = setmetatable({},{
  4. __index = function(self,k)
  5. if k=="script" then
  6. return var
  7. else
  8. return env[k]
  9. end
  10. end,
  11. })
  12. setfenv(func,newenv)
  13. return func
  14. end
  15. cors = {}
  16. mas = Instance.new("Model",game:GetService("Lighting"))
  17. ScreenGui0 = Instance.new("ScreenGui")
  18. Frame1 = Instance.new("Frame")
  19. LocalScript2 = Instance.new("LocalScript")
  20. BindableEvent3 = Instance.new("BindableEvent")
  21. BindableFunction4 = Instance.new("BindableFunction")
  22. BindableFunction5 = Instance.new("BindableFunction")
  23. BindableFunction6 = Instance.new("BindableFunction")
  24. BindableFunction7 = Instance.new("BindableFunction")
  25. Frame8 = Instance.new("Frame")
  26. LocalScript9 = Instance.new("LocalScript")
  27. Frame10 = Instance.new("Frame")
  28. TextLabel11 = Instance.new("TextLabel")
  29. Frame12 = Instance.new("Frame")
  30. TextLabel13 = Instance.new("TextLabel")
  31. Frame14 = Instance.new("Frame")
  32. ImageButton15 = Instance.new("ImageButton")
  33. Frame16 = Instance.new("Frame")
  34. Frame17 = Instance.new("Frame")
  35. Frame18 = Instance.new("Frame")
  36. Frame19 = Instance.new("Frame")
  37. Frame20 = Instance.new("Frame")
  38. ImageButton21 = Instance.new("ImageButton")
  39. Frame22 = Instance.new("Frame")
  40. Frame23 = Instance.new("Frame")
  41. Frame24 = Instance.new("Frame")
  42. Frame25 = Instance.new("Frame")
  43. Frame26 = Instance.new("Frame")
  44. ImageButton27 = Instance.new("ImageButton")
  45. ImageButton28 = Instance.new("ImageButton")
  46. Frame29 = Instance.new("Frame")
  47. Frame30 = Instance.new("Frame")
  48. Frame31 = Instance.new("Frame")
  49. Frame32 = Instance.new("Frame")
  50. Frame33 = Instance.new("Frame")
  51. Frame34 = Instance.new("Frame")
  52. TextLabel35 = Instance.new("TextLabel")
  53. TextLabel36 = Instance.new("TextLabel")
  54. Frame37 = Instance.new("Frame")
  55. Frame38 = Instance.new("Frame")
  56. TextLabel39 = Instance.new("TextLabel")
  57. TextBox40 = Instance.new("TextBox")
  58. ImageButton41 = Instance.new("ImageButton")
  59. ScreenGui0.Name = "ExplorerPropertiesGui"
  60. ScreenGui0.Parent = mas
  61. Frame1.Name = "ExplorerPanel"
  62. Frame1.Parent = ScreenGui0
  63. Frame1.Transparency = 0.10000000149012
  64. Frame1.Size = UDim2.new(0, 300, 0.5, 0)
  65. Frame1.Position = UDim2.new(1, -308, 0, 0)
  66. Frame1.BackgroundColor3 = Color3.new(1, 1, 1)
  67. Frame1.BackgroundTransparency = 0.10000000149012
  68. Frame1.BorderColor3 = Color3.new(0.74902, 0.74902, 0.74902)
  69. Frame1.Draggable = true
  70. LocalScript2.Name = "Explorer"
  71. LocalScript2.Parent = Frame1
  72. table.insert(cors,sandbox(LocalScript2,function()
  73. -- initial states
  74. local Option = {
  75. -- can modify objects
  76. Modifiable = true;
  77. -- can select objects
  78. Selectable = true;
  79. }
  80.  
  81. -- general size of GUI objects, in pixels
  82. local GUI_SIZE = 16
  83. -- padding between items within each entry
  84. local ENTRY_PADDING = 1
  85. -- padding between each entry
  86. local ENTRY_MARGIN = 1
  87.  
  88. --[[
  89.  
  90. # Explorer Panel
  91.  
  92. A GUI panel that displays the game hierarchy.
  93.  
  94.  
  95. ## Selection Bindables
  96.  
  97. - `Function GetSelection ( )`
  98.  
  99. Returns an array of objects representing the objects currently
  100. selected in the panel.
  101.  
  102. - `Function SetSelection ( Objects selection )`
  103.  
  104. Sets the objects that are selected in the panel. `selection` is an array
  105. of objects.
  106.  
  107. - `Event SelectionChanged ( )`
  108.  
  109. Fired after the selection changes.
  110.  
  111.  
  112. ## Option Bindables
  113.  
  114. - `Function GetOption ( string optionName )`
  115.  
  116. If `optionName` is given, returns the value of that option. Otherwise,
  117. returns a table of options and their current values.
  118.  
  119. - `Function SetOption ( string optionName, bool value )`
  120.  
  121. Sets `optionName` to `value`.
  122.  
  123. Options:
  124.  
  125. - Modifiable
  126.  
  127. Whether objects can be modified by the panel.
  128.  
  129. Note that modifying objects depends on being able to select them. If
  130. Selectable is false, then Actions will not be available. Reparenting
  131. is still possible, but only for the dragged object.
  132.  
  133. - Selectable
  134.  
  135. Whether objects can be selected.
  136.  
  137. If Modifiable is false, then left-clicking will perform a drag
  138. selection.
  139.  
  140. ## Updates
  141.  
  142. - 2013-09-14
  143. - Added GetOption and SetOption bindables.
  144. - Option: Modifiable; sets whether objects can be modified by the panel.
  145. - Option: Selectable; sets whether objects can be selected.
  146. - Slight modification to left-click selection behavior.
  147. - Improved layout and scaling.
  148.  
  149. - 2013-09-13
  150. - Added drag to reparent objects.
  151. - Left-click to select/deselect object.
  152. - Left-click and drag unselected object to reparent single object.
  153. - Left-click and drag selected object to move reparent entire selection.
  154. - Right-click while dragging to cancel.
  155.  
  156. - 2013-09-11
  157. - Added explorer panel header with actions.
  158. - Added Cut action.
  159. - Added Copy action.
  160. - Added Paste action.
  161. - Added Delete action.
  162. - Added drag selection.
  163. - Left-click: Add to selection on drag.
  164. - Right-click: Add to or remove from selection on drag.
  165. - Ensured SelectionChanged fires only when the selection actually changes.
  166. - Added documentation and change log.
  167. - Fixed thread issue.
  168.  
  169. - 2013-09-09
  170. - Added basic multi-selection.
  171. - Left-click to set selection.
  172. - Right-click to add to or remove from selection.
  173. - Removed "Selection" ObjectValue.
  174. - Added GetSelection BindableFunction.
  175. - Added SetSelection BindableFunction.
  176. - Added SelectionChanged BindableEvent.
  177. - Changed font to SourceSans.
  178.  
  179. - 2013-08-31
  180. - Improved GUI sizing based off of `GUI_SIZE` constant.
  181. - Automatic font size detection.
  182.  
  183. - 2013-08-27
  184. - Initial explorer panel.
  185.  
  186.  
  187. ## Todo
  188.  
  189. - Sorting
  190. - by ExplorerOrder
  191. - by children
  192. - by name
  193. - Drag objects to reparent
  194.  
  195. ]]
  196.  
  197. local ENTRY_SIZE = GUI_SIZE + ENTRY_PADDING*2
  198. local ENTRY_BOUND = ENTRY_SIZE + ENTRY_MARGIN
  199. local HEADER_SIZE = ENTRY_SIZE
  200.  
  201. local FONT = 'SourceSans'
  202. local FONT_SIZE do
  203. local size = {8,9,10,11,12,14,18,24,36,48}
  204. local s
  205. local n = math.huge
  206. for i = 1,#size do
  207. if size[i] <= GUI_SIZE then
  208. FONT_SIZE = i - 1
  209. end
  210. end
  211. end
  212.  
  213. local GuiColor = {
  214. Background = Color3.new(233/255, 233/255, 233/255);
  215. Border = Color3.new(149/255, 149/255, 149/255);
  216. Selected = Color3.new( 96/255, 140/255, 211/255);
  217. BorderSelected = Color3.new( 86/255, 125/255, 188/255);
  218. Text = Color3.new( 0/255, 0/255, 0/255);
  219. TextDisabled = Color3.new(128/255, 128/255, 128/255);
  220. TextSelected = Color3.new(255/255, 255/255, 255/255);
  221. Button = Color3.new(221/255, 221/255, 221/255);
  222. ButtonBorder = Color3.new(149/255, 149/255, 149/255);
  223. ButtonSelected = Color3.new(255/255, 0/255, 0/255);
  224. Field = Color3.new(255/255, 255/255, 255/255);
  225. FieldBorder = Color3.new(191/255, 191/255, 191/255);
  226. TitleBackground = Color3.new(178/255, 178/255, 178/255);
  227. }
  228.  
  229. ----------------------------------------------------------------
  230. ----------------------------------------------------------------
  231. ----------------------------------------------------------------
  232. ----------------------------------------------------------------
  233. ---- Icon map constants
  234.  
  235. local MAP_ID = 129293660
  236.  
  237. -- Indices based on implementation of Icon function.
  238. local ACTION_CUT = 160
  239. local ACTION_COPY = 161
  240. local ACTION_PASTE = 162
  241. local ACTION_DELETE = 163
  242. local ACTION_SORT = 164
  243. local ACTION_CUT_OVER = 174
  244. local ACTION_COPY_OVER = 175
  245. local ACTION_PASTE_OVER = 176
  246. local ACTION_DELETE_OVER = 177
  247. local ACTION_SORT_OVER = 178
  248.  
  249. local NODE_COLLAPSED = 165
  250. local NODE_EXPANDED = 166
  251. local NODE_COLLAPSED_OVER = 179
  252. local NODE_EXPANDED_OVER = 180
  253.  
  254. local ExplorerIndex = {
  255. Accoutrement = 32;
  256. AdvancedDragger = 0;
  257. Animation = 60;
  258. AnimationTrack = 60;
  259. AnimationTrackState = 60;
  260. Animator = 0;
  261. ArcHandles = 56;
  262. Authoring = 3;
  263. Backpack = 20;
  264. BackpackItem = 0;
  265. BadgeService = 0;
  266. BasePart = 1;
  267. BasePlayerGui = 46;
  268. BaseScript = 6;
  269. BevelMesh = 8;
  270. BillboardGui = 64;
  271. BindableEvent = 67;
  272. BindableFunction = 66;
  273. BlockMesh = 8;
  274. BodyAngularVelocity = 14;
  275. BodyColors = 0;
  276. BodyForce = 14;
  277. BodyGyro = 14;
  278. BodyMover = 14;
  279. BodyPosition = 14;
  280. BodyThrust = 14;
  281. BodyVelocity = 14;
  282. BoolValue = 4;
  283. BrickColorValue = 4;
  284. Button = 0;
  285. ButtonBindingWidget = 0;
  286. CFrameValue = 4;
  287. CacheableContentProvider = 0;
  288. Camera = 5;
  289. ChangeHistoryService = 0;
  290. CharacterAppearance = 0;
  291. CharacterMesh = 60;
  292. Chat = 0;
  293. ClickDetector = 41;
  294. Clothing = 40;
  295. CollectionService = 0;
  296. Color3Value = 4;
  297. Configuration = 58;
  298. ContentFilter = 0;
  299. ContentProvider = 0;
  300. ContextActionService = 0;
  301. Controller = 0;
  302. ControllerService = 0;
  303. CookiesService = 0;
  304. CoreGui = 0;
  305. CoreScript = 6;
  306. CornerWedgePart = 1;
  307. CustomEvent = 4;
  308. CustomEventReceiver = 4;
  309. CylinderMesh = 8;
  310. DataModel = 0;
  311. DataModelMesh = 8;
  312. Debris = 30;
  313. DebugSettings = 3;
  314. DebuggerBreakpoint = 0;
  315. DebuggerService = 0;
  316. DebuggerWatch = 0;
  317. Decal = 7;
  318. Dialog = 62;
  319. DialogChoice = 63;
  320. DoubleConstrainedValue = 4;
  321. Dragger = 0;
  322. DynamicRotate = 34;
  323. Explosion = 36;
  324. FWService = 0;
  325. FaceInstance = 0;
  326. FastLogSettings = 3;
  327. Feature = 0;
  328. FileMesh = 8;
  329. Fire = 61;
  330. Flag = 38;
  331. FlagStand = 39;
  332. FlagStandService = 0;
  333. FloorWire = 4;
  334. ForceField = 37;
  335. FormFactorPart = 1;
  336. Frame = 48;
  337. FriendService = 0;
  338. FunctionalTest = 0;
  339. GamePassService = 0;
  340. GameSettings = 3;
  341. GenericSettings = 3;
  342. Geometry = 0;
  343. GlobalSettings = 3;
  344. Glue = 34;
  345. GuiBase = 47;
  346. GuiBase2d = 0;
  347. GuiBase3d = 0;
  348. GuiButton = 51;
  349. GuiItem = 0;
  350. GuiLabel = 50;
  351. GuiMain = 47;
  352. GuiObject = 48;
  353. GuiRoot = 0;
  354. GuiService = 0;
  355. GuidRegistryService = 0;
  356. Handles = 53;
  357. HandlesBase = 0;
  358. Hat = 45;
  359. Hint = 33;
  360. Hole = 0;
  361. Hopper = 0;
  362. HopperBin = 22;
  363. Humanoid = 9;
  364. HumanoidController = 0;
  365. ImageButton = 52;
  366. ImageLabel = 49;
  367. InsertService = 0;
  368. Instance = 0;
  369. InstancePacketCache = 0;
  370. IntConstrainedValue = 4;
  371. IntValue = 4;
  372. JointInstance = 34;
  373. JointsService = 0;
  374. Keyframe = 60;
  375. KeyframeSequence = 0;
  376. KeyframeSequenceProvider = 0;
  377. LayerCollector = 0;
  378. Light = 0;
  379. Lighting = 13;
  380. LoadingGui = 46;
  381. LocalBackpack = 0;
  382. LocalScript = 18;
  383. LocalWorkspace = 0;
  384. LuaSettings = 3;
  385. LuaWebService = 0;
  386. ManualGlue = 34;
  387. ManualSurfaceJointInstance = 0;
  388. ManualWeld = 34;
  389. MarketplaceService = 0;
  390. MeshContentProvider = 0;
  391. Message = 33;
  392. Model = 2;
  393. Motor = 34;
  394. Motor6D = 34;
  395. MotorFeature = 0;
  396. Mouse = 0;
  397. NetworkClient = 16;
  398. NetworkMarker = 0;
  399. NetworkPeer = 0;
  400. NetworkReplicator = 29;
  401. NetworkServer = 15;
  402. NetworkSettings = 3;
  403. NotificationBox = 48;
  404. NotificationObject = 48;
  405. NumberValue = 4;
  406. ObjectValue = 4;
  407. PVAdornment = 0;
  408. PVInstance = 0;
  409. Pants = 44;
  410. ParallelRampPart = 1;
  411. Part = 1;
  412. PartAdornment = 0;
  413. PersonalServerService = 0;
  414. PhysicsPacketCache = 0;
  415. PhysicsService = 0;
  416. PhysicsSettings = 3;
  417. Platform = 1;
  418. Player = 12;
  419. PlayerGui = 46;
  420. PlayerHUD = 0;
  421. PlayerMouse = 0;
  422. Players = 21;
  423. Plugin = 0;
  424. PluginManager = 0;
  425. PluginMouse = 0;
  426. PointLight = 0;
  427. Pose = 60;
  428. PrismPart = 1;
  429. ProfilingItem = 0;
  430. PyramidPart = 1;
  431. RayValue = 4;
  432. ReflectionMetadata = 0;
  433. ReflectionMetadataCallbacks = 0;
  434. ReflectionMetadataClass = 0;
  435. ReflectionMetadataClasses = 0;
  436. ReflectionMetadataEvents = 0;
  437. ReflectionMetadataFunctions = 0;
  438. ReflectionMetadataItem = 0;
  439. ReflectionMetadataMember = 0;
  440. ReflectionMetadataProperties = 0;
  441. ReflectionMetadataYieldFunctions = 0;
  442. RenderHooksService = 0;
  443. RenderSettings = 3;
  444. RightAngleRampPart = 1;
  445. RocketPropulsion = 14;
  446. RootInstance = 0;
  447. Rotate = 34;
  448. RotateP = 34;
  449. RotateV = 34;
  450. RunService = 0;
  451. RunningAverageItemDouble = 0;
  452. RunningAverageItemInt = 0;
  453. RuntimeScriptService = 0;
  454. Scale9Frame = 0;
  455. ScreenGui = 47;
  456. Script = 6;
  457. ScriptContext = 0;
  458. ScriptDebugger = 0;
  459. ScriptInformationProvider = 0;
  460. ScriptService = 0;
  461. Seat = 35;
  462. Selection = 0;
  463. SelectionBox = 54;
  464. SelectionLasso = 57;
  465. SelectionPartLasso = 57;
  466. SelectionPointLasso = 57;
  467. ServerReplicator = 0;
  468. ServiceProvider = 0;
  469. Shirt = 43;
  470. ShirtGraphic = 40;
  471. SkateboardController = 0;
  472. SkateboardPlatform = 1;
  473. Skin = 0;
  474. Sky = 28;
  475. Smoke = 59;
  476. Snap = 34;
  477. SocialService = 0;
  478. Sound = 11;
  479. SoundService = 31;
  480. Sparkles = 42;
  481. SpawnLocation = 25;
  482. SpawnerService = 0;
  483. SpecialMesh = 8;
  484. SpotLight = 0;
  485. StarterGear = 20;
  486. StarterGui = 46;
  487. StarterPack = 20;
  488. StarterScript = 18;
  489. Stats = 0;
  490. StatsItem = 0;
  491. Status = 2;
  492. StockSound = 11;
  493. StringValue = 4;
  494. StudioTool = 0;
  495. SurfaceSelection = 55;
  496. TaskScheduler = 0;
  497. Team = 24;
  498. Teams = 23;
  499. TeleportService = 0;
  500. Terrain = 65;
  501. TestService = 68;
  502. TextBox = 51;
  503. TextButton = 51;
  504. TextLabel = 50;
  505. TextService = 0;
  506. Texture = 10;
  507. TextureContentProvider = 0;
  508. TextureTrail = 4;
  509. TimerService = 0;
  510. Tool = 17;
  511. Toolbar = 0;
  512. TotalCountTimeIntervalItem = 0;
  513. TouchTransmitter = 37;
  514. TrussPart = 1;
  515. TweenService = 0;
  516. UserGameSettings = 4;
  517. UserInputService = 0;
  518. UserSettings = 3;
  519. Vector3Value = 4;
  520. VehicleController = 0;
  521. VehicleSeat = 35;
  522. VelocityMotor = 34;
  523. VirtualUser = 0;
  524. Visit = 0;
  525. WedgePart = 1;
  526. Weld = 34;
  527. Workspace = 19;
  528. }
  529.  
  530. ----------------------------------------------------------------
  531. ----------------------------------------------------------------
  532. ----------------------------------------------------------------
  533. ----------------------------------------------------------------
  534. ----------------------------------------------------------------
  535.  
  536. function Create(ty,data)
  537. local obj
  538. if type(ty) == 'string' then
  539. obj = Instance.new(ty)
  540. else
  541. obj = ty
  542. end
  543. for k, v in pairs(data) do
  544. if type(k) == 'number' then
  545. v.Parent = obj
  546. else
  547. obj[k] = v
  548. end
  549. end
  550. return obj
  551. end
  552.  
  553. -- Connects a function to an event such that it fires asynchronously
  554. function Connect(event,func)
  555. return event:connect(function(...)
  556. local a = {...}
  557. Spawn(function() func(unpack(a)) end)
  558. end)
  559. end
  560.  
  561. -- returns the ascendant ScreenGui of an object
  562. function GetScreen(screen)
  563. if screen == nil then return nil end
  564. while not screen:IsA("ScreenGui") do
  565. screen = screen.Parent
  566. if screen == nil then return nil end
  567. end
  568. return screen
  569. end
  570.  
  571. do
  572. local ZIndexLock = {}
  573. -- Sets the ZIndex of an object and its descendants. Objects are locked so
  574. -- that SetZIndexOnChanged doesn't spawn multiple threads that set the
  575. -- ZIndex of the same object.
  576. function SetZIndex(object,z)
  577. if not ZIndexLock[object] then
  578. ZIndexLock[object] = true
  579. if object:IsA'GuiObject' then
  580. object.ZIndex = z
  581. end
  582. local children = object:GetChildren()
  583. for i = 1,#children do
  584. SetZIndex(children[i],z)
  585. end
  586. ZIndexLock[object] = nil
  587. end
  588. end
  589.  
  590. function SetZIndexOnChanged(object)
  591. return object.Changed:connect(function(p)
  592. if p == "ZIndex" then
  593. SetZIndex(object,object.ZIndex)
  594. end
  595. end)
  596. end
  597. end
  598.  
  599. ---- IconMap ----
  600. -- Image size: 256px x 256px
  601. -- Icon size: 16px x 16px
  602. -- Padding between each icon: 2px
  603. -- Padding around image edge: 1px
  604. -- Total icons: 14 x 14 (196)
  605. local Icon do
  606. local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID
  607. Game:GetService('ContentProvider'):Preload(iconMap)
  608. local iconDehash do
  609. -- 14 x 14, 0-based input, 0-based output
  610. local f=math.floor
  611. function iconDehash(h)
  612. return f(h/14%14),f(h%14)
  613. end
  614. end
  615.  
  616. function Icon(IconFrame,index)
  617. local row,col = iconDehash(index)
  618. local mapSize = Vector2.new(256,256)
  619. local pad,border = 2,1
  620. local iconSize = 16
  621.  
  622. local class = 'Frame'
  623. if type(IconFrame) == 'string' then
  624. class = IconFrame
  625. IconFrame = nil
  626. end
  627.  
  628. if not IconFrame then
  629. IconFrame = Create(class,{
  630. Name = "Icon";
  631. BackgroundTransparency = 1;
  632. ClipsDescendants = true;
  633. Create('ImageLabel',{
  634. Name = "IconMap";
  635. Active = false;
  636. BackgroundTransparency = 1;
  637. Image = iconMap;
  638. Size = UDim2.new(mapSize.x/iconSize,0,mapSize.y/iconSize,0);
  639. });
  640. })
  641. end
  642.  
  643. IconFrame.IconMap.Position = UDim2.new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0)
  644. return IconFrame
  645. end
  646. end
  647.  
  648. ----------------------------------------------------------------
  649. ----------------------------------------------------------------
  650. ----------------------------------------------------------------
  651. ----------------------------------------------------------------
  652. ---- ScrollBar
  653. do
  654. -- AutoButtonColor doesn't always reset properly
  655. local function ResetButtonColor(button)
  656. local active = button.Active
  657. button.Active = not active
  658. button.Active = active
  659. end
  660.  
  661. local function ArrowGraphic(size,dir,scaled,template)
  662. local Frame = Create('Frame',{
  663. Name = "Arrow Graphic";
  664. BorderSizePixel = 0;
  665. Size = UDim2.new(0,size,0,size);
  666. Transparency = 1;
  667. })
  668. if not template then
  669. template = Instance.new("Frame")
  670. template.BorderSizePixel = 0
  671. end
  672.  
  673. local transform
  674. if dir == nil or dir == 'Up' then
  675. function transform(p,s) return p,s end
  676. elseif dir == 'Down' then
  677. function transform(p,s) return UDim2.new(0,p.X.Offset,0,size-p.Y.Offset-1),s end
  678. elseif dir == 'Left' then
  679. 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
  680. elseif dir == 'Right' then
  681. 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
  682. end
  683.  
  684. local scale
  685. if scaled then
  686. 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
  687. else
  688. function scale(p,s) return p,s end
  689. end
  690.  
  691. local o = math.floor(size/4)
  692. if size%2 == 0 then
  693. local n = size/2-1
  694. for i = 0,n do
  695. local t = template:Clone()
  696. local p,s = scale(transform(
  697. UDim2.new(0,n-i,0,o+i),
  698. UDim2.new(0,(i+1)*2,0,1)
  699. ))
  700. t.Position = p
  701. t.Size = s
  702. t.Parent = Frame
  703. end
  704. else
  705. local n = (size-1)/2
  706. for i = 0,n do
  707. local t = template:Clone()
  708. local p,s = scale(transform(
  709. UDim2.new(0,n-i,0,o+i),
  710. UDim2.new(0,i*2+1,0,1)
  711. ))
  712. t.Position = p
  713. t.Size = s
  714. t.Parent = Frame
  715. end
  716. end
  717. if size%4 > 1 then
  718. local t = template:Clone()
  719. local p,s = scale(transform(
  720. UDim2.new(0,0,0,size-o-1),
  721. UDim2.new(0,size,0,1)
  722. ))
  723. t.Position = p
  724. t.Size = s
  725. t.Parent = Frame
  726. end
  727. return Frame
  728. end
  729.  
  730.  
  731. local function GripGraphic(size,dir,spacing,scaled,template)
  732. local Frame = Create('Frame',{
  733. Name = "Grip Graphic";
  734. BorderSizePixel = 0;
  735. Size = UDim2.new(0,size.x,0,size.y);
  736. Transparency = 1;
  737. })
  738. if not template then
  739. template = Instance.new("Frame")
  740. template.BorderSizePixel = 0
  741. end
  742.  
  743. spacing = spacing or 2
  744.  
  745. local scale
  746. if scaled then
  747. function scale(p) return UDim2.new(p.X.Offset/size.x,0,p.Y.Offset/size.y,0) end
  748. else
  749. function scale(p) return p end
  750. end
  751.  
  752. if dir == 'Vertical' then
  753. for i=0,size.x-1,spacing do
  754. local t = template:Clone()
  755. t.Size = scale(UDim2.new(0,1,0,size.y))
  756. t.Position = scale(UDim2.new(0,i,0,0))
  757. t.Parent = Frame
  758. end
  759. elseif dir == nil or dir == 'Horizontal' then
  760. for i=0,size.y-1,spacing do
  761. local t = template:Clone()
  762. t.Size = scale(UDim2.new(0,size.x,0,1))
  763. t.Position = scale(UDim2.new(0,0,0,i))
  764. t.Parent = Frame
  765. end
  766. end
  767.  
  768. return Frame
  769. end
  770.  
  771. local mt = {
  772. __index = {
  773. GetScrollPercent = function(self)
  774. return self.ScrollIndex/(self.TotalSpace-self.VisibleSpace)
  775. end;
  776. CanScrollDown = function(self)
  777. return self.ScrollIndex + self.VisibleSpace < self.TotalSpace
  778. end;
  779. CanScrollUp = function(self)
  780. return self.ScrollIndex > 0
  781. end;
  782. ScrollDown = function(self)
  783. self.ScrollIndex = self.ScrollIndex + self.PageIncrement
  784. self:Update()
  785. end;
  786. ScrollUp = function(self)
  787. self.ScrollIndex = self.ScrollIndex - self.PageIncrement
  788. self:Update()
  789. end;
  790. ScrollTo = function(self,index)
  791. self.ScrollIndex = index
  792. self:Update()
  793. end;
  794. SetScrollPercent = function(self,percent)
  795. self.ScrollIndex = math.floor((self.TotalSpace - self.VisibleSpace)*percent + 0.5)
  796. self:Update()
  797. end;
  798. };
  799. }
  800. mt.__index.CanScrollRight = mt.__index.CanScrollDown
  801. mt.__index.CanScrollLeft = mt.__index.CanScrollUp
  802. mt.__index.ScrollLeft = mt.__index.ScrollUp
  803. mt.__index.ScrollRight = mt.__index.ScrollDown
  804.  
  805. function ScrollBar(horizontal)
  806. -- create row scroll bar
  807. local ScrollFrame = Create('Frame',{
  808. Name = "ScrollFrame";
  809. Position = horizontal and UDim2.new(0,0,1,-GUI_SIZE) or UDim2.new(1,-GUI_SIZE,0,0);
  810. Size = horizontal and UDim2.new(1,0,0,GUI_SIZE) or UDim2.new(0,GUI_SIZE,1,0);
  811. BackgroundTransparency = 1;
  812. Create('ImageButton',{
  813. Name = "ScrollDown";
  814. Position = horizontal and UDim2.new(1,-GUI_SIZE,0,0) or UDim2.new(0,0,1,-GUI_SIZE);
  815. Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
  816. BackgroundColor3 = GuiColor.Button;
  817. BorderColor3 = GuiColor.Border;
  818. --BorderSizePixel = 0;
  819. });
  820. Create('ImageButton',{
  821. Name = "ScrollUp";
  822. Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
  823. BackgroundColor3 = GuiColor.Button;
  824. BorderColor3 = GuiColor.Border;
  825. --BorderSizePixel = 0;
  826. });
  827. Create('ImageButton',{
  828. Name = "ScrollBar";
  829. Size = horizontal and UDim2.new(1,-GUI_SIZE*2,1,0) or UDim2.new(1,0,1,-GUI_SIZE*2);
  830. Position = horizontal and UDim2.new(0,GUI_SIZE,0,0) or UDim2.new(0,0,0,GUI_SIZE);
  831. AutoButtonColor = false;
  832. BackgroundColor3 = Color3.new(0.94902, 0.94902, 0.94902);
  833. BorderColor3 = GuiColor.Border;
  834. --BorderSizePixel = 0;
  835. Create('ImageButton',{
  836. Name = "ScrollThumb";
  837. AutoButtonColor = false;
  838. Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
  839. BackgroundColor3 = GuiColor.Button;
  840. BorderColor3 = GuiColor.Border;
  841. --BorderSizePixel = 0;
  842. });
  843. });
  844. })
  845.  
  846. local graphicTemplate = Create('Frame',{
  847. Name="Graphic";
  848. BorderSizePixel = 0;
  849. BackgroundColor3 = GuiColor.Border;
  850. })
  851. local graphicSize = GUI_SIZE/2
  852.  
  853. local ScrollDownFrame = ScrollFrame.ScrollDown
  854. local ScrollDownGraphic = ArrowGraphic(graphicSize,horizontal and 'Right' or 'Down',true,graphicTemplate)
  855. ScrollDownGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
  856. ScrollDownGraphic.Parent = ScrollDownFrame
  857. local ScrollUpFrame = ScrollFrame.ScrollUp
  858. local ScrollUpGraphic = ArrowGraphic(graphicSize,horizontal and 'Left' or 'Up',true,graphicTemplate)
  859. ScrollUpGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
  860. ScrollUpGraphic.Parent = ScrollUpFrame
  861. local ScrollBarFrame = ScrollFrame.ScrollBar
  862. local ScrollThumbFrame = ScrollBarFrame.ScrollThumb
  863. do
  864. local size = GUI_SIZE*3/8
  865. local Decal = GripGraphic(Vector2.new(size,size),horizontal and 'Vertical' or 'Horizontal',2,graphicTemplate)
  866. Decal.Position = UDim2.new(0.5,-size/2,0.5,-size/2)
  867. Decal.Parent = ScrollThumbFrame
  868. end
  869.  
  870. local Class = setmetatable({
  871. GUI = ScrollFrame;
  872. ScrollIndex = 0;
  873. VisibleSpace = 0;
  874. TotalSpace = 0;
  875. PageIncrement = 1;
  876. },mt)
  877.  
  878. local UpdateScrollThumb
  879. if horizontal then
  880. function UpdateScrollThumb()
  881. ScrollThumbFrame.Size = UDim2.new(Class.VisibleSpace/Class.TotalSpace,0,0,GUI_SIZE)
  882. if ScrollThumbFrame.AbsoluteSize.x < GUI_SIZE then
  883. ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
  884. end
  885. local barSize = ScrollBarFrame.AbsoluteSize.x
  886. ScrollThumbFrame.Position = UDim2.new(Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.x)/barSize,0,0,0)
  887. end
  888. else
  889. function UpdateScrollThumb()
  890. ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,Class.VisibleSpace/Class.TotalSpace,0)
  891. if ScrollThumbFrame.AbsoluteSize.y < GUI_SIZE then
  892. ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
  893. end
  894. local barSize = ScrollBarFrame.AbsoluteSize.y
  895. ScrollThumbFrame.Position = UDim2.new(0,0,Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.y)/barSize,0)
  896. end
  897. end
  898.  
  899. local lastDown
  900. local lastUp
  901. local scrollStyle = {BackgroundColor3=GuiColor.Border,BackgroundTransparency=0}
  902. local scrollStyle_ds = {BackgroundColor3=GuiColor.Border,BackgroundTransparency=0.7}
  903.  
  904. local function Update()
  905. local t = Class.TotalSpace
  906. local v = Class.VisibleSpace
  907. local s = Class.ScrollIndex
  908. if v <= t then
  909. if s > 0 then
  910. if s + v > t then
  911. Class.ScrollIndex = t - v
  912. end
  913. else
  914. Class.ScrollIndex = 0
  915. end
  916. else
  917. Class.ScrollIndex = 0
  918. end
  919.  
  920. if Class.UpdateCallback then
  921. if Class.UpdateCallback(Class) == false then
  922. return
  923. end
  924. end
  925.  
  926. local down = Class:CanScrollDown()
  927. local up = Class:CanScrollUp()
  928. if down ~= lastDown then
  929. lastDown = down
  930. ScrollDownFrame.Active = down
  931. ScrollDownFrame.AutoButtonColor = down
  932. local children = ScrollDownGraphic:GetChildren()
  933. local style = down and scrollStyle or scrollStyle_ds
  934. for i = 1,#children do
  935. Create(children[i],style)
  936. end
  937. end
  938. if up ~= lastUp then
  939. lastUp = up
  940. ScrollUpFrame.Active = up
  941. ScrollUpFrame.AutoButtonColor = up
  942. local children = ScrollUpGraphic:GetChildren()
  943. local style = up and scrollStyle or scrollStyle_ds
  944. for i = 1,#children do
  945. Create(children[i],style)
  946. end
  947. end
  948. ScrollThumbFrame.Visible = down or up
  949. UpdateScrollThumb()
  950. end
  951. Class.Update = Update
  952.  
  953. SetZIndexOnChanged(ScrollFrame)
  954.  
  955. local MouseDrag = Create('ImageButton',{
  956. Name = "MouseDrag";
  957. Position = UDim2.new(-0.25,0,-0.25,0);
  958. Size = UDim2.new(1.5,0,1.5,0);
  959. Transparency = 1;
  960. AutoButtonColor = false;
  961. Active = true;
  962. ZIndex = 10;
  963. })
  964.  
  965. local scrollEventID = 0
  966. ScrollDownFrame.MouseButton1Down:connect(function()
  967. scrollEventID = tick()
  968. local current = scrollEventID
  969. local up_con
  970. up_con = MouseDrag.MouseButton1Up:connect(function()
  971. scrollEventID = tick()
  972. MouseDrag.Parent = nil
  973. ResetButtonColor(ScrollDownFrame)
  974. up_con:disconnect(); drag = nil
  975. end)
  976. MouseDrag.Parent = GetScreen(ScrollFrame)
  977. Class:ScrollDown()
  978. wait(0.2) -- delay before auto scroll
  979. while scrollEventID == current do
  980. Class:ScrollDown()
  981. if not Class:CanScrollDown() then break end
  982. wait()
  983. end
  984. end)
  985.  
  986. ScrollDownFrame.MouseButton1Up:connect(function()
  987. scrollEventID = tick()
  988. end)
  989.  
  990. ScrollUpFrame.MouseButton1Down:connect(function()
  991. scrollEventID = tick()
  992. local current = scrollEventID
  993. local up_con
  994. up_con = MouseDrag.MouseButton1Up:connect(function()
  995. scrollEventID = tick()
  996. MouseDrag.Parent = nil
  997. ResetButtonColor(ScrollUpFrame)
  998. up_con:disconnect(); drag = nil
  999. end)
  1000. MouseDrag.Parent = GetScreen(ScrollFrame)
  1001. Class:ScrollUp()
  1002. wait(0.2)
  1003. while scrollEventID == current do
  1004. Class:ScrollUp()
  1005. if not Class:CanScrollUp() then break end
  1006. wait()
  1007. end
  1008. end)
  1009.  
  1010. ScrollUpFrame.MouseButton1Up:connect(function()
  1011. scrollEventID = tick()
  1012. end)
  1013.  
  1014. if horizontal then
  1015. ScrollBarFrame.MouseButton1Down:connect(function(x,y)
  1016. scrollEventID = tick()
  1017. local current = scrollEventID
  1018. local up_con
  1019. up_con = MouseDrag.MouseButton1Up:connect(function()
  1020. scrollEventID = tick()
  1021. MouseDrag.Parent = nil
  1022. ResetButtonColor(ScrollUpFrame)
  1023. up_con:disconnect(); drag = nil
  1024. end)
  1025. MouseDrag.Parent = GetScreen(ScrollFrame)
  1026. if x > ScrollThumbFrame.AbsolutePosition.x then
  1027. Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1028. wait(0.2)
  1029. while scrollEventID == current do
  1030. if x < ScrollThumbFrame.AbsolutePosition.x + ScrollThumbFrame.AbsoluteSize.x then break end
  1031. Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1032. wait()
  1033. end
  1034. else
  1035. Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1036. wait(0.2)
  1037. while scrollEventID == current do
  1038. if x > ScrollThumbFrame.AbsolutePosition.x then break end
  1039. Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1040. wait()
  1041. end
  1042. end
  1043. end)
  1044. else
  1045. ScrollBarFrame.MouseButton1Down:connect(function(x,y)
  1046. scrollEventID = tick()
  1047. local current = scrollEventID
  1048. local up_con
  1049. up_con = MouseDrag.MouseButton1Up:connect(function()
  1050. scrollEventID = tick()
  1051. MouseDrag.Parent = nil
  1052. ResetButtonColor(ScrollUpFrame)
  1053. up_con:disconnect(); drag = nil
  1054. end)
  1055. MouseDrag.Parent = GetScreen(ScrollFrame)
  1056. if y > ScrollThumbFrame.AbsolutePosition.y then
  1057. Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1058. wait(0.2)
  1059. while scrollEventID == current do
  1060. if y < ScrollThumbFrame.AbsolutePosition.y + ScrollThumbFrame.AbsoluteSize.y then break end
  1061. Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
  1062. wait()
  1063. end
  1064. else
  1065. Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1066. wait(0.2)
  1067. while scrollEventID == current do
  1068. if y > ScrollThumbFrame.AbsolutePosition.y then break end
  1069. Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
  1070. wait()
  1071. end
  1072. end
  1073. end)
  1074. end
  1075.  
  1076. if horizontal then
  1077. ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
  1078. scrollEventID = tick()
  1079. local mouse_offset = x - ScrollThumbFrame.AbsolutePosition.x
  1080. local drag_con
  1081. local up_con
  1082. drag_con = MouseDrag.MouseMoved:connect(function(x,y)
  1083. local bar_abs_pos = ScrollBarFrame.AbsolutePosition.x
  1084. local bar_drag = ScrollBarFrame.AbsoluteSize.x - ScrollThumbFrame.AbsoluteSize.x
  1085. local bar_abs_one = bar_abs_pos + bar_drag
  1086. x = x - mouse_offset
  1087. x = x < bar_abs_pos and bar_abs_pos or x > bar_abs_one and bar_abs_one or x
  1088. x = x - bar_abs_pos
  1089. Class:SetScrollPercent(x/(bar_drag))
  1090. end)
  1091. up_con = MouseDrag.MouseButton1Up:connect(function()
  1092. scrollEventID = tick()
  1093. MouseDrag.Parent = nil
  1094. ResetButtonColor(ScrollThumbFrame)
  1095. drag_con:disconnect(); drag_con = nil
  1096. up_con:disconnect(); drag = nil
  1097. end)
  1098. MouseDrag.Parent = GetScreen(ScrollFrame)
  1099. end)
  1100. else
  1101. ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
  1102. scrollEventID = tick()
  1103. local mouse_offset = y - ScrollThumbFrame.AbsolutePosition.y
  1104. local drag_con
  1105. local up_con
  1106. drag_con = MouseDrag.MouseMoved:connect(function(x,y)
  1107. local bar_abs_pos = ScrollBarFrame.AbsolutePosition.y
  1108. local bar_drag = ScrollBarFrame.AbsoluteSize.y - ScrollThumbFrame.AbsoluteSize.y
  1109. local bar_abs_one = bar_abs_pos + bar_drag
  1110. y = y - mouse_offset
  1111. y = y < bar_abs_pos and bar_abs_pos or y > bar_abs_one and bar_abs_one or y
  1112. y = y - bar_abs_pos
  1113. Class:SetScrollPercent(y/(bar_drag))
  1114. end)
  1115. up_con = MouseDrag.MouseButton1Up:connect(function()
  1116. scrollEventID = tick()
  1117. MouseDrag.Parent = nil
  1118. ResetButtonColor(ScrollThumbFrame)
  1119. drag_con:disconnect(); drag_con = nil
  1120. up_con:disconnect(); drag = nil
  1121. end)
  1122. MouseDrag.Parent = GetScreen(ScrollFrame)
  1123. end)
  1124. end
  1125.  
  1126. function Class:Destroy()
  1127. ScrollFrame:Destroy()
  1128. MouseDrag:Destroy()
  1129. for k in pairs(Class) do
  1130. Class[k] = nil
  1131. end
  1132. setmetatable(Class,nil)
  1133. end
  1134.  
  1135. Update()
  1136.  
  1137. return Class
  1138. end
  1139. end
  1140.  
  1141. ----------------------------------------------------------------
  1142. ----------------------------------------------------------------
  1143. ----------------------------------------------------------------
  1144. ----------------------------------------------------------------
  1145. ---- Explorer panel
  1146.  
  1147. local explorerPanel = script.Parent
  1148. Create(explorerPanel,{
  1149. BackgroundColor3 = GuiColor.Field;
  1150. BorderColor3 = GuiColor.Border;
  1151. Active = true;
  1152. })
  1153.  
  1154. local listFrame = Create('Frame',{
  1155. Name = "List";
  1156. BackgroundTransparency = 1;
  1157. ClipsDescendants = true;
  1158. Position = UDim2.new(0,0,0,HEADER_SIZE);
  1159. Size = UDim2.new(1,-GUI_SIZE,1,-HEADER_SIZE);
  1160. Parent = explorerPanel;
  1161. })
  1162.  
  1163. local scrollBar = ScrollBar(false)
  1164. scrollBar.PageIncrement = 1
  1165. Create(scrollBar.GUI,{
  1166. Position = UDim2.new(1,-GUI_SIZE,0,HEADER_SIZE);
  1167. Size = UDim2.new(0,GUI_SIZE,1,-HEADER_SIZE);
  1168. Parent = explorerPanel;
  1169. })
  1170.  
  1171. local scrollBarH = ScrollBar(true)
  1172. scrollBarH.PageIncrement = GUI_SIZE
  1173. Create(scrollBarH.GUI,{
  1174. Position = UDim2.new(0,0,1,-GUI_SIZE);
  1175. Size = UDim2.new(1,-GUI_SIZE,0,GUI_SIZE);
  1176. Visible = false;
  1177. Parent = explorerPanel;
  1178. })
  1179.  
  1180. local headerFrame = Create('Frame',{
  1181. Name = "Header";
  1182. BackgroundColor3 = GuiColor.Background;
  1183. BorderColor3 = GuiColor.Border;
  1184. Position = UDim2.new(0,0,0,0);
  1185. Size = UDim2.new(1,0,0,HEADER_SIZE);
  1186. Parent = explorerPanel;
  1187. Create('TextLabel',{
  1188. Text = "Explorer";
  1189. BackgroundTransparency = 1;
  1190. TextColor3 = GuiColor.Text;
  1191. TextXAlignment = 'Left';
  1192. Font = FONT;
  1193. FontSize = FONT_SIZE;
  1194. Position = UDim2.new(0,4,0,0);
  1195. Size = UDim2.new(1,-4,1,0);
  1196. });
  1197. })
  1198.  
  1199. SetZIndexOnChanged(explorerPanel)
  1200.  
  1201. local getTextWidth do
  1202. local text = Create('TextLabel',{
  1203. Name = "TextWidth";
  1204. TextXAlignment = 'Left';
  1205. TextYAlignment = 'Center';
  1206. Font = FONT;
  1207. FontSize = FONT_SIZE;
  1208. Text = "";
  1209. Position = UDim2.new(0,0,0,0);
  1210. Size = UDim2.new(1,0,1,0);
  1211. Visible = false;
  1212. Parent = explorerPanel;
  1213. })
  1214. function getTextWidth(s)
  1215. text.Text = s
  1216. return text.TextBounds.x
  1217. end
  1218. end
  1219.  
  1220. -- Holds the game tree converted to a list.
  1221. local TreeList = {}
  1222. -- Matches objects to their tree node representation.
  1223. local NodeLookup = {}
  1224.  
  1225. local nodeWidth = 0
  1226.  
  1227. local updateList,rawUpdateList,updateScroll,rawUpdateSize do
  1228. local function r(t)
  1229. for i = 1,#t do
  1230. TreeList[#TreeList+1] = t[i]
  1231.  
  1232. local w = (t[i].Depth)*(2+ENTRY_PADDING+GUI_SIZE) + 2 + ENTRY_SIZE + 4 + getTextWidth(t[i].Object.Name) + 4
  1233. if w > nodeWidth then
  1234. nodeWidth = w
  1235. end
  1236. if t[i].Expanded then
  1237. r(t[i])
  1238. end
  1239. end
  1240. end
  1241.  
  1242. function rawUpdateSize()
  1243. scrollBarH.TotalSpace = nodeWidth
  1244. scrollBarH.VisibleSpace = listFrame.AbsoluteSize.x
  1245. scrollBarH:Update()
  1246. local visible = scrollBarH:CanScrollDown() or scrollBarH:CanScrollUp()
  1247. scrollBarH.GUI.Visible = visible
  1248.  
  1249. listFrame.Size = UDim2.new(1,-GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
  1250.  
  1251. scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
  1252. scrollBar.GUI.Size = UDim2.new(0,GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
  1253.  
  1254. scrollBar.TotalSpace = #TreeList+1
  1255. scrollBar:Update()
  1256. end
  1257.  
  1258. function rawUpdateList()
  1259. -- Clear then repopulate the entire list. It appears to be fast enough.
  1260. TreeList = {}
  1261. nodeWidth = 0
  1262. r(NodeLookup[Game])
  1263. rawUpdateSize()
  1264. end
  1265.  
  1266. -- Adding or removing large models will cause many updates to occur. We
  1267. -- can reduce the number of updates by creating a delay, then dropping any
  1268. -- updates that occur during the delay.
  1269. local updatingList = false
  1270. function updateList()
  1271. if updatingList then return end
  1272. updatingList = true
  1273. wait(0.25)
  1274. updatingList = false
  1275. rawUpdateList()
  1276. end
  1277.  
  1278. local updatingScroll = false
  1279. function updateScroll()
  1280. if updatingScroll then return end
  1281. updatingScroll = true
  1282. wait(0.25)
  1283. updatingScroll = false
  1284. scrollBar:Update()
  1285. end
  1286. end
  1287.  
  1288. local Selection do
  1289. local bindGetSelection = script.Parent:FindFirstChild("GetSelection")
  1290. if not bindGetSelection then
  1291. bindGetSelection = Create('BindableFunction',{Name = "GetSelection"})
  1292. bindGetSelection.Parent = script.Parent
  1293. end
  1294.  
  1295. local bindSetSelection = script.Parent:FindFirstChild("SetSelection")
  1296. if not bindSetSelection then
  1297. bindSetSelection = Create('BindableFunction',{Name = "SetSelection"})
  1298. bindSetSelection.Parent = script.Parent
  1299. end
  1300.  
  1301. local bindSelectionChanged = script.Parent:FindFirstChild("SelectionChanged")
  1302. if not bindSelectionChanged then
  1303. bindSelectionChanged = Create('BindableEvent',{Name = "SelectionChanged"})
  1304. bindSelectionChanged.Parent = script.Parent
  1305. end
  1306.  
  1307. local SelectionList = {}
  1308. local SelectionSet = {}
  1309. Selection = {
  1310. Selected = SelectionSet;
  1311. List = SelectionList;
  1312. }
  1313.  
  1314. local function addObject(object)
  1315. -- list update
  1316. local lupdate = false
  1317. -- scroll update
  1318. local supdate = false
  1319.  
  1320. if not SelectionSet[object] then
  1321. local node = NodeLookup[object]
  1322. if node then
  1323. table.insert(SelectionList,object)
  1324. SelectionSet[object] = true
  1325. node.Selected = true
  1326.  
  1327. -- expand all ancestors so that selected node becomes visible
  1328. node = node.Parent
  1329. while node do
  1330. if not node.Expanded then
  1331. node.Expanded = true
  1332. lupdate = true
  1333. end
  1334. node = node.Parent
  1335. end
  1336. supdate = true
  1337. end
  1338. end
  1339. return lupdate,supdate
  1340. end
  1341.  
  1342. function Selection:Set(objects)
  1343. local lupdate = false
  1344. local supdate = false
  1345.  
  1346. if #SelectionList > 0 then
  1347. for i = 1,#SelectionList do
  1348. local object = SelectionList[i]
  1349. local node = NodeLookup[object]
  1350. if node then
  1351. node.Selected = false
  1352. SelectionSet[object] = nil
  1353. end
  1354. end
  1355.  
  1356. SelectionList = {}
  1357. Selection.List = SelectionList
  1358. supdate = true
  1359. end
  1360.  
  1361. for i = 1,#objects do
  1362. local l,s = addObject(objects[i])
  1363. lupdate = l or lupdate
  1364. supdate = s or supdate
  1365. end
  1366.  
  1367. if lupdate then
  1368. rawUpdateList()
  1369. supdate = true
  1370. elseif supdate then
  1371. scrollBar:Update()
  1372. end
  1373.  
  1374. if supdate then
  1375. bindSelectionChanged:Fire()
  1376. end
  1377. end
  1378.  
  1379. function Selection:Add(object)
  1380. local l,s = addObject(object)
  1381. if l then
  1382. rawUpdateList()
  1383. bindSelectionChanged:Fire()
  1384. elseif s then
  1385. scrollBar:Update()
  1386. bindSelectionChanged:Fire()
  1387. end
  1388. end
  1389.  
  1390. function Selection:Remove(object,noupdate)
  1391. if SelectionSet[object] then
  1392. local node = NodeLookup[object]
  1393. if node then
  1394. node.Selected = false
  1395. SelectionSet[object] = nil
  1396. for i = 1,#SelectionList do
  1397. if SelectionList[i] == object then
  1398. table.remove(SelectionList,i)
  1399. break
  1400. end
  1401. end
  1402.  
  1403. if not noupdate then
  1404. scrollBar:Update()
  1405. end
  1406. bindSelectionChanged:Fire()
  1407. end
  1408. end
  1409. end
  1410.  
  1411. function Selection:Get()
  1412. local list = {}
  1413. for i = 1,#SelectionList do
  1414. list[i] = SelectionList[i]
  1415. end
  1416. return list
  1417. end
  1418.  
  1419. bindSetSelection.OnInvoke = function(...)
  1420. Selection:Set(...)
  1421. end
  1422.  
  1423. bindGetSelection.OnInvoke = function()
  1424. return Selection:Get()
  1425. end
  1426. end
  1427.  
  1428. local function cancelReparentDrag()end
  1429. local function cancelSelectDrag()end
  1430. do
  1431. local listEntries = {}
  1432. local nameConnLookup = {}
  1433.  
  1434. local mouseDrag = Create('ImageButton',{
  1435. Name = "MouseDrag";
  1436. Position = UDim2.new(-0.25,0,-0.25,0);
  1437. Size = UDim2.new(1.5,0,1.5,0);
  1438. Transparency = 1;
  1439. AutoButtonColor = false;
  1440. Active = true;
  1441. ZIndex = 10;
  1442. })
  1443. local function dragSelect(last,add,button)
  1444. local connDrag
  1445. local conUp
  1446.  
  1447. conDrag = mouseDrag.MouseMoved:connect(function(x,y)
  1448. local pos = Vector2.new(x,y) - listFrame.AbsolutePosition
  1449. local size = listFrame.AbsoluteSize
  1450. if pos.x < 0 or pos.x > size.x or pos.y < 0 or pos.y > size.y then return end
  1451.  
  1452. local i = math.ceil(pos.y/ENTRY_BOUND) + scrollBar.ScrollIndex
  1453. -- Mouse may have made a large step, so interpolate between the
  1454. -- last index and the current.
  1455. for n = i<last and i or last, i>last and i or last do
  1456. local node = TreeList[n]
  1457. if node then
  1458. if add then
  1459. Selection:Add(node.Object)
  1460. else
  1461. Selection:Remove(node.Object)
  1462. end
  1463. end
  1464. end
  1465. last = i
  1466. end)
  1467.  
  1468. function cancelSelectDrag()
  1469. mouseDrag.Parent = nil
  1470. conDrag:disconnect()
  1471. conUp:disconnect()
  1472. function cancelSelectDrag()end
  1473. end
  1474.  
  1475. conUp = mouseDrag[button]:connect(cancelSelectDrag)
  1476.  
  1477. mouseDrag.Parent = GetScreen(listFrame)
  1478. end
  1479.  
  1480. local function dragReparent(object,dragGhost,clickPos,ghostOffset)
  1481. local connDrag
  1482. local conUp
  1483. local conUp2
  1484.  
  1485. local parentIndex = nil
  1486. local dragged = false
  1487.  
  1488. local parentHighlight = Create('Frame',{
  1489. Transparency = 1;
  1490. Visible = false;
  1491. Create('Frame',{
  1492. BorderSizePixel = 0;
  1493. BackgroundColor3 = Color3.new(0,0,0);
  1494. BackgroundTransparency = 0.1;
  1495. Position = UDim2.new(0,0,0,0);
  1496. Size = UDim2.new(1,0,0,1);
  1497. });
  1498. Create('Frame',{
  1499. BorderSizePixel = 0;
  1500. BackgroundColor3 = Color3.new(0,0,0);
  1501. BackgroundTransparency = 0.1;
  1502. Position = UDim2.new(1,0,0,0);
  1503. Size = UDim2.new(0,1,1,0);
  1504. });
  1505. Create('Frame',{
  1506. BorderSizePixel = 0;
  1507. BackgroundColor3 = Color3.new(0,0,0);
  1508. BackgroundTransparency = 0.1;
  1509. Position = UDim2.new(0,0,1,0);
  1510. Size = UDim2.new(1,0,0,1);
  1511. });
  1512. Create('Frame',{
  1513. BorderSizePixel = 0;
  1514. BackgroundColor3 = Color3.new(0,0,0);
  1515. BackgroundTransparency = 0.1;
  1516. Position = UDim2.new(0,0,0,0);
  1517. Size = UDim2.new(0,1,1,0);
  1518. });
  1519. })
  1520. SetZIndex(parentHighlight,9)
  1521.  
  1522. conDrag = mouseDrag.MouseMoved:connect(function(x,y)
  1523. local dragPos = Vector2.new(x,y)
  1524. if dragged then
  1525. local pos = dragPos - listFrame.AbsolutePosition
  1526. local size = listFrame.AbsoluteSize
  1527.  
  1528. parentIndex = nil
  1529. parentHighlight.Visible = false
  1530. if pos.x >= 0 and pos.x <= size.x and pos.y >= 0 and pos.y <= size.y then
  1531. local i = math.ceil(pos.y/ENTRY_BOUND)
  1532. local node = TreeList[i + scrollBar.ScrollIndex]
  1533. if node and node.Object ~= object and not object:IsAncestorOf(node.Object) then
  1534. parentIndex = i
  1535. local entry = listEntries[i]
  1536. if entry then
  1537. parentHighlight.Visible = true
  1538. parentHighlight.Position = UDim2.new(0,1,0,entry.AbsolutePosition.y-listFrame.AbsolutePosition.y)
  1539. parentHighlight.Size = UDim2.new(0,size.x-4,0,entry.AbsoluteSize.y)
  1540. end
  1541. end
  1542. end
  1543.  
  1544. dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
  1545. elseif (clickPos-dragPos).magnitude > 8 then
  1546. dragged = true
  1547. SetZIndex(dragGhost,9)
  1548. dragGhost.IndentFrame.Transparency = 0.25
  1549. dragGhost.IndentFrame.EntryText.TextColor3 = GuiColor.TextSelected
  1550. dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
  1551. dragGhost.Parent = GetScreen(listFrame)
  1552. parentHighlight.Parent = listFrame
  1553. end
  1554. end)
  1555.  
  1556. function cancelReparentDrag()
  1557. mouseDrag.Parent = nil
  1558. conDrag:disconnect()
  1559. conUp:disconnect()
  1560. conUp2:disconnect()
  1561. dragGhost:Destroy()
  1562. parentHighlight:Destroy()
  1563. function cancelReparentDrag()end
  1564. end
  1565.  
  1566. local wasSelected = Selection.Selected[object]
  1567. if not wasSelected and Option.Selectable then
  1568. Selection:Set({object})
  1569. end
  1570.  
  1571. conUp = mouseDrag.MouseButton1Up:connect(function()
  1572. cancelReparentDrag()
  1573. if dragged then
  1574. if parentIndex then
  1575. local parentNode = TreeList[parentIndex + scrollBar.ScrollIndex]
  1576. if parentNode then
  1577. parentNode.Expanded = true
  1578.  
  1579. local parentObj = parentNode.Object
  1580. local function parent(a,b)
  1581. a.Parent = b
  1582. end
  1583. if Option.Selectable then
  1584. local list = Selection.List
  1585. for i = 1,#list do
  1586. pcall(parent,list[i],parentObj)
  1587. end
  1588. else
  1589. pcall(parent,object,parentObj)
  1590. end
  1591. end
  1592. end
  1593. else
  1594. -- do selection click
  1595. if wasSelected and Option.Selectable then
  1596. Selection:Set({})
  1597. end
  1598. end
  1599. end)
  1600. conUp2 = mouseDrag.MouseButton2Down:connect(function()
  1601. cancelReparentDrag()
  1602. end)
  1603.  
  1604. mouseDrag.Parent = GetScreen(listFrame)
  1605. end
  1606.  
  1607. local entryTemplate = Create('ImageButton',{
  1608. Name = "Entry";
  1609. Transparency = 1;
  1610. AutoButtonColor = false;
  1611. Position = UDim2.new(0,0,0,0);
  1612. Size = UDim2.new(1,0,0,ENTRY_SIZE);
  1613. Create('Frame',{
  1614. Name = "IndentFrame";
  1615. BackgroundTransparency = 1;
  1616. BackgroundColor3 = GuiColor.Selected;
  1617. BorderColor3 = GuiColor.BorderSelected;
  1618. Position = UDim2.new(0,0,0,0);
  1619. Size = UDim2.new(1,0,1,0);
  1620. Create(Icon('ImageButton',0),{
  1621. Name = "Expand";
  1622. AutoButtonColor = false;
  1623. Position = UDim2.new(0,-GUI_SIZE,0.5,-GUI_SIZE/2);
  1624. Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
  1625. });
  1626. Create(Icon(nil,0),{
  1627. Name = "ExplorerIcon";
  1628. Position = UDim2.new(0,2+ENTRY_PADDING,0.5,-GUI_SIZE/2);
  1629. Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
  1630. });
  1631. Create('TextLabel',{
  1632. Name = "EntryText";
  1633. BackgroundTransparency = 1;
  1634. TextColor3 = GuiColor.Text;
  1635. TextXAlignment = 'Left';
  1636. TextYAlignment = 'Center';
  1637. Font = FONT;
  1638. FontSize = FONT_SIZE;
  1639. Text = "";
  1640. Position = UDim2.new(0,2+ENTRY_SIZE+4,0,0);
  1641. Size = UDim2.new(1,-2,1,0);
  1642. });
  1643. });
  1644. })
  1645.  
  1646. function scrollBar.UpdateCallback(self)
  1647. for i = 1,self.VisibleSpace do
  1648. local node = TreeList[i + self.ScrollIndex]
  1649. if node then
  1650. local entry = listEntries[i]
  1651. if not entry then
  1652. entry = Create(entryTemplate:Clone(),{
  1653. Position = UDim2.new(0,2,0,ENTRY_BOUND*(i-1)+2);
  1654. Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE);
  1655. ZIndex = listFrame.ZIndex;
  1656. })
  1657. listEntries[i] = entry
  1658.  
  1659. local expand = entry.IndentFrame.Expand
  1660. expand.MouseEnter:connect(function()
  1661. local node = TreeList[i + self.ScrollIndex]
  1662. if #node > 0 then
  1663. if node.Expanded then
  1664. Icon(expand,NODE_EXPANDED_OVER)
  1665. else
  1666. Icon(expand,NODE_COLLAPSED_OVER)
  1667. end
  1668. end
  1669. end)
  1670. expand.MouseLeave:connect(function()
  1671. local node = TreeList[i + self.ScrollIndex]
  1672. if #node > 0 then
  1673. if node.Expanded then
  1674. Icon(expand,NODE_EXPANDED)
  1675. else
  1676. Icon(expand,NODE_COLLAPSED)
  1677. end
  1678. end
  1679. end)
  1680. expand.MouseButton1Down:connect(function()
  1681. local node = TreeList[i + self.ScrollIndex]
  1682. if #node > 0 then
  1683. node.Expanded = not node.Expanded
  1684. -- use raw update so the list updates instantly
  1685. rawUpdateList()
  1686. end
  1687. end)
  1688.  
  1689. entry.MouseButton1Down:connect(function(x,y)
  1690. local node = TreeList[i + self.ScrollIndex]
  1691. if Option.Modifiable then
  1692. local pos = Vector2.new(x,y)
  1693. dragReparent(node.Object,entry:Clone(),pos,entry.AbsolutePosition-pos)
  1694. elseif Option.Selectable then
  1695. if Selection.Selected[node.Object] then
  1696. Selection:Set({})
  1697. else
  1698. Selection:Set({node.Object})
  1699. end
  1700. dragSelect(i+self.ScrollIndex,true,'MouseButton1Up')
  1701. end
  1702. end)
  1703.  
  1704. entry.MouseButton2Down:connect(function()
  1705. if not Option.Selectable then return end
  1706.  
  1707. local node = TreeList[i + self.ScrollIndex]
  1708. if Selection.Selected[node.Object] then
  1709. Selection:Remove(node.Object)
  1710. dragSelect(i+self.ScrollIndex,false,'MouseButton2Up')
  1711. else
  1712. Selection:Add(node.Object)
  1713. dragSelect(i+self.ScrollIndex,true,'MouseButton2Up')
  1714. end
  1715. end)
  1716.  
  1717. entry.Parent = listFrame
  1718. end
  1719.  
  1720. entry.Visible = true
  1721.  
  1722. local object = node.Object
  1723.  
  1724. -- update expand icon
  1725. if #node == 0 then
  1726. entry.IndentFrame.Expand.Visible = false
  1727. elseif node.Expanded then
  1728. Icon(entry.IndentFrame.Expand,NODE_EXPANDED)
  1729. entry.IndentFrame.Expand.Visible = true
  1730. else
  1731. Icon(entry.IndentFrame.Expand,NODE_COLLAPSED)
  1732. entry.IndentFrame.Expand.Visible = true
  1733. end
  1734.  
  1735. -- update explorer icon
  1736. Icon(entry.IndentFrame.ExplorerIcon,ExplorerIndex[object.ClassName] or 0)
  1737.  
  1738. -- update indentation
  1739. local w = (node.Depth)*(2+ENTRY_PADDING+GUI_SIZE)
  1740. entry.IndentFrame.Position = UDim2.new(0,w,0,0)
  1741. entry.IndentFrame.Size = UDim2.new(1,-w,1,0)
  1742.  
  1743. -- update name change detection
  1744. if nameConnLookup[entry] then
  1745. nameConnLookup[entry]:disconnect()
  1746. end
  1747. local text = entry.IndentFrame.EntryText
  1748. text.Text = object.Name
  1749. nameConnLookup[entry] = node.Object.Changed:connect(function(p)
  1750. if p == 'Name' then
  1751. text.Text = object.Name
  1752. end
  1753. end)
  1754.  
  1755. -- update selection
  1756. entry.IndentFrame.Transparency = node.Selected and 0 or 1
  1757. text.TextColor3 = GuiColor[node.Selected and 'TextSelected' or 'Text']
  1758.  
  1759. entry.Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE)
  1760. elseif listEntries[i] then
  1761. listEntries[i].Visible = false
  1762. end
  1763. end
  1764. for i = self.VisibleSpace+1,self.TotalSpace do
  1765. local entry = listEntries[i]
  1766. if entry then
  1767. listEntries[i] = nil
  1768. entry:Destroy()
  1769. end
  1770. end
  1771. end
  1772.  
  1773. function scrollBarH.UpdateCallback(self)
  1774. for i = 1,scrollBar.VisibleSpace do
  1775. local node = TreeList[i + scrollBar.ScrollIndex]
  1776. if node then
  1777. local entry = listEntries[i]
  1778. if entry then
  1779. entry.Position = UDim2.new(0,2 - scrollBarH.ScrollIndex,0,ENTRY_BOUND*(i-1)+2)
  1780. end
  1781. end
  1782. end
  1783. end
  1784.  
  1785. Connect(listFrame.Changed,function(p)
  1786. if p == 'AbsoluteSize' then
  1787. rawUpdateSize()
  1788. end
  1789. end)
  1790.  
  1791. local wheelAmount = 6
  1792. explorerPanel.MouseWheelForward:connect(function()
  1793. if scrollBar.VisibleSpace - 1 > wheelAmount then
  1794. scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount)
  1795. else
  1796. scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace)
  1797. end
  1798. end)
  1799. explorerPanel.MouseWheelBackward:connect(function()
  1800. if scrollBar.VisibleSpace - 1 > wheelAmount then
  1801. scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount)
  1802. else
  1803. scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace)
  1804. end
  1805. end)
  1806. end
  1807.  
  1808. ----------------------------------------------------------------
  1809. ----------------------------------------------------------------
  1810. ----------------------------------------------------------------
  1811. ----------------------------------------------------------------
  1812. ---- Object detection
  1813.  
  1814. -- Inserts `v` into `t` at `i`. Also sets `Index` field in `v`.
  1815. local function insert(t,i,v)
  1816. for n = #t,i,-1 do
  1817. local v = t[n]
  1818. v.Index = n+1
  1819. t[n+1] = v
  1820. end
  1821. v.Index = i
  1822. t[i] = v
  1823. end
  1824.  
  1825. -- Removes `i` from `t`. Also sets `Index` field in removed value.
  1826. local function remove(t,i)
  1827. local v = t[i]
  1828. for n = i+1,#t do
  1829. local v = t[n]
  1830. v.Index = n-1
  1831. t[n-1] = v
  1832. end
  1833. t[#t] = nil
  1834. v.Index = 0
  1835. return v
  1836. end
  1837.  
  1838. -- Returns how deep `o` is in the tree.
  1839. local function depth(o)
  1840. local d = -1
  1841. while o do
  1842. o = o.Parent
  1843. d = d + 1
  1844. end
  1845. return d
  1846. end
  1847.  
  1848.  
  1849. local connLookup = {}
  1850.  
  1851. -- Returns whether a node would be present in the tree list
  1852. local function nodeIsVisible(node)
  1853. local visible = true
  1854. node = node.Parent
  1855. while node and visible do
  1856. visible = visible and node.Expanded
  1857. node = node.Parent
  1858. end
  1859. return visible
  1860. end
  1861.  
  1862. -- Removes an object's tree node. Called when the object stops existing in the
  1863. -- game tree.
  1864. local function removeObject(object)
  1865. local objectNode = NodeLookup[object]
  1866. if not objectNode then
  1867. return
  1868. end
  1869.  
  1870. local visible = nodeIsVisible(objectNode)
  1871.  
  1872. Selection:Remove(object,true)
  1873.  
  1874. local parent = objectNode.Parent
  1875. remove(parent,objectNode.Index)
  1876. NodeLookup[object] = nil
  1877. connLookup[object]:disconnect()
  1878. connLookup[object] = nil
  1879.  
  1880. if visible then
  1881. updateList()
  1882. elseif nodeIsVisible(parent) then
  1883. updateScroll()
  1884. end
  1885. end
  1886.  
  1887. -- Moves a tree node to a new parent. Called when an existing object's parent
  1888. -- changes.
  1889. local function moveObject(object,parent)
  1890. local objectNode = NodeLookup[object]
  1891. if not objectNode then
  1892. return
  1893. end
  1894.  
  1895. local parentNode = NodeLookup[parent]
  1896. if not parentNode then
  1897. return
  1898. end
  1899.  
  1900. local visible = nodeIsVisible(objectNode)
  1901.  
  1902. remove(objectNode.Parent,objectNode.Index)
  1903. objectNode.Parent = parentNode
  1904.  
  1905. objectNode.Depth = depth(object)
  1906. local function r(node,d)
  1907. for i = 1,#node do
  1908. node[i].Depth = d
  1909. r(node[i],d+1)
  1910. end
  1911. end
  1912. r(objectNode,objectNode.Depth+1)
  1913.  
  1914. insert(parentNode,#parentNode+1,objectNode)
  1915.  
  1916. if visible or nodeIsVisible(objectNode) then
  1917. updateList()
  1918. elseif nodeIsVisible(objectNode.Parent) then
  1919. updateScroll()
  1920. end
  1921. end
  1922.  
  1923. -- ScriptContext['/Libraries/LibraryRegistration/LibraryRegistration']
  1924. -- This RobloxLocked object lets me index its properties for some reason
  1925.  
  1926. local function check(object)
  1927. return object.AncestryChanged
  1928. end
  1929.  
  1930. -- Creates a new tree node from an object. Called when an object starts
  1931. -- existing in the game tree.
  1932. local function addObject(object,noupdate)
  1933. if script then
  1934. -- protect against naughty RobloxLocked objects
  1935. local s = pcall(check,object)
  1936. if not s then
  1937. return
  1938. end
  1939. end
  1940.  
  1941. local parentNode = NodeLookup[object.Parent]
  1942. if not parentNode then
  1943. return
  1944. end
  1945.  
  1946. local objectNode = {
  1947. Object = object;
  1948. Parent = parentNode;
  1949. Index = 0;
  1950. Expanded = false;
  1951. Selected = false;
  1952. Depth = depth(object);
  1953. }
  1954.  
  1955. connLookup[object] = Connect(object.AncestryChanged,function(c,p)
  1956. if c == object then
  1957. if p == nil then
  1958. removeObject(c)
  1959. else
  1960. moveObject(c,p)
  1961. end
  1962. end
  1963. end)
  1964.  
  1965. NodeLookup[object] = objectNode
  1966. insert(parentNode,#parentNode+1,objectNode)
  1967.  
  1968. if not noupdate then
  1969. if nodeIsVisible(objectNode) then
  1970. updateList()
  1971. elseif nodeIsVisible(objectNode.Parent) then
  1972. updateScroll()
  1973. end
  1974. end
  1975. end
  1976.  
  1977. do
  1978. NodeLookup[Game] = {
  1979. Object = Game;
  1980. Parent = nil;
  1981. Index = 0;
  1982. Expanded = true;
  1983. }
  1984.  
  1985. Connect(Game.DescendantAdded,addObject)
  1986. Connect(Game.DescendantRemoving,removeObject)
  1987.  
  1988. local function get(o)
  1989. return o:GetChildren()
  1990. end
  1991.  
  1992. local function r(o)
  1993. local s,children = pcall(get,o)
  1994. if s then
  1995. for i = 1,#children do
  1996. addObject(children[i],true)
  1997. r(children[i])
  1998. end
  1999. end
  2000. end
  2001.  
  2002. r(Game)
  2003.  
  2004. scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
  2005. updateList()
  2006. end
  2007.  
  2008. ----------------------------------------------------------------
  2009. ----------------------------------------------------------------
  2010. ----------------------------------------------------------------
  2011. ----------------------------------------------------------------
  2012. ---- Actions
  2013.  
  2014. local actionButtons do
  2015. actionButtons = {}
  2016.  
  2017. local totalActions = (4) + 1
  2018. local currentActions = totalActions
  2019. local function makeButton(icon,over,name)
  2020. local button = Create(Icon('ImageButton',icon),{
  2021. Name = name .. "Button";
  2022. Visible = Option.Modifiable and Option.Selectable;
  2023. Position = UDim2.new(1,-(GUI_SIZE+2)*currentActions+2,0.5,-GUI_SIZE/2);
  2024. Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
  2025. Parent = headerFrame;
  2026. })
  2027.  
  2028. local tipText = Create('TextLabel',{
  2029. Name = name .. "Text";
  2030. Text = name;
  2031. Visible = false;
  2032. BackgroundTransparency = 1;
  2033. TextXAlignment = 'Right';
  2034. Font = FONT;
  2035. FontSize = FONT_SIZE;
  2036. Position = UDim2.new(0,0,0,0);
  2037. Size = UDim2.new(1,-(GUI_SIZE+2)*totalActions,1,0);
  2038. Parent = headerFrame;
  2039. })
  2040.  
  2041.  
  2042. button.MouseEnter:connect(function()
  2043. Icon(button,over)
  2044. tipText.Visible = true
  2045. end)
  2046. button.MouseLeave:connect(function()
  2047. Icon(button,icon)
  2048. tipText.Visible = false
  2049. end)
  2050.  
  2051. currentActions = currentActions - 1
  2052. actionButtons[#actionButtons+1] = button
  2053. return button
  2054. end
  2055.  
  2056. local clipboard = {}
  2057. local function delete(o)
  2058. o.Parent = nil
  2059. end
  2060.  
  2061. -- CUT
  2062. makeButton(ACTION_CUT,ACTION_CUT_OVER,"Cut").MouseButton1Click:connect(function()
  2063. if not Option.Modifiable then return end
  2064. clipboard = {}
  2065. local list = Selection.List
  2066. local cut = {}
  2067. for i = 1,#list do
  2068. local obj = list[i]:Clone()
  2069. if obj then
  2070. table.insert(clipboard,obj)
  2071. table.insert(cut,list[i])
  2072. end
  2073. end
  2074. for i = 1,#cut do
  2075. pcall(delete,cut[i])
  2076. end
  2077. end)
  2078.  
  2079. -- COPY
  2080. makeButton(ACTION_COPY,ACTION_COPY_OVER,"Copy").MouseButton1Click:connect(function()
  2081. if not Option.Modifiable then return end
  2082. clipboard = {}
  2083. local list = Selection.List
  2084. for i = 1,#list do
  2085. table.insert(clipboard,list[i]:Clone())
  2086. end
  2087. end)
  2088.  
  2089. -- PASTE
  2090. makeButton(ACTION_PASTE,ACTION_PASTE_OVER,"Paste").MouseButton1Click:connect(function()
  2091. if not Option.Modifiable then return end
  2092. local parent = Selection.List[1] or Workspace
  2093. for i = 1,#clipboard do
  2094. clipboard[i]:Clone().Parent = parent
  2095. end
  2096. end)
  2097.  
  2098. -- DELETE
  2099. makeButton(ACTION_DELETE,ACTION_DELETE_OVER,"Delete").MouseButton1Click:connect(function()
  2100. if not Option.Modifiable then return end
  2101. local list = Selection:Get()
  2102. for i = 1,#list do
  2103. pcall(delete,list[i])
  2104. end
  2105. Selection:Set({})
  2106. end)
  2107.  
  2108. -- SORT
  2109. -- local actionSort = makeButton(ACTION_SORT,ACTION_SORT_OVER,"Sort")
  2110. end
  2111.  
  2112. ----------------------------------------------------------------
  2113. ----------------------------------------------------------------
  2114. ----------------------------------------------------------------
  2115. ----------------------------------------------------------------
  2116. ---- Option Bindables
  2117.  
  2118. do
  2119. local optionCallback = {
  2120. Modifiable = function(value)
  2121. for i = 1,#actionButtons do
  2122. actionButtons[i].Visible = value and Option.Selectable
  2123. end
  2124. cancelReparentDrag()
  2125. end;
  2126. Selectable = function(value)
  2127. for i = 1,#actionButtons do
  2128. actionButtons[i].Visible = value and Option.Modifiable
  2129. end
  2130. cancelSelectDrag()
  2131. Selection:Set({})
  2132. end;
  2133. }
  2134.  
  2135. local bindSetOption = script.Parent:FindFirstChild("SetOption")
  2136. if not bindSetOption then
  2137. bindSetOption = Create('BindableFunction',{Name = "SetOption"})
  2138. bindSetOption.Parent = script.Parent
  2139. end
  2140.  
  2141. bindSetOption.OnInvoke = function(optionName,value)
  2142. if optionCallback[optionName] then
  2143. Option[optionName] = value
  2144. optionCallback[optionName](value)
  2145. end
  2146. end
  2147.  
  2148. local bindGetOption = script.Parent:FindFirstChild("GetOption")
  2149. if not bindGetOption then
  2150. bindGetOption = Create('BindableFunction',{Name = "GetOption"})
  2151. bindGetOption.Parent = script.Parent
  2152. end
  2153.  
  2154. bindGetOption.OnInvoke = function(optionName)
  2155. if optionName then
  2156. return Option[optionName]
  2157. else
  2158. local options = {}
  2159. for k,v in pairs(Option) do
  2160. options[k] = v
  2161. end
  2162. return options
  2163. end
  2164. end
  2165. end
  2166.  
  2167. end))
  2168. BindableEvent3.Name = "SelectionChanged"
  2169. BindableEvent3.Parent = Frame1
  2170. BindableFunction4.Name = "SetOption"
  2171. BindableFunction4.Parent = Frame1
  2172. BindableFunction5.Name = "SetSelection"
  2173. BindableFunction5.Parent = Frame1
  2174. BindableFunction6.Name = "GetOption"
  2175. BindableFunction6.Parent = Frame1
  2176. BindableFunction7.Name = "GetSelection"
  2177. BindableFunction7.Parent = Frame1
  2178. Frame8.Name = "PropertiesPanel"
  2179. Frame8.Parent = ScreenGui0
  2180. Frame8.Transparency = 0.10000000149012
  2181. Frame8.Size = UDim2.new(0, 300, 0.5, 0)
  2182. Frame8.Position = UDim2.new(1, -308, 0.5, 0)
  2183. Frame8.Active = true
  2184. Frame8.BackgroundColor3 = Color3.new(1, 1, 1)
  2185. Frame8.BackgroundTransparency = 0.10000000149012
  2186. Frame8.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2187. Frame8.Draggable = true
  2188. LocalScript9.Name = "Properties"
  2189. LocalScript9.Parent = Frame8
  2190. table.insert(cors,sandbox(LocalScript9,function()
  2191. wait(1)
  2192.  
  2193. -- I did not try and make this efficient. I tried to make it work. #winning
  2194.  
  2195. local gui = script.Parent.Parent:WaitForChild("ExplorerPanel")
  2196. gui:WaitForChild("List")
  2197. gui:WaitForChild("SelectionChanged")
  2198. print("Gui loaded!")
  2199. local Object = nil
  2200. local prop = script.Parent
  2201.  
  2202. local Properties = {
  2203. "AbsolutePosition", "AbsoluteSize", "AbsoluteAge", "AbsoluteAgeReplicate","Active","Andornee", "AllowAmbientOcclusion","AllowTeamChangeOnTouch","AluminumQuality", "Ambient", "AmbientReverb","Anchored","Angularvelocity","AppearanceDidLoad","Archivable","AreHingesDetected","AttachmentForward","AttachmentPoint","AttachmentPos","AttachmentRight","AttachmentUp","AutoAssignable","AutoButtonColo","AutoColorCharacters","AvaliblePhisicalMemory","Axes",
  2204. "BackgroundColor","Backgroundcolor3","BackgroundTransparency","BaseTextureId","BaseUrl","Bevel","Bevel Roundness","BinType","BlastPressure","BlastRadius","BodyColor","BodyPart","BorderColor","BorderColor3","BorderSizePixel","BrickColor","Brightness","Browsable","BubbleChat","BubbleChatLifetime","BubbleChatMaxBubbles","Bulge","Button1DownConnectionCount","Button1UpConnectionCount","Button2DownConnectionCount","Button2UpConnectionCount",
  2205. "C0","C1","CameraMode","CameraSubject","CameraType","CanBeDropped","CanCollide","CartoonFactor","CastShadows","CelestialBodiesShown","CFrame","Cframe","Character","CharacterApperance","CharacterAutoLoads","ChatMode","ChatScrollLength","ClassicChar","ClearTextOnFocus","ClipsDescendants","CollisionSoundEnabled","CollisionSoundVolume","Color","ColorShift Bottom","ColorShift Top","ConstrainedValue","ControllingHumanoid","ControlMode","ConversationDistance","CordinateFrame","CorrodedMetalQuality","CPU","CpuCount","CpuSpeed","CreatorId","CreatorType","CurrentAngle","CurrentCamera","CycleOffset",
  2206. "D","DataCap","DataComplexity","DataComplexityLimit","DataCost","DataReady","Deprecated","DeselectedConnectionCount","DesiredAngle","Disabled","DiamondPlateQuality","DistanceFactor","DistributedGameTime","DropplerScale","Draggable","DraggingV1","Duration",
  2207. "EditorFont","EditorFontSize","EditorTabWidth","ElapsedTime","Elasticity","Enabled","ExplosionType","ExtentsOffset",
  2208. "F0","F1","F2","F3","Face","FaceId","Faces","FieldOfView","Focus","FogColor","FogEnd","FogStart","Font","FontSize","Force","FormFactor","Friction","From",
  2209. "GearGenreSetting","Genre","GreographicalLatitude","GetCanRedo","GetCanUndo","GfxCard","Graphic","GrassQuality","Grip","GripForward","GripPos","GripRight","GripUp","Guest",
  2210. "HasBuildTools","HeadsUpDisplay","Health","Heat","Hit","Humanoid",
  2211. "IceQuality","Icon","IdleConnectionCount","Image","InitialPrompt","InOut","InUse","InModalDialog","IsPaused","IsPlaying","IsWindows",
  2212. "JobId","Jump",
  2213. "KeyDownConnectionCount","KeyUpConnectionCount",
  2214. "LeftLeg","LeftRight","LinkedSource","LocalPlayer","Location","Locked","LODX","LODY","Looped",
  2215. "Material","MaxActivationDistace","MaxCollisionSounds","MaxExtents","MaxForce","MaxHealth","MaxItems","MaxPlayers","MaxSpeed","MaxThrust","MaxTorque","MaxValue","MaxVelocity","MembershipType","MembershipTypeReplicate","MeshId","MeshType","MinValue","Modal","MouseButton1ClickConnectionCount","MouseButton1DownConnectionCount","MouseButton2ClickConnectionCount","MouseButton2DownConnectionCount","MouseButton2UpConnectionCount","MouseDelta","MouseDragConnectionCount","MouseEnterConnectionCount","MouseHit","MouseLeaveConnectionCount","MouseLock","MouseTarget","MouseTargetFilter","MouseTargetSurface","MoveConnectionCount","MoveState","MultiLine",
  2216. "Name","NameOcclusion","NetworkOwner","Nutral","NumPlayers",
  2217. "Offset","Opacity","Origin","OsPlatform","OsVer","OverlayTextureId",
  2218. "P","PantsTemplate","ParamA","ParamB","Part0","Part1","PersonalServerRank","Pitch","PixelShaderModel","PlaceId","PlasticQuality","PlatformStand","PlayCount","PlaterToHideFrom","PlayOnRemove","Point","Port","Position","Preliminary","PrimaryPart","PrivateWorkingSetBytes","Purpose",
  2219. "RAM","RBX.lua.BevelMesh","RBX.lua.BlockMesh","RBX.lua.ChangingHistoryService","RBX.lua.ContentProvider","RBX.lua.CylinderMesh","RBX.lua.DataModelMesh","RBX.lua.DoubleConstrainedValue","RBX.lua.FileMesh","RBX.lua.Game Options","RBX.lua.GameSettings","RBX.lua.HopperBin","RBX.lua.Humanoid","RBX.lua.IntConstrainedValue","RBX.lua.PlayerMouse","RBX.lua.ReflectionMetadataClass","RBX.lua.ReflectorMetadataItem","RBX.lua.ReflectionMetadataMember","RBX.lua.RenderSettings","RBX.lua.ShirtGraphic","RBX.lua.Sound","RBX.lua.SoundService","RBX.lua.SpecialMesh","RBX.lua.StockSound","RBX.lua.TextBox",
  2220. "Reflectance","ReplicatedSelectedConnectionCount","ResizeableFaces","ResizeIncrement","Resolution","ResponceDialog","RightLeg","RiseVelocity","RobloxLocked","RobloxVersion","RolloffScale","RotVelocity",
  2221. "Scale","Score","ScriptsDisabled","SecondaryColor","Selected","SetRoll","ShadowColor","Shape","Shiny","ShirtTemplate","ShowDeprecatedObjects","ShowDevelopmentGui","ShowLegacyPlayerList","ShowPreliminaryObjects","Sides","Sit","Size","SizeConstraint","SizeOffset","SkinColor","SkyboxBk","SkyboxDn","SkyboxFt","SkyboxLf","SkyboxRt","SkyboxUp","SlateQuality","SoundId","Source","SparkleColor","SpecificGravity","Specular","StarCount","Steer","StickWheels","StudsBetweenTextures","StudsOffset","StudsPerTileU","StudsPerTileV","Stlye","Summary","SuperSafeChatReplicate","Surface","Surface0","Surface1","SurfaceInput",
  2222. "TextButton","TextLabel","TouchTransmitter","Target","TargetFilter","TargetOffset","TargetPoint","TargetRadius","TargetSurface","TeamColor","Terrain","Text","TextBounds","TextColor","TextColor3","TextFits","TextScaled","TextStrokeColor3","TextStrokeTransparency","TextTransparency","Texture","TextureId","TextureSize","TextWrap","TextWrapped","TextXAlignment","TextYAlignment","Throttle","ThrustD","ThrustP","Ticket","Time","TimeOfDay","To","Tone","ToolTip","TopButtom","Torque","Torso","Transparency","TrussDetail","TurnD","TurnP","TurnSpeed",
  2223. "UnitRay","UseLuaChat","UserDialog","UserId","userId","UserGameSettings",
  2224. "Value","Version","VertexColor","VideoCaptureEnabled","VideoMemory","VideoQuality","ViewSizeX","ViewSizeY","Visible","Volume",
  2225. "WalkDirection","WalkSpeed","WalkToPart","WalkToPoint","WheelBackwardConnectionCount","WheelForwardConnectionCount","WindowSize","WireRadius","WoodQuality",
  2226. "X",
  2227. "Y",
  2228. "ZIndex",
  2229. "BackSurface","BottomSurface","FrontSurface","LeftSurface","RightSurface","TopSurface",
  2230. "ClassName",
  2231. "Parent",
  2232. }
  2233. local LockedProperties = { -- cant be edited
  2234. ClassName=1,
  2235. Parent=1,
  2236. userId=1,
  2237. }
  2238. local LockedItems = { -- cant be edited
  2239. ["Workspace.Studio"]=1,
  2240. ["Workspace.Terrain"]=1,
  2241. ["Workspace.Camera"]=1,
  2242. ["Workspace"]=1,
  2243. ["Players"]=1,
  2244. ["Lighting.Sky"]=1,
  2245. }
  2246. local SpecEnums = {-- i plan on doing stuffs with this later
  2247. BackSurface="SurfaceType",
  2248. BottomSurface="SurfaceType",
  2249. FrontSurface="SurfaceType",
  2250. LeftSurface="SurfaceType",
  2251. RightSurface="SurfaceType",
  2252. TopSurface="SurfaceType",
  2253. }
  2254.  
  2255. function GetProperties(obj)
  2256. assert(pcall(function() assert(game.IsA(obj,"Instance")) end),"Should be ROBLOX instance")
  2257. local objProper = {}
  2258. for i,v in pairs(Properties) do
  2259. if pcall(function() return obj[v] end) and (type(obj[v]) ~= "userdata" or not obj:FindFirstChild(v)) then
  2260. objProper[v] = obj[v]
  2261. end
  2262. end
  2263. return objProper
  2264. end
  2265.  
  2266. local Player = game:service"Players".LocalPlayer
  2267. local Mouse = Player:GetMouse()
  2268. Mouse.KeyDown:connect(function(k)
  2269. if string.byte(k) == 29 then
  2270. prop.Visible = not prop.Visible
  2271. gui.Visible = prop.Visible
  2272. end
  2273. end)
  2274. local sf = prop.ScrollFrame
  2275. local oldScroll = 0
  2276. sf.ScrollBar.ScrollThumb.Changed:connect(function()
  2277. sf.ScrollBar.ScrollThumb.Position = UDim2.new(0,0,0,sf.ScrollBar.ScrollThumb.Position.Y.Offset)
  2278. if sf.ScrollBar.ScrollThumb.Position.Y.Offset < 0 then
  2279. sf.ScrollBar.ScrollThumb.Position = UDim2.new(0,0,0,0)
  2280. elseif sf.ScrollBar.ScrollThumb.Position.Y.Offset > 211 then
  2281. sf.ScrollBar.ScrollThumb.Position = UDim2.new(0,0,0,211)
  2282. end
  2283.  
  2284. if sf.ScrollBar.ScrollThumb.Position.Y.Offset == 0 then
  2285. for _,v in pairs(sf.ScrollUp["Arrow Graphic"]:GetChildren())do
  2286. v.BackgroundTransparency = .7
  2287. end
  2288. else
  2289. for _,v in pairs(sf.ScrollUp["Arrow Graphic"]:GetChildren())do
  2290. v.BackgroundTransparency = 0
  2291. end
  2292. end
  2293.  
  2294. if sf.ScrollBar.ScrollThumb.Position.Y.Offset == 211 then
  2295. for _,v in pairs(sf.ScrollDown["Arrow Graphic"]:GetChildren())do
  2296. v.BackgroundTransparency = .7
  2297. end
  2298. else
  2299. for _,v in pairs(sf.ScrollDown["Arrow Graphic"]:GetChildren())do
  2300. v.BackgroundTransparency = 0
  2301. end
  2302. end
  2303.  
  2304. -- move the stuffs.
  2305.  
  2306. for _,v in pairs(prop.List:GetChildren())do
  2307. v.Position = UDim2.new(0,0,0,(v.P.Value-(sf.ScrollBar.ScrollThumb.Position.Y.Offset*1.75)))
  2308. end
  2309.  
  2310. end)
  2311. local Down = false
  2312. local Up = false
  2313.  
  2314. sf.ScrollDown.MouseButton1Down:connect(function()
  2315. Up = false
  2316. Down = true
  2317. end)
  2318.  
  2319. sf.ScrollDown.MouseButton1Up:connect(function()
  2320. Up = false
  2321. Down = false
  2322. end)
  2323.  
  2324. sf.ScrollDown.MouseLeave:connect(function()
  2325. Up = false
  2326. Down = false
  2327. end)
  2328.  
  2329. sf.ScrollUp.MouseButton1Down:connect(function()
  2330. Up = true
  2331. Down = false
  2332. end)
  2333.  
  2334. sf.ScrollUp.MouseButton1Up:connect(function()
  2335. Up = false
  2336. Down = false
  2337. end)
  2338.  
  2339. sf.ScrollUp.MouseLeave:connect(function()
  2340. Up = false
  2341. Down = false
  2342. end)
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348. local dc = {}
  2349. gui.SelectionChanged.Event:connect(function()
  2350. Object = gui.GetSelection:Invoke()[1]
  2351. oldScroll = 0
  2352. sf.ScrollBar.ScrollThumb.Position = UDim2.new(0,0,0,0)
  2353. for _,v in pairs(dc) do
  2354. v:disconnect()
  2355. end
  2356. dc = {}
  2357. for _,v in pairs(prop.List:GetChildren())do
  2358. v:Destroy()
  2359. end
  2360. if Object then
  2361. local BGC1 = Color3.new(221/255, 221/255, 222/255)
  2362. local BGC2 = Color3.new(239/255,239/255,240/255)
  2363. local showbg1 = true
  2364. local Props = GetProperties(Object)
  2365. if Props then
  2366. if type(Props) == "table" then
  2367. for property,value in pairs(Props) do
  2368. if type(value) == "string" or type(value) == "number" or type(value) == "userdata" or type(value) == "boolean" then
  2369. local CurPropGui = script.Parent.property:Clone()
  2370. CurPropGui.Parent = prop.List
  2371.  
  2372. if showbg1 then
  2373. CurPropGui.BackgroundColor3 = BGC1
  2374. else
  2375. CurPropGui.BackgroundColor3 = BGC2
  2376. end
  2377.  
  2378. showbg1 = not showbg1
  2379.  
  2380. CurPropGui.Position = UDim2.new(0,0,0,1+(22*(#prop.List:GetChildren()-1)))
  2381.  
  2382. local p = Instance.new("NumberValue",CurPropGui)
  2383. p.Name = "P"
  2384. p.Value = CurPropGui.Position.Y.Offset
  2385.  
  2386. CurPropGui.name.locked.Text = property
  2387. CurPropGui.name.unlocked.Text = property
  2388.  
  2389. CurPropGui.Visible = true
  2390.  
  2391. local locked = LockedProperties[property]
  2392.  
  2393. if LockedItems[Object:GetFullName()] then
  2394. locked = true
  2395. end
  2396.  
  2397. if locked then
  2398. CurPropGui.name.locked.Visible = true
  2399. else
  2400. CurPropGui.name.unlocked.Visible = true
  2401. end
  2402.  
  2403. local ValType = "string"
  2404. local oldvalue = value
  2405.  
  2406. if type(value) == "userdata" then
  2407. if pcall(function()
  2408. local swag = value.X
  2409. swag = value.Y
  2410. swag = value.Z
  2411. end) then -- Vector3
  2412. ValType = "Vector3"
  2413. local ValueEdit = CurPropGui.edit.box
  2414. if locked then ValueEdit = CurPropGui.edit.locked end
  2415. ValueEdit.Visible = true
  2416. if not locked then
  2417. dc[#dc+1]=ValueEdit.FocusLost:connect(function()
  2418. if not pcall(function()
  2419. local Vals = {}
  2420. local newval = ValueEdit.Text:gsub(" ","")
  2421. for match in newval:gmatch("[^,]+") do
  2422. table.insert(Vals,tonumber(match))
  2423. end
  2424. if #Vals == 3 then
  2425. if Vals[1] and Vals[2] and Vals[3] then
  2426. local vector = Vector3.new(Vals[1],Vals[2],Vals[3])
  2427. Object[property] = vector
  2428. oldvalue = vector
  2429. ValueEdit.Text = value.X..", "..value.Y..", "..value.Z
  2430. else sddfs = vector.erewrsthf.hdfhdfshdf
  2431. end
  2432. else sddfs = vector.erewrsthf.hdfhdfshdf
  2433. end
  2434. end) then
  2435. pcall(function()
  2436. ValueEdit.Text = oldvalue.X..", "..oldvalue.Y..", "..oldvalue.Z
  2437. end)
  2438. end
  2439. end)
  2440. end
  2441. pcall(function()
  2442. ValueEdit.Text = value.X..", "..value.Y..", "..value.Z
  2443. end)
  2444. elseif pcall(function()
  2445. local swag = value.X.Scale
  2446. swag = value.X.Offset
  2447. end) then -- UDim2
  2448. ValType = "UDim2"
  2449. local ValueEdit = CurPropGui.edit.box
  2450. if locked then ValueEdit = CurPropGui.edit.locked end
  2451. ValueEdit.Visible = true
  2452. if not locked then
  2453. dc[#dc+1]=ValueEdit.FocusLost:connect(function()
  2454. if not pcall(function()
  2455. local Vals = {}
  2456. local newval = ValueEdit.Text:gsub(" ",""):gsub("{",""):gsub("}","")
  2457. for match in newval:gmatch("[^,]+") do
  2458. table.insert(Vals,tonumber(match))
  2459. end
  2460. if #Vals == 4 then
  2461. if Vals[1] and Vals[2] and Vals[3] and Vals[4] then
  2462. local vector = UDim2.new(Vals[1],Vals[2],Vals[3],Vals[4])
  2463. Object[property] = vector
  2464. oldvalue = vector
  2465. ValueEdit.Text = "{"..vector.X.Scale..", "..vector.X.Offset.."}, {"..vector.Y.Scale..", "..vector.Y.Offset.."}"
  2466. else sddfs = vector.erewrsthf.hdfhdfshdf
  2467. end
  2468. else sddfs = vector.erewrsthf.hdfhdfshdf
  2469. end
  2470. end) then
  2471. pcall(function()
  2472. ValueEdit.Text = "{"..oldvalue.X.Scale..", "..oldvalue.X.Offset.."}, {"..oldvalue.Y.Scale..", "..oldvalue.Y.Offset.."}"
  2473. end)
  2474. end
  2475. end)
  2476. end
  2477. pcall(function()
  2478. ValueEdit.Text = "{"..value.X.Scale..", "..value.X.Offset.."}, {"..value.Y.Scale..", "..value.Y.Offset.."}"
  2479. end)
  2480. elseif pcall(function()
  2481. local swag = value.p
  2482. swag = value.p.X
  2483. swag = value.p.Y
  2484. swag = value.p.Z
  2485. end) then -- CFrame
  2486. ValType = "CFrame"
  2487. local ValueEdit = CurPropGui.edit.box
  2488. if locked then ValueEdit = CurPropGui.edit.locked end
  2489. ValueEdit.Visible = true
  2490. if not locked then
  2491. dc[#dc+1]=ValueEdit.FocusLost:connect(function()
  2492. if not pcall(function()
  2493. local Vals = {}
  2494. local newval = ValueEdit.Text:gsub(" ","")
  2495. for match in newval:gmatch("[^,]+") do
  2496. table.insert(Vals,tonumber(match))
  2497. end
  2498. if #Vals == 3 then
  2499. if Vals[1] and Vals[2] and Vals[3] then
  2500. local vector = UDim2.new(Vals[1],Vals[2],Vals[3])
  2501. Object[property] = vector
  2502. oldvalue = vector
  2503. ValueEdit.Text = vector.p.X..", "..vector.p.Y..", "..vector.p.Z
  2504. else sddfs = vector.erewrsthf.hdfhdfshdf
  2505. end
  2506. else sddfs = vector.erewrsthf.hdfhdfshdf
  2507. end
  2508. end) then
  2509. pcall(function()
  2510. ValueEdit.Text = oldvalue.p.X..", "..oldvalue.p.Y..", "..oldvalue.p.Z
  2511. end)
  2512. end
  2513. end)
  2514. end
  2515. pcall(function()
  2516. ValueEdit.Text = value.p.X..", "..value.p.Y..", "..value.p.Z
  2517. end)
  2518. elseif pcall(function()
  2519. local swag = value:IsA("")
  2520. end) then -- Object
  2521. ValType = "Object"
  2522. local ValueEdit = CurPropGui.edit.locked
  2523. ValueEdit.Visible = true
  2524. pcall(function()
  2525. ValueEdit.Text = value.Name
  2526. end)
  2527. elseif pcall(function()
  2528. local swag = value.Color
  2529. swag = value.Color.r
  2530. swag = value.Color.g
  2531. swag = value.Color.b
  2532. end) then -- BrickColor
  2533. ValType = "BrickColor"
  2534. local ValueEdit = CurPropGui.edit.box
  2535. if locked then ValueEdit = CurPropGui.edit.locked end
  2536. ValueEdit.Visible = true
  2537. if not locked then
  2538. dc[#dc+1]=ValueEdit.FocusLost:connect(function()
  2539. if not pcall(function()
  2540. local Vals = {}
  2541. local newval = ValueEdit.Text:gsub(" ","")
  2542. for match in newval:gmatch("[^,]+") do
  2543. table.insert(Vals,tonumber(match))
  2544. end
  2545. if #Vals <= 1 then
  2546. local vector = BrickColor.new(ValueEdit.Text)
  2547. Object[property] = vector
  2548. oldvalue = tostring(vector)
  2549. ValueEdit.Text = tostring(vector)
  2550. elseif #Vals == 3 then
  2551. if Vals[1] and Vals[2] and Vals[3] then
  2552. local vector = BrickColor.new(Color3.new(Vals[1]/255,Vals[2]/255,Vals[3]/255))
  2553. Object[property] = vector
  2554. oldvalue = tostring(vector)
  2555. ValueEdit.Text = tostring(vector)
  2556. else sddfs = vector.erewrsthf.hdfhdfshdf
  2557. end
  2558. else sddfs = vector.erewrsthf.hdfhdfshdf
  2559. end
  2560. end) then
  2561. pcall(function()
  2562. ValueEdit.Text = tostring(oldvalue)
  2563. end)
  2564. end
  2565. end)
  2566. end
  2567. pcall(function()
  2568. ValueEdit.Text = tostring(value)
  2569. end)
  2570. elseif pcall(function()
  2571. local swag = value.r
  2572. swag = value.g
  2573. swag = value.b
  2574. end) then -- Color3
  2575. ValType = "Color3"
  2576. local ValueEdit = CurPropGui.edit.box
  2577. if locked then ValueEdit = CurPropGui.edit.locked end
  2578. ValueEdit.Visible = true
  2579. if not locked then
  2580. dc[#dc+1]=ValueEdit.FocusLost:connect(function()
  2581. if not pcall(function()
  2582. local Vals = {}
  2583. local newval = ValueEdit.Text:gsub(" ","")
  2584. for match in newval:gmatch("[^,]+") do
  2585. table.insert(Vals,tonumber(match))
  2586. end
  2587. if #Vals == 3 then
  2588. if Vals[1] and Vals[2] and Vals[3] then
  2589. local vector = Color3.new(Vals[1],Vals[2],Vals[3])
  2590. Object[property] = vector
  2591. oldvalue = vector
  2592. ValueEdit.Text = vector.r..", "..vector.g..", "..vector.b
  2593. else sddfs = vector.erewrsthf.hdfhdfshdf
  2594. end
  2595. else sddfs = vector.erewrsthf.hdfhdfshdf
  2596. end
  2597. end) then
  2598. pcall(function()
  2599. ValueEdit.Text = oldvalue.r*255 ..", "..oldvalue.g*255 ..", "..oldvalue.b*255
  2600. end)
  2601. end
  2602. end)
  2603. end
  2604. pcall(function()
  2605. ValueEdit.Text = value.r*255 ..", "..value.g*255 ..", "..value.b*255
  2606. end)
  2607. elseif pcall(function()
  2608. local swag = Enum[property]
  2609. end) then -- Enum
  2610. ValType = "Enum"
  2611. local ValueEdit = CurPropGui.edit.box
  2612. if locked then ValueEdit = CurPropGui.edit.locked end
  2613. ValueEdit.Visible = true
  2614. if not locked then
  2615. dc[#dc+1]=ValueEdit.FocusLost:connect(function()
  2616. if not pcall(function()
  2617. local vector = Enum[property][ValueEdit.Text]
  2618. if not vector then local err = vector.rergh.rfhdf.fdhdfs end
  2619. Object[property] = vector
  2620. oldvalue = vector
  2621. ValueEdit.Text = tostring(vector):sub(#Enum[property]+7)
  2622. end) then
  2623. pcall(function()
  2624. ValueEdit.Text = tostring(oldvalue):sub(#Enum[property]+7)
  2625. end)
  2626. end
  2627. end)
  2628. end
  2629. pcall(function()
  2630. ValueEdit.Text = tostring(value):sub(#Enum[property]+7)
  2631. end)
  2632. elseif pcall(function()
  2633. local swag = Enum[SpecEnums[property]]
  2634. end) then -- Enum
  2635. ValType = "Enum"
  2636. local ValueEdit = CurPropGui.edit.box
  2637. if locked then ValueEdit = CurPropGui.edit.locked end
  2638. ValueEdit.Visible = true
  2639. if not locked then
  2640. dc[#dc+1]=ValueEdit.FocusLost:connect(function()
  2641. if not pcall(function()
  2642. local vector = Enum[SpecEnums[property]][ValueEdit.Text]
  2643. if not vector then local err = vector.rergh.rfhdf.fdhdfs end
  2644. Object[property] = vector
  2645. oldvalue = vector
  2646. ValueEdit.Text = tostring(vector):sub(#Enum[SpecEnums[property]]+7)
  2647. end) then
  2648. pcall(function()
  2649. ValueEdit.Text = tostring(oldvalue):sub(#Enum[SpecEnums[property]]+7)
  2650. end)
  2651. end
  2652. end)
  2653. end
  2654. pcall(function()
  2655. ValueEdit.Text = tostring(value):sub(#Enum[SpecEnums[property]]+7)
  2656. end)
  2657. end
  2658. elseif type(value) == "string" then
  2659. local ValueEdit = CurPropGui.edit.box
  2660. if locked then ValueEdit = CurPropGui.edit.locked end
  2661. ValueEdit.Visible = true
  2662. if not locked then
  2663. dc[#dc+1]=ValueEdit.FocusLost:connect(function()
  2664. if not pcall(function()
  2665. Object[property] = ValueEdit.Text
  2666. end) then
  2667. pcall(function()
  2668. ValueEdit.Text = tostring(oldvalue)
  2669. oldvalue = ValueEdit.Text
  2670. end)
  2671. end
  2672. end)
  2673. end
  2674. ValueEdit.Text = tostring(value)
  2675. elseif type(value) == "number" then
  2676. local ValueEdit = CurPropGui.edit.box
  2677. if locked then ValueEdit = CurPropGui.edit.locked end
  2678. ValueEdit.Visible = true
  2679. if not locked then
  2680. dc[#dc+1]=ValueEdit.FocusLost:connect(function()
  2681. if not pcall(function()
  2682. Object[property] = tonumber(ValueEdit.Text)
  2683. oldvalue = ValueEdit.Text
  2684. end) then
  2685. pcall(function()
  2686. ValueEdit.Text = tostring(oldvalue)
  2687. end)
  2688. end
  2689. end)
  2690. end
  2691. ValueEdit.Text = tostring(value)
  2692. elseif type(value) == "boolean" then
  2693. local ValueEdit = CurPropGui.edit.check
  2694. ValueEdit.Visible = true
  2695. local img_checked = "http://www.roblox.com/asset/?id=48138491"
  2696. local img_unchecked = "http://www.roblox.com/asset/?id=48138474"
  2697. if value then
  2698. ValueEdit.Image = img_checked
  2699. else
  2700. ValueEdit.Image = img_unchecked
  2701. end
  2702. dc[#dc+1]=Object.Changed:connect(function()
  2703. if Object[property] then
  2704. ValueEdit.Image = img_checked
  2705. else
  2706. ValueEdit.Image = img_unchecked
  2707. end
  2708. end)
  2709. if not locked then
  2710. dc[#dc+1]=ValueEdit.MouseButton1Click:connect(function()
  2711. Object[property] = not Object[property]
  2712. if Object[property] then
  2713. ValueEdit.Image = img_checked
  2714. else
  2715. ValueEdit.Image = img_unchecked
  2716. end
  2717. end)
  2718. end
  2719. end
  2720. end
  2721. end
  2722. end
  2723. end
  2724. end
  2725. end)
  2726.  
  2727. while wait(.0075) do -- umad?
  2728. if Down then
  2729. sf.ScrollBar.ScrollThumb.Position = UDim2.new(0,0,0,sf.ScrollBar.ScrollThumb.Position.Y.Offset+3)
  2730. elseif Up then
  2731. sf.ScrollBar.ScrollThumb.Position = UDim2.new(0,0,0,sf.ScrollBar.ScrollThumb.Position.Y.Offset-3)
  2732. end
  2733. end
  2734.  
  2735. end))
  2736. Frame10.Name = "Header"
  2737. Frame10.Parent = Frame8
  2738. Frame10.Size = UDim2.new(1, 0, 0, 18)
  2739. Frame10.BackgroundColor3 = Color3.new(0.913726, 0.913726, 0.913726)
  2740. Frame10.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2741. TextLabel11.Parent = Frame10
  2742. TextLabel11.Transparency = 1
  2743. TextLabel11.Size = UDim2.new(1, -4, 1, 0)
  2744. TextLabel11.Text = "Properties"
  2745. TextLabel11.Position = UDim2.new(0, 4, 0, 0)
  2746. TextLabel11.BackgroundTransparency = 1
  2747. TextLabel11.Font = Enum.Font.SourceSans
  2748. TextLabel11.FontSize = Enum.FontSize.Size14
  2749. TextLabel11.TextColor3 = Color3.new(0, 0, 0)
  2750. TextLabel11.TextXAlignment = Enum.TextXAlignment.Left
  2751. Frame12.Name = "List"
  2752. Frame12.Parent = Frame8
  2753. Frame12.Transparency = 1
  2754. Frame12.Size = UDim2.new(1, -16, 1, -18)
  2755. Frame12.Position = UDim2.new(0, 0, 0, 18)
  2756. Frame12.BackgroundTransparency = 1
  2757. Frame12.ClipsDescendants = true
  2758. TextLabel13.Name = "TextWidth"
  2759. TextLabel13.Parent = Frame8
  2760. TextLabel13.Size = UDim2.new(1, 0, 1, 0)
  2761. TextLabel13.Text = "TweenService"
  2762. TextLabel13.Visible = false
  2763. TextLabel13.Font = Enum.Font.SourceSans
  2764. TextLabel13.FontSize = Enum.FontSize.Size14
  2765. TextLabel13.TextXAlignment = Enum.TextXAlignment.Left
  2766. Frame14.Name = "ScrollFrame"
  2767. Frame14.Parent = Frame8
  2768. Frame14.Transparency = 1
  2769. Frame14.Size = UDim2.new(0, 16, 1, -18)
  2770. Frame14.Position = UDim2.new(1, -16, 0, 18)
  2771. Frame14.BackgroundTransparency = 1
  2772. ImageButton15.Name = "ScrollDown"
  2773. ImageButton15.Parent = Frame14
  2774. ImageButton15.Size = UDim2.new(0, 16, 0, 16)
  2775. ImageButton15.Position = UDim2.new(0, 0, 1, -16)
  2776. ImageButton15.BackgroundColor3 = Color3.new(0.866667, 0.866667, 0.866667)
  2777. ImageButton15.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2778. Frame16.Name = "Arrow Graphic"
  2779. Frame16.Parent = ImageButton15
  2780. Frame16.Transparency = 1
  2781. Frame16.Size = UDim2.new(0, 8, 0, 8)
  2782. Frame16.Position = UDim2.new(0.5, -4, 0.5, -4)
  2783. Frame16.BackgroundTransparency = 1
  2784. Frame16.BorderSizePixel = 0
  2785. Frame17.Name = "Graphic"
  2786. Frame17.Parent = Frame16
  2787. Frame17.Size = UDim2.new(0.25, 0, 0.125, 0)
  2788. Frame17.Position = UDim2.new(0.375, 0, 0.625, 0)
  2789. Frame17.BackgroundColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2790. Frame17.BorderSizePixel = 0
  2791. Frame18.Name = "Graphic"
  2792. Frame18.Parent = Frame16
  2793. Frame18.Size = UDim2.new(0.5, 0, 0.125, 0)
  2794. Frame18.Position = UDim2.new(0.25, 0, 0.5, 0)
  2795. Frame18.BackgroundColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2796. Frame18.BorderSizePixel = 0
  2797. Frame19.Name = "Graphic"
  2798. Frame19.Parent = Frame16
  2799. Frame19.Size = UDim2.new(0.75, 0, 0.125, 0)
  2800. Frame19.Position = UDim2.new(0.125, 0, 0.375, 0)
  2801. Frame19.BackgroundColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2802. Frame19.BorderSizePixel = 0
  2803. Frame20.Name = "Graphic"
  2804. Frame20.Parent = Frame16
  2805. Frame20.Size = UDim2.new(1, 0, 0.125, 0)
  2806. Frame20.Position = UDim2.new(0, 0, 0.25, 0)
  2807. Frame20.BackgroundColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2808. Frame20.BorderSizePixel = 0
  2809. ImageButton21.Name = "ScrollUp"
  2810. ImageButton21.Parent = Frame14
  2811. ImageButton21.Size = UDim2.new(0, 16, 0, 16)
  2812. ImageButton21.Active = false
  2813. ImageButton21.BackgroundColor3 = Color3.new(0.866667, 0.866667, 0.866667)
  2814. ImageButton21.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2815. ImageButton21.AutoButtonColor = false
  2816. Frame22.Name = "Arrow Graphic"
  2817. Frame22.Parent = ImageButton21
  2818. Frame22.Transparency = 1
  2819. Frame22.Size = UDim2.new(0, 8, 0, 8)
  2820. Frame22.Position = UDim2.new(0.5, -4, 0.5, -4)
  2821. Frame22.BackgroundTransparency = 1
  2822. Frame22.BorderSizePixel = 0
  2823. Frame23.Name = "Graphic"
  2824. Frame23.Parent = Frame22
  2825. Frame23.Transparency = 0.69999998807907
  2826. Frame23.Size = UDim2.new(0.25, 0, 0.125, 0)
  2827. Frame23.Position = UDim2.new(0.375, 0, 0.25, 0)
  2828. Frame23.BackgroundColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2829. Frame23.BackgroundTransparency = 0.69999998807907
  2830. Frame23.BorderSizePixel = 0
  2831. Frame24.Name = "Graphic"
  2832. Frame24.Parent = Frame22
  2833. Frame24.Transparency = 0.69999998807907
  2834. Frame24.Size = UDim2.new(0.5, 0, 0.125, 0)
  2835. Frame24.Position = UDim2.new(0.25, 0, 0.375, 0)
  2836. Frame24.BackgroundColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2837. Frame24.BackgroundTransparency = 0.69999998807907
  2838. Frame24.BorderSizePixel = 0
  2839. Frame25.Name = "Graphic"
  2840. Frame25.Parent = Frame22
  2841. Frame25.Transparency = 0.69999998807907
  2842. Frame25.Size = UDim2.new(0.75, 0, 0.125, 0)
  2843. Frame25.Position = UDim2.new(0.125, 0, 0.5, 0)
  2844. Frame25.BackgroundColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2845. Frame25.BackgroundTransparency = 0.69999998807907
  2846. Frame25.BorderSizePixel = 0
  2847. Frame26.Name = "Graphic"
  2848. Frame26.Parent = Frame22
  2849. Frame26.Transparency = 0.69999998807907
  2850. Frame26.Size = UDim2.new(1, 0, 0.125, 0)
  2851. Frame26.Position = UDim2.new(0, 0, 0.625, 0)
  2852. Frame26.BackgroundColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2853. Frame26.BackgroundTransparency = 0.69999998807907
  2854. Frame26.BorderSizePixel = 0
  2855. ImageButton27.Name = "ScrollBar"
  2856. ImageButton27.Parent = Frame14
  2857. ImageButton27.Size = UDim2.new(1, 0, 1, -32)
  2858. ImageButton27.Position = UDim2.new(0, 0, 0, 16)
  2859. ImageButton27.BackgroundColor3 = Color3.new(0.94902, 0.94902, 0.94902)
  2860. ImageButton27.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2861. ImageButton27.AutoButtonColor = false
  2862. ImageButton28.Name = "ScrollThumb"
  2863. ImageButton28.Parent = ImageButton27
  2864. ImageButton28.Size = UDim2.new(0, 16, 0.283333331, 0)
  2865. ImageButton28.BackgroundColor3 = Color3.new(0.866667, 0.866667, 0.866667)
  2866. ImageButton28.BorderColor3 = Color3.new(0.584314, 0.584314, 0.584314)
  2867. ImageButton28.Draggable = true
  2868. ImageButton28.AutoButtonColor = false
  2869. Frame29.Name = "Grip Graphic"
  2870. Frame29.Parent = ImageButton28
  2871. Frame29.Transparency = 1
  2872. Frame29.Size = UDim2.new(0, 6, 0, 6)
  2873. Frame29.Position = UDim2.new(0.5, -3, 0.5, -3)
  2874. Frame29.BackgroundTransparency = 1
  2875. Frame29.BorderSizePixel = 0
  2876. Frame30.Parent = Frame29
  2877. Frame30.Size = UDim2.new(1, 0, 0.166666672, 0)
  2878. Frame30.BorderSizePixel = 0
  2879. Frame31.Parent = Frame29
  2880. Frame31.Size = UDim2.new(1, 0, 0.166666672, 0)
  2881. Frame31.Position = UDim2.new(0, 0, 0.333333343, 0)
  2882. Frame31.BorderSizePixel = 0
  2883. Frame32.Parent = Frame29
  2884. Frame32.Size = UDim2.new(1, 0, 0.166666672, 0)
  2885. Frame32.Position = UDim2.new(0, 0, 0.666666687, 0)
  2886. Frame32.BorderSizePixel = 0
  2887. Frame33.Name = "property"
  2888. Frame33.Parent = Frame8
  2889. Frame33.Size = UDim2.new(1, 0, 0, 22)
  2890. Frame33.Position = UDim2.new(0, 0, 0, 1)
  2891. Frame33.Visible = false
  2892. Frame33.BackgroundColor3 = Color3.new(0.866667, 0.866667, 0.870588)
  2893. Frame33.BorderColor3 = Color3.new(0.686275, 0.686275, 0.686275)
  2894. Frame34.Name = "name"
  2895. Frame34.Parent = Frame33
  2896. Frame34.Transparency = 1
  2897. Frame34.Size = UDim2.new(0.5, 0, 1, -1)
  2898. Frame34.BackgroundColor3 = Color3.new(0.992157, 0.984314, 1)
  2899. Frame34.BackgroundTransparency = 1
  2900. TextLabel35.Name = "unlocked"
  2901. TextLabel35.Parent = Frame34
  2902. TextLabel35.Transparency = 1
  2903. TextLabel35.Size = UDim2.new(1, -10, 1, 0)
  2904. TextLabel35.Text = ""
  2905. TextLabel35.Position = UDim2.new(0, 5, 0, 0)
  2906. TextLabel35.Visible = false
  2907. TextLabel35.BackgroundTransparency = 1
  2908. TextLabel35.Font = Enum.Font.SourceSans
  2909. TextLabel35.FontSize = Enum.FontSize.Size14
  2910. TextLabel35.TextColor3 = Color3.new(0.0980392, 0.0980392, 0.0980392)
  2911. TextLabel35.TextWrapped = true
  2912. TextLabel35.TextXAlignment = Enum.TextXAlignment.Left
  2913. TextLabel36.Name = "locked"
  2914. TextLabel36.Parent = Frame34
  2915. TextLabel36.Transparency = 1
  2916. TextLabel36.Size = UDim2.new(1, -10, 1, 0)
  2917. TextLabel36.Text = ""
  2918. TextLabel36.Position = UDim2.new(0, 5, 0, 0)
  2919. TextLabel36.Visible = false
  2920. TextLabel36.BackgroundTransparency = 1
  2921. TextLabel36.Font = Enum.Font.SourceSans
  2922. TextLabel36.FontSize = Enum.FontSize.Size14
  2923. TextLabel36.TextColor3 = Color3.new(0.580392, 0.580392, 0.580392)
  2924. TextLabel36.TextWrapped = true
  2925. TextLabel36.TextXAlignment = Enum.TextXAlignment.Left
  2926. Frame37.Name = "border"
  2927. Frame37.Parent = Frame33
  2928. Frame37.Size = UDim2.new(0, 1, 1, 0)
  2929. Frame37.Position = UDim2.new(0.5, 0, 0, 0)
  2930. Frame37.BackgroundColor3 = Color3.new(0.686275, 0.686275, 0.686275)
  2931. Frame37.BorderColor3 = Color3.new(0.686275, 0.686275, 0.686275)
  2932. Frame37.BorderSizePixel = 0
  2933. Frame38.Name = "edit"
  2934. Frame38.Parent = Frame33
  2935. Frame38.Transparency = 1
  2936. Frame38.Size = UDim2.new(0.5, 0, 1, -1)
  2937. Frame38.Position = UDim2.new(0.5, 0, 0, 0)
  2938. Frame38.BackgroundColor3 = Color3.new(0.992157, 0.984314, 1)
  2939. Frame38.BackgroundTransparency = 1
  2940. TextLabel39.Name = "locked"
  2941. TextLabel39.Parent = Frame38
  2942. TextLabel39.Transparency = 1
  2943. TextLabel39.Size = UDim2.new(1, -10, 1, 0)
  2944. TextLabel39.Text = ""
  2945. TextLabel39.Position = UDim2.new(0, 5, 0, 0)
  2946. TextLabel39.Visible = false
  2947. TextLabel39.BackgroundTransparency = 1
  2948. TextLabel39.Font = Enum.Font.SourceSans
  2949. TextLabel39.FontSize = Enum.FontSize.Size14
  2950. TextLabel39.TextColor3 = Color3.new(0.580392, 0.580392, 0.580392)
  2951. TextLabel39.TextWrapped = true
  2952. TextLabel39.TextXAlignment = Enum.TextXAlignment.Left
  2953. TextBox40.Name = "box"
  2954. TextBox40.Parent = Frame38
  2955. TextBox40.Transparency = 1
  2956. TextBox40.Size = UDim2.new(1, -10, 1, 0)
  2957. TextBox40.Text = ""
  2958. TextBox40.Position = UDim2.new(0, 5, 0, 0)
  2959. TextBox40.Visible = false
  2960. TextBox40.BackgroundTransparency = 1
  2961. TextBox40.Font = Enum.Font.SourceSans
  2962. TextBox40.FontSize = Enum.FontSize.Size14
  2963. TextBox40.TextColor3 = Color3.new(0.0980392, 0.0980392, 0.0980392)
  2964. TextBox40.TextWrapped = true
  2965. TextBox40.TextXAlignment = Enum.TextXAlignment.Left
  2966. ImageButton41.Name = "check"
  2967. ImageButton41.Parent = Frame38
  2968. ImageButton41.Size = UDim2.new(0, 12, 0, 12)
  2969. ImageButton41.Position = UDim2.new(0, 5, 0, 5)
  2970. ImageButton41.Visible = false
  2971. ImageButton41.BorderSizePixel = 0
  2972. for i,v in pairs(mas:GetChildren()) do
  2973. v.Parent = game:GetService("Players").LocalPlayer.PlayerGui
  2974. pcall(function() v:MakeJoints() end)
  2975. end
  2976. mas:Destroy()
  2977. for i,v in pairs(cors) do
  2978. spawn(function()
  2979. pcall(v)
  2980. end)
  2981. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement