Advertisement
unknownexploits

framework v2 testing

Feb 15th, 2020
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.75 KB | None | 0 0
  1. local library = {
  2. windowcount = 0;
  3. }
  4.  
  5. local dragger = {};
  6. local resizer = {};
  7.  
  8. do
  9. local mouse = game:GetService("Players").LocalPlayer:GetMouse();
  10. local inputService = game:GetService('UserInputService');
  11. local heartbeat = game:GetService("RunService").Heartbeat;
  12. -- // credits to Ririchi / Inori for this cute drag function :)
  13. function dragger.new(frame)
  14. local s, event = pcall(function()
  15. return frame.MouseEnter
  16. end)
  17.  
  18. if s then
  19. frame.Active = true;
  20.  
  21. event:connect(function()
  22. local input = frame.InputBegan:connect(function(key)
  23. if key.UserInputType == Enum.UserInputType.MouseButton1 then
  24. local objectPosition = Vector2.new(mouse.X - frame.AbsolutePosition.X, mouse.Y - frame.AbsolutePosition.Y);
  25. while heartbeat:wait() and inputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
  26. frame:TweenPosition(UDim2.new(0, mouse.X - objectPosition.X + (frame.Size.X.Offset * frame.AnchorPoint.X), 0, mouse.Y - objectPosition.Y + (frame.Size.Y.Offset * frame.AnchorPoint.Y)), 'Out', 'Quad', 0.1, true);
  27. end
  28. end
  29. end)
  30.  
  31. local leave;
  32. leave = frame.MouseLeave:connect(function()
  33. input:disconnect();
  34. leave:disconnect();
  35. end)
  36. end)
  37. end
  38. end
  39.  
  40. function resizer.new(p, s)
  41. p:GetPropertyChangedSignal('AbsoluteSize'):connect(function()
  42. s.Size = UDim2.new(s.Size.X.Scale, s.Size.X.Offset, s.Size.Y.Scale, p.AbsoluteSize.Y);
  43. end)
  44. end
  45. end
  46.  
  47.  
  48. local defaults = {
  49. txtcolor = Color3.fromRGB(255, 255, 255),
  50. underline = Color3.fromRGB(121, 9, 255),
  51. barcolor = Color3.fromRGB(40, 40, 40),
  52. bgcolor = Color3.fromRGB(30, 30, 30),
  53. }
  54.  
  55. function library:Create(class, props)
  56. local object = Instance.new(class);
  57.  
  58. for i, prop in next, props do
  59. if i ~= "Parent" then
  60. object[i] = prop;
  61. end
  62. end
  63.  
  64. object.Parent = props.Parent;
  65. return object;
  66. end
  67.  
  68. function library:CreateWindow(options)
  69. assert(options.text, "no name");
  70. local window = {
  71. count = 0;
  72. toggles = {},
  73. closed = false;
  74. }
  75.  
  76. local options = options or {};
  77. setmetatable(options, {__index = defaults})
  78.  
  79. self.windowcount = self.windowcount + 1;
  80.  
  81. library.gui = library.gui or self:Create("ScreenGui", {Name = "UILibrary", Parent = game:GetService("CoreGui")})
  82. window.frame = self:Create("Frame", {
  83. Name = options.text;
  84. Parent = self.gui,
  85. Active = true,
  86. BackgroundTransparency = 0,
  87. Size = UDim2.new(0, 190, 0, 30),
  88. Position = UDim2.new(0, (15 + ((200 * self.windowcount) - 200)), 0, 15),
  89. BackgroundColor3 = options.barcolor,
  90. BorderSizePixel = 0;
  91. })
  92.  
  93. window.background = self:Create('Frame', {
  94. Name = 'Background';
  95. Parent = window.frame,
  96. BorderSizePixel = 0;
  97. BackgroundColor3 = options.bgcolor,
  98. Position = UDim2.new(0, 0, 1, 0),
  99. Size = UDim2.new(1, 0, 0, 25),
  100. ClipsDescendants = true;
  101. })
  102.  
  103. window.container = self:Create('Frame', {
  104. Name = 'Container';
  105. Parent = window.frame,
  106. BorderSizePixel = 0;
  107. BackgroundColor3 = options.bgcolor,
  108. Position = UDim2.new(0, 0, 1, 0),
  109. Size = UDim2.new(1, 0, 0, 25),
  110. ClipsDescendants = true;
  111. })
  112.  
  113. window.organizer = self:Create('UIListLayout', {
  114. Name = 'Sorter';
  115. --Padding = UDim.new(0, 0);
  116. SortOrder = Enum.SortOrder.LayoutOrder;
  117. Parent = window.container;
  118. })
  119.  
  120. window.padder = self:Create('UIPadding', {
  121. Name = 'Padding';
  122. PaddingLeft = UDim.new(0, 10);
  123. PaddingTop = UDim.new(0, 5);
  124. Parent = window.container;
  125. })
  126.  
  127. self:Create("Frame", {
  128. Name = 'Underline';
  129. Size = UDim2.new(1, 0, 0, 1),
  130. Position = UDim2.new(0, 0, 1, -1),
  131. BorderSizePixel = 0;
  132. BackgroundColor3 = options.underline;
  133. Parent = window.frame
  134. })
  135.  
  136. local togglebutton = self:Create("TextButton", {
  137. Name = 'Toggle';
  138. ZIndex = 2,
  139. BackgroundTransparency = 1;
  140. Position = UDim2.new(1, -25, 0, 0),
  141. Size = UDim2.new(0, 25, 1, 0),
  142. Text = "-",
  143. TextSize = 17,
  144. TextColor3 = options.txtcolor,
  145. Font = Enum.Font.SourceSans;
  146. Parent = window.frame,
  147. });
  148.  
  149. togglebutton.MouseButton1Click:connect(function()
  150. window.closed = not window.closed
  151. togglebutton.Text = (window.closed and "+" or "-")
  152. if window.closed then
  153. window:Resize(true, UDim2.new(1, 0, 0, 0))
  154. else
  155. window:Resize(true)
  156. end
  157. end)
  158.  
  159. self:Create("TextLabel", {
  160. Size = UDim2.new(1, 0, 1, 0),
  161. BackgroundTransparency = 1;
  162. BorderSizePixel = 0;
  163. TextColor3 = options.txtcolor,
  164. TextColor3 = (options.bartextcolor or Color3.fromRGB(255, 255, 255));
  165. TextSize = 17,
  166. Font = Enum.Font.SourceSansSemibold;
  167. Text = options.text or "window",
  168. Name = "Window",
  169. Parent = window.frame,
  170. })
  171.  
  172. do
  173. dragger.new(window.frame)
  174. resizer.new(window.background, window.container);
  175. end
  176.  
  177. local function getSize()
  178. local ySize = 0;
  179. for i, object in next, window.container:GetChildren() do
  180. if (not object:IsA('UIListLayout')) and (not object:IsA('UIPadding')) then
  181. ySize = ySize + object.AbsoluteSize.Y
  182. end
  183. end
  184. return UDim2.new(1, 0, 0, ySize + 10)
  185. end
  186.  
  187. function window:Resize(tween, change)
  188. local size = change or getSize()
  189. self.container.ClipsDescendants = true;
  190.  
  191. if tween then
  192. self.background:TweenSize(size, "Out", "Sine", 0.5, true)
  193. else
  194. self.background.Size = size
  195. end
  196. end
  197.  
  198. function window:AddToggle(text, callback)
  199. self.count = self.count + 1
  200.  
  201. callback = callback or function() end
  202. local label = library:Create("TextLabel", {
  203. Text = text,
  204. Size = UDim2.new(1, -10, 0, 20);
  205. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  206. BackgroundTransparency = 1;
  207. TextColor3 = Color3.fromRGB(255, 255, 255);
  208. TextXAlignment = Enum.TextXAlignment.Left;
  209. LayoutOrder = self.Count;
  210. TextSize = 16,
  211. Font = Enum.Font.SourceSans,
  212. Parent = self.container;
  213. })
  214.  
  215. local button = library:Create("TextButton", {
  216. Text = "OFF",
  217. TextColor3 = Color3.fromRGB(255, 25, 25),
  218. BackgroundTransparency = 1;
  219. Position = UDim2.new(1, -25, 0, 0),
  220. Size = UDim2.new(0, 25, 1, 0),
  221. TextSize = 17,
  222. Font = Enum.Font.SourceSansSemibold,
  223. Parent = label;
  224. })
  225.  
  226. button.MouseButton1Click:connect(function()
  227. self.toggles[text] = (not self.toggles[text])
  228. button.TextColor3 = (self.toggles[text] and Color3.fromRGB(0, 255, 140) or Color3.fromRGB(255, 25, 25))
  229. button.Text =(self.toggles[text] and "ON" or "OFF")
  230.  
  231. callback(self.toggles[text])
  232. end)
  233.  
  234. self:Resize()
  235. return button
  236. end
  237.  
  238. function window:AddToggle2(text, callback)
  239. self.count = self.count + 1
  240.  
  241. callback = callback or function() end
  242. local label = library:Create("TextBox", {
  243. PlaceholderText = text,
  244. Text = '',
  245. Name = 'Textbox1';
  246. Size = UDim2.new(1, -10, 0, 20);
  247. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  248. BackgroundTransparency = 1;
  249. TextColor3 = Color3.fromRGB(255, 255, 255);
  250. TextXAlignment = Enum.TextXAlignment.Left;
  251. LayoutOrder = self.Count;
  252. TextSize = 16,
  253. Font = Enum.Font.SourceSans,
  254. Parent = self.container;
  255. })
  256.  
  257. local button = library:Create("TextButton", {
  258. Text = "OFF",
  259. TextColor3 = Color3.fromRGB(255, 25, 25),
  260. BackgroundTransparency = 1;
  261. Position = UDim2.new(1, -25, 0, 0),
  262. Size = UDim2.new(0, 25, 1, 0),
  263. TextSize = 17,
  264. Font = Enum.Font.SourceSansSemibold,
  265. Parent = label;
  266. })
  267.  
  268. button.MouseButton1Click:connect(function()
  269. self.toggles[text] = (not self.toggles[text])
  270. button.TextColor3 = (self.toggles[text] and Color3.fromRGB(0, 255, 140) or Color3.fromRGB(255, 25, 25))
  271. button.Text =(self.toggles[text] and "ON" or "OFF")
  272.  
  273. callback(self.toggles[text])
  274. end)
  275.  
  276. self:Resize()
  277. return button
  278. end
  279.  
  280. function window:AddToggle3(text, callback)
  281. self.count = self.count + 1
  282.  
  283. callback = callback or function() end
  284. local label = library:Create("TextBox", {
  285. PlaceholderText = text,
  286. Text = '',
  287. Name = 'TextBox2',
  288. Size = UDim2.new(1, -10, 0, 20);
  289. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  290. BackgroundTransparency = 1;
  291. TextColor3 = Color3.fromRGB(255, 255, 255);
  292. TextXAlignment = Enum.TextXAlignment.Left;
  293. LayoutOrder = self.Count;
  294. TextSize = 16,
  295. Font = Enum.Font.SourceSans,
  296. Parent = self.container;
  297. })
  298.  
  299. local button = library:Create("TextButton", {
  300. Text = "OFF",
  301. TextColor3 = Color3.fromRGB(255, 25, 25),
  302. BackgroundTransparency = 1;
  303. Position = UDim2.new(1, -25, 0, 0),
  304. Size = UDim2.new(0, 25, 1, 0),
  305. TextSize = 17,
  306. Font = Enum.Font.SourceSansSemibold,
  307. Parent = label;
  308. })
  309.  
  310. button.MouseButton1Click:connect(function()
  311. self.toggles[text] = (not self.toggles[text])
  312. button.TextColor3 = (self.toggles[text] and Color3.fromRGB(0, 255, 140) or Color3.fromRGB(255, 25, 25))
  313. button.Text =(self.toggles[text] and "ON" or "OFF")
  314.  
  315. callback(self.toggles[text])
  316. end)
  317.  
  318. self:Resize()
  319. return button
  320. end
  321.  
  322. function window:AddToggle4(text, callback)
  323. self.count = self.count + 1
  324.  
  325. callback = callback or function() end
  326. local label = library:Create("TextBox", {
  327. PlaceholderText = text,
  328. Text = '',
  329. Name = 'TextBox3',
  330. Size = UDim2.new(1, -10, 0, 20);
  331. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  332. BackgroundTransparency = 1;
  333. TextColor3 = Color3.fromRGB(255, 255, 255);
  334. TextXAlignment = Enum.TextXAlignment.Left;
  335. LayoutOrder = self.Count;
  336. TextSize = 16,
  337. Font = Enum.Font.SourceSans,
  338. Parent = self.container;
  339. })
  340.  
  341. local button = library:Create("TextButton", {
  342. Text = "OFF",
  343. TextColor3 = Color3.fromRGB(255, 25, 25),
  344. BackgroundTransparency = 1;
  345. Position = UDim2.new(1, -25, 0, 0),
  346. Size = UDim2.new(0, 25, 1, 0),
  347. TextSize = 17,
  348. Font = Enum.Font.SourceSansSemibold,
  349. Parent = label;
  350. })
  351.  
  352. button.MouseButton1Click:connect(function()
  353. self.toggles[text] = (not self.toggles[text])
  354. button.TextColor3 = (self.toggles[text] and Color3.fromRGB(0, 255, 140) or Color3.fromRGB(255, 25, 25))
  355. button.Text =(self.toggles[text] and "ON" or "OFF")
  356.  
  357. callback(self.toggles[text])
  358. end)
  359.  
  360. self:Resize()
  361. return button
  362. end
  363.  
  364. function window:AddToggle5(text, callback)
  365. self.count = self.count + 1
  366.  
  367. callback = callback or function() end
  368. local label = library:Create("TextBox", {
  369. PlaceholderText = text,
  370. Text = '',
  371. Name = 'TextBox5',
  372. Size = UDim2.new(1, -10, 0, 20);
  373. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  374. BackgroundTransparency = 1;
  375. TextColor3 = Color3.fromRGB(255, 255, 255);
  376. TextXAlignment = Enum.TextXAlignment.Left;
  377. LayoutOrder = self.Count;
  378. TextSize = 16,
  379. Font = Enum.Font.SourceSans,
  380. Parent = self.container;
  381. })
  382.  
  383. local button = library:Create("TextButton", {
  384. Text = "OFF",
  385. TextColor3 = Color3.fromRGB(255, 25, 25),
  386. BackgroundTransparency = 1;
  387. Position = UDim2.new(1, -25, 0, 0),
  388. Size = UDim2.new(0, 25, 1, 0),
  389. TextSize = 17,
  390. Font = Enum.Font.SourceSansSemibold,
  391. Parent = label;
  392. })
  393.  
  394. button.MouseButton1Click:connect(function()
  395. self.toggles[text] = (not self.toggles[text])
  396. button.TextColor3 = (self.toggles[text] and Color3.fromRGB(0, 255, 140) or Color3.fromRGB(255, 25, 25))
  397. button.Text =(self.toggles[text] and "ON" or "OFF")
  398.  
  399. callback(self.toggles[text])
  400. end)
  401.  
  402. self:Resize()
  403. return button
  404. end
  405.  
  406. function window:AddBox(text, callback)
  407. self.count = self.count + 1
  408. callback = callback or function() end
  409.  
  410. local box = library:Create("TextBox", {
  411. PlaceholderText = text,
  412. Size = UDim2.new(1, -10, 0, 20);
  413. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  414. BackgroundTransparency = 0.75;
  415. BackgroundColor3 = options.boxcolor,
  416. TextColor3 = Color3.fromRGB(255, 255, 255);
  417. TextXAlignment = Enum.TextXAlignment.Center;
  418. TextSize = 16,
  419. Text = "",
  420. Font = Enum.Font.SourceSans,
  421. LayoutOrder = self.Count;
  422. BorderSizePixel = 0;
  423. Parent = self.container;
  424. })
  425.  
  426. box.FocusLost:connect(function(...)
  427. callback(box, ...)
  428. end)
  429.  
  430. self:Resize()
  431. return box
  432. end
  433.  
  434. function window:AddButton(text, callback)
  435. self.count = self.count + 1
  436.  
  437. callback = callback or function() end
  438. local button = library:Create("TextButton", {
  439. Text = text,
  440. Size = UDim2.new(1, -10, 0, 20);
  441. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  442. BackgroundTransparency = 1;
  443. TextColor3 = Color3.fromRGB(255, 255, 255);
  444. TextXAlignment = Enum.TextXAlignment.Left;
  445. TextSize = 16,
  446. Font = Enum.Font.SourceSans,
  447. LayoutOrder = self.Count;
  448. Parent = self.container;
  449. })
  450.  
  451. button.MouseButton1Click:connect(callback)
  452. self:Resize()
  453. return button
  454. end
  455.  
  456. function window:AddButton2(text, callback)
  457. self.count = self.count + 1
  458.  
  459. callback = callback or function() end
  460. local button = library:Create("TextButton", {
  461. Text = text,
  462. Size = UDim2.new(1, -10, 0, 20);
  463. Name = 'TextButton2';
  464. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  465. BackgroundTransparency = 1;
  466. TextColor3 = Color3.fromRGB(255, 255, 255);
  467. TextXAlignment = Enum.TextXAlignment.Left;
  468. TextSize = 16,
  469. Font = Enum.Font.SourceSans,
  470. LayoutOrder = self.Count;
  471. Parent = self.container;
  472. })
  473.  
  474. button.MouseButton1Click:connect(callback)
  475. self:Resize()
  476. return button
  477. end
  478.  
  479. function window:AddButton3(text, callback)
  480. self.count = self.count + 1
  481.  
  482. callback = callback or function() end
  483. local button = library:Create("TextButton", {
  484. Text = text,
  485. Size = UDim2.new(1, -10, 0, 20);
  486. Name = 'TextButton3';
  487. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  488. BackgroundTransparency = 1;
  489. TextColor3 = Color3.fromRGB(255, 255, 255);
  490. TextXAlignment = Enum.TextXAlignment.Left;
  491. TextSize = 16,
  492. Font = Enum.Font.SourceSans,
  493. LayoutOrder = self.Count;
  494. Parent = self.container;
  495. })
  496.  
  497. button.MouseButton1Click:connect(callback)
  498. self:Resize()
  499. return button
  500. end
  501.  
  502. function window:AddButton4(text, callback)
  503. self.count = self.count + 1
  504.  
  505. callback = callback or function() end
  506. local button = library:Create("TextButton", {
  507. Text = text,
  508. Size = UDim2.new(1, -10, 0, 20);
  509. Name = 'TextButton4';
  510. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  511. BackgroundTransparency = 1;
  512. TextColor3 = Color3.fromRGB(255, 255, 255);
  513. TextXAlignment = Enum.TextXAlignment.Left;
  514. TextSize = 16,
  515. Font = Enum.Font.SourceSans,
  516. LayoutOrder = self.Count;
  517. Parent = self.container;
  518. })
  519.  
  520. button.MouseButton1Click:connect(callback)
  521. self:Resize()
  522. return button
  523. end
  524.  
  525. function window:AddButton5(text, callback)
  526. self.count = self.count + 1
  527.  
  528. callback = callback or function() end
  529. local button = library:Create("TextButton", {
  530. Text = text,
  531. Size = UDim2.new(1, -10, 0, 20);
  532. Name = 'TextButton5';
  533. --Position = UDim2.new(0, 5, 0, ((20 * self.count) - 20) + 5),
  534. BackgroundTransparency = 1;
  535. TextColor3 = Color3.fromRGB(255, 255, 255);
  536. TextXAlignment = Enum.TextXAlignment.Left;
  537. TextSize = 16,
  538. Font = Enum.Font.SourceSans,
  539. LayoutOrder = self.Count;
  540. Parent = self.container;
  541. })
  542.  
  543. button.MouseButton1Click:connect(callback)
  544. self:Resize()
  545. return button
  546. end
  547.  
  548. function window:AddLabel(text)
  549. self.count = self.count + 1;
  550.  
  551. local tSize = game:GetService('TextService'):GetTextSize(text, 16, Enum.Font.SourceSans, Vector2.new(math.huge, math.huge))
  552.  
  553. local button = library:Create("TextLabel", {
  554. Text = text,
  555. Size = UDim2.new(1, -10, 0, tSize.Y + 5);
  556. TextScaled = false;
  557. BackgroundTransparency = 1;
  558. TextColor3 = Color3.fromRGB(255, 255, 255);
  559. TextXAlignment = Enum.TextXAlignment.Left;
  560. TextSize = 16,
  561. Font = Enum.Font.SourceSans,
  562. LayoutOrder = self.Count;
  563. Parent = self.container;
  564. })
  565.  
  566. self:Resize()
  567. return button
  568. end
  569.  
  570. function window:AddDropdown(options, callback)
  571. self.count = self.count + 1
  572. local default = options[1] or "";
  573.  
  574. callback = callback or function() end
  575. local dropdown = library:Create("TextLabel", {
  576. Size = UDim2.new(1, -10, 0, 20);
  577. BackgroundTransparency = 0.75;
  578. BackgroundColor3 = options.boxcolor,
  579. TextColor3 = Color3.fromRGB(255, 255, 255);
  580. TextXAlignment = Enum.TextXAlignment.Center;
  581. TextSize = 16,
  582. Text = default,
  583. Font = Enum.Font.SourceSans,
  584. BorderSizePixel = 0;
  585. LayoutOrder = self.Count;
  586. Parent = self.container;
  587. })
  588.  
  589. local button = library:Create("ImageButton",{
  590. BackgroundTransparency = 1;
  591. Image = 'rbxassetid://3234893186';
  592. Size = UDim2.new(0, 18, 1, 0);
  593. Position = UDim2.new(1, -20, 0, 0);
  594. Parent = dropdown;
  595. })
  596.  
  597. local frame;
  598.  
  599. local function isInGui(frame)
  600. local mloc = game:GetService('UserInputService'):GetMouseLocation();
  601. local mouse = Vector2.new(mloc.X, mloc.Y - 36);
  602.  
  603. local x1, x2 = frame.AbsolutePosition.X, frame.AbsolutePosition.X + frame.AbsoluteSize.X;
  604. local y1, y2 = frame.AbsolutePosition.Y, frame.AbsolutePosition.Y + frame.AbsoluteSize.Y;
  605.  
  606. return (mouse.X >= x1 and mouse.X <= x2) and (mouse.Y >= y1 and mouse.Y <= y2)
  607. end
  608.  
  609. local function count(t)
  610. local c = 0;
  611. for i, v in next, t do
  612. c = c + 1
  613. end
  614. return c;
  615. end
  616.  
  617. button.MouseButton1Click:connect(function()
  618. if count(options) == 0 then
  619. return
  620. end
  621.  
  622. if frame then
  623. frame:Destroy();
  624. frame = nil;
  625. end
  626.  
  627. self.container.ClipsDescendants = false;
  628.  
  629. frame = library:Create('Frame', {
  630. Position = UDim2.new(0, 0, 1, 0);
  631. BackgroundColor3 = Color3.fromRGB(40, 40, 40);
  632. Size = UDim2.new(0, dropdown.AbsoluteSize.X, 0, (count(options) * 21));
  633. BorderSizePixel = 0;
  634. Parent = dropdown;
  635. ClipsDescendants = true;
  636. ZIndex = 2;
  637. })
  638.  
  639. library:Create('UIListLayout', {
  640. Name = 'Layout';
  641. Parent = frame;
  642. })
  643.  
  644. for i, option in next, options do
  645. local selection = library:Create('TextButton', {
  646. Text = option;
  647. BackgroundColor3 = Color3.fromRGB(40, 40, 40);
  648. TextColor3 = Color3.fromRGB(255, 255, 255);
  649. BorderSizePixel = 0;
  650. TextSize = 16;
  651. Font = Enum.Font.SourceSans;
  652. Size = UDim2.new(1, 0, 0, 21);
  653. Parent = frame;
  654. ZIndex = 2;
  655. })
  656.  
  657. selection.MouseButton1Click:connect(function()
  658. dropdown.Text = option;
  659. callback(option)
  660. frame.Size = UDim2.new(1, 0, 0, 0);
  661. game:GetService('Debris'):AddItem(frame, 0.1)
  662. end)
  663. end
  664. end);
  665.  
  666. game:GetService('UserInputService').InputBegan:connect(function(m)
  667. if m.UserInputType == Enum.UserInputType.MouseButton1 then
  668. if frame and (not isInGui(frame)) then
  669. game:GetService('Debris'):AddItem(frame);
  670. end
  671. end
  672. end)
  673.  
  674. callback(default);
  675. self:Resize()
  676. return {
  677. Refresh = function(self, array)
  678. game:GetService('Debris'):AddItem(frame);
  679. options = array
  680. dropdown.Text = options[1];
  681. end
  682. }
  683. end;
  684.  
  685.  
  686. return window
  687. end
  688.  
  689. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement