Fullgamer309

lmao

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