Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.54 KB | None | 0 0
  1. local library = {count = 0, queue = {}, callbacks = {}, rainbowtable = {}, toggled = true, binds = {}};
  2. local defaults; do
  3. local dragger = {}; do
  4. local mouse = game:GetService("Players").LocalPlayer:GetMouse();
  5. local inputService = game:GetService('UserInputService');
  6. local heartbeat = game:GetService("RunService").Heartbeat;
  7. -- // credits to Ririchi / Inori for this cute drag function :)
  8. function dragger.new(frame)
  9. local s, event = pcall(function()
  10. return frame.MouseEnter
  11. end)
  12.  
  13. if s then
  14. frame.Active = true;
  15.  
  16. event:connect(function()
  17. local input = frame.InputBegan:connect(function(key)
  18. if key.UserInputType == Enum.UserInputType.MouseButton1 then
  19. local objectPosition = Vector2.new(mouse.X - frame.AbsolutePosition.X, mouse.Y - frame.AbsolutePosition.Y);
  20. while heartbeat:wait() and inputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
  21. pcall(function()
  22. 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', 'Linear', 0.1, true);
  23. end)
  24. end
  25. end
  26. end)
  27.  
  28. local leave;
  29. leave = frame.MouseLeave:connect(function()
  30. input:disconnect();
  31. leave:disconnect();
  32. end)
  33. end)
  34. end
  35. end
  36.  
  37. game:GetService('UserInputService').InputBegan:connect(function(key, gpe)
  38. if (not gpe) then
  39. if key.KeyCode == Enum.KeyCode.F15 then
  40. library.toggled = not library.toggled;
  41. for i, data in next, library.queue do
  42. local pos = (library.toggled and data.p or UDim2.new(-1, 0, -0.5,0))
  43. data.w:TweenPosition(pos, (library.toggled and 'Out' or 'In'), 'Quad', 0.15, true)
  44. wait();
  45. end
  46. end
  47. end
  48. end)
  49. end
  50.  
  51. local types = {}; do
  52. types.__index = types;
  53. function types.window(name, options)
  54. library.count = library.count + 1
  55. local newWindow = library:Create('Frame', {
  56. Name = name;
  57. Size = UDim2.new(0, 190, 0, 30);
  58. BackgroundColor3 = options.topcolor;
  59. BorderSizePixel = 0;
  60. Parent = library.container;
  61. Position = UDim2.new(0, (15 + (200 * library.count) - 200), 0, 0);
  62. ZIndex = 3;
  63. library:Create('TextLabel', {
  64. Text = name;
  65. Size = UDim2.new(1, -10, 1, 0);
  66. Position = UDim2.new(0, 5, 0, 0);
  67. BackgroundTransparency = 1;
  68. Font = Enum.Font.Cartoon;
  69. TextSize = 17;
  70. TextColor3 = options.titletextcolor;
  71. TextStrokeTransparency = library.options.titlestroke;
  72. TextStrokeColor3 = library.options.titlestrokecolor;
  73. ZIndex = 3;
  74. });
  75. library:Create("TextButton", {
  76. Size = UDim2.new(0, 30, 0, 30);
  77. Position = UDim2.new(1, -35, 0, 0);
  78. BackgroundTransparency = 1;
  79. Text = "-";
  80. TextSize = options.titlesize;
  81. Font = options.titlefont;--Enum.Font.GothamBlack;
  82. Name = 'window_toggle';
  83. TextColor3 = options.titletextcolor;
  84. TextStrokeTransparency = library.options.titlestroke;
  85. TextStrokeColor3 = library.options.titlestrokecolor;
  86. TextScaled = false;
  87. ZIndex = 3;
  88. });
  89. library:Create("Frame", {
  90. Name = 'Underline';
  91. Size = UDim2.new(1, 0, 0, 2);
  92. Position = UDim2.new(0, 0, 1, -2);
  93. BackgroundColor3 = (options.underlinecolor ~= "rainbow" and options.underlinecolor or Color3.new());
  94. BorderSizePixel = 0;
  95. ZIndex = 3;
  96. });
  97. library:Create('Frame', {
  98. Name = 'container';
  99. Position = UDim2.new(0, 0, 1, 0);
  100. Size = UDim2.new(1, 0, 0, 0);
  101. BorderSizePixel = 0;
  102. BackgroundColor3 = options.bgcolor;
  103. ClipsDescendants = false;
  104. library:Create('UIListLayout', {
  105. Name = 'List';
  106. SortOrder = Enum.SortOrder.LayoutOrder;
  107. })
  108. });
  109. })
  110.  
  111. if options.underlinecolor == "rainbow" then
  112. table.insert(library.rainbowtable, newWindow:FindFirstChild('Underline'))
  113. end
  114.  
  115. local window = setmetatable({
  116. count = 0;
  117. object = newWindow;
  118. container = newWindow.container;
  119. toggled = true;
  120. flags = {};
  121.  
  122. }, types)
  123.  
  124. table.insert(library.queue, {
  125. w = window.object;
  126. p = window.object.Position;
  127. })
  128.  
  129. newWindow:FindFirstChild("window_toggle").MouseButton1Click:connect(function()
  130. window.toggled = not window.toggled;
  131. newWindow:FindFirstChild("window_toggle").BackgroundColor3 = Color3.fromRGB(window.toggled and "62, 186, 0" or "195, 0, 0")
  132. newWindow:FindFirstChild("window_toggle").Text = (window.toggled and "-" or "+")
  133. if (not window.toggled) then
  134. window.container.ClipsDescendants = true;
  135. end
  136. wait();
  137. local y = 0;
  138. for i, v in next, window.container:GetChildren() do
  139. if (not v:IsA('UIListLayout')) then
  140. y = y + v.AbsoluteSize.Y;
  141. end
  142. end
  143.  
  144. local targetSize = window.toggled and UDim2.new(1, 0, 0, y+5) or UDim2.new(1, 0, 0, 0);
  145. local targetDirection = window.toggled and "In" or "Out"
  146.  
  147. window.container:TweenSize(targetSize, targetDirection, "Quad", 0.15, true)
  148. wait(.15)
  149. if window.toggled then
  150. window.container.ClipsDescendants = false;
  151. end
  152. end)
  153.  
  154. return window;
  155. end
  156.  
  157. function types:Resize()
  158. local y = 0;
  159. for i, v in next, self.container:GetChildren() do
  160. if (not v:IsA('UIListLayout')) then
  161. y = y + v.AbsoluteSize.Y;
  162. end
  163. end
  164. self.container.Size = UDim2.new(1, 0, 0, y+5)
  165. end
  166.  
  167. function types:GetOrder()
  168. local c = 0;
  169. for i, v in next, self.container:GetChildren() do
  170. if (not v:IsA('UIListLayout')) then
  171. c = c + 1
  172. end
  173. end
  174. return c
  175. end
  176.  
  177. function types:Label(text)
  178. local v = game:GetService'TextService':GetTextSize(text, 18, Enum.Font.SourceSans, Vector2.new(math.huge, math.huge))
  179. local object = library:Create('Frame', {
  180. Size = UDim2.new(1, 0, 0, v.Y + 5);
  181. BackgroundTransparency = 1;
  182. library:Create('TextLabel', {
  183. Size = UDim2.new(2, 0, 2, 0);
  184. Position = UDim2.new(0, 10, 0, 0);
  185. LayoutOrder = self:GetOrder();
  186. BorderSizePixel = library.options.bordersizepixel;
  187. Text = text;
  188. TextSize = 18;
  189. Font = Enum.Font.GothamBlack;
  190. TextColor3 = Color3.fromRGB(255, 255, 255);
  191. BackgroundTransparency = 1;
  192. TextXAlignment = Enum.TextXAlignment.Left;
  193. TextWrapped = true;
  194. TextScaled = true;
  195. });
  196. Parent = self.container
  197. })
  198. self:Resize();
  199. end
  200.  
  201. function types:Toggle(name, options, callback)
  202. local default = options.default or false;
  203. local location = options.location or self.flags;
  204. local flag = options.flag or "";
  205. local callback = callback or function() end;
  206.  
  207. location[flag] = default;
  208.  
  209. local check = library:Create('Frame', {
  210. BackgroundTransparency = 1;
  211. Size = UDim2.new(1, 0, 0, 25);
  212. LayoutOrder = self:GetOrder();
  213. library:Create('TextLabel', {
  214. Name = name;
  215. Text = "\r" .. name;
  216. BackgroundTransparency = 1;
  217. TextColor3 = library.options.textcolor;
  218. Position = UDim2.new(0, 5, 0, 0);
  219. Size = UDim2.new(1, -5, 1, 0);
  220. TextXAlignment = Enum.TextXAlignment.Left;
  221. Font = library.options.font;
  222. TextSize = library.options.fontsize;
  223. TextStrokeTransparency = library.options.textstroke;
  224. TextStrokeColor3 = library.options.strokecolor;
  225. library:Create('TextButton', {
  226. Text = (location[flag] and utf8.char(10003) or "");
  227. Font = library.options.font;
  228. TextSize = library.options.fontsize;
  229. Name = 'Checkmark';
  230. Size = UDim2.new(0, 20, 0, 20);
  231. Position = UDim2.new(1, -25, 0, 4);
  232. TextColor3 = library.options.textcolor;
  233. BackgroundColor3 = library.options.bgcolor;
  234. BorderColor3 = library.options.bordercolor;
  235. TextStrokeTransparency = library.options.textstroke;
  236. TextStrokeColor3 = library.options.strokecolor;
  237. })
  238. });
  239. Parent = self.container;
  240. });
  241.  
  242. local function click(t)
  243. location[flag] = not location[flag];
  244. callback(location[flag])
  245. check:FindFirstChild(name).Checkmark.Text = location[flag] and utf8.char(10003) or "";
  246. end
  247.  
  248. check:FindFirstChild(name).Checkmark.MouseButton1Click:connect(click)
  249. library.callbacks[flag] = click;
  250.  
  251. if location[flag] == true then
  252. callback(location[flag])
  253. end
  254.  
  255. self:Resize();
  256. return {
  257. Set = function(self, b)
  258. location[flag] = b;
  259. callback(location[flag])
  260. check:FindFirstChild(name).Checkmark.Text = location[flag] and utf8.char(10003) or "";
  261. end
  262. }
  263. end
  264.  
  265. function types:Button(name, callback)
  266. callback = callback or function() end;
  267.  
  268. local check = library:Create('Frame', {
  269. BackgroundTransparency = 1;
  270. Size = UDim2.new(1, 0, 0, 25);
  271. LayoutOrder = self:GetOrder();
  272. library:Create('TextButton', {
  273. Name = name;
  274. Text = name;
  275. BackgroundColor3 = library.options.btncolor;
  276. BorderColor3 = library.options.bordercolor;
  277. BorderSizePixel = library.options.buttonbordersizepixel;
  278. TextStrokeTransparency = library.options.textstroke;
  279. TextScaled = true;
  280. TextStrokeColor3 = library.options.strokecolor;
  281. TextColor3 = library.options.textcolor;
  282. Position = UDim2.new(0, 5, 0, 5);
  283. Size = UDim2.new(1, -10, 0, 20);
  284. Font = library.options.font;
  285. TextSize = library.options.fontsize;
  286. });
  287. Parent = self.container;
  288. });
  289.  
  290. check:FindFirstChild(name).MouseButton1Click:connect(callback)
  291. self:Resize();
  292.  
  293. return {
  294. Fire = function()
  295. callback();
  296. end
  297. }
  298. end
  299.  
  300. function types:Box(name, options, callback) --type, default, data, location, flag)
  301. local type = options.type or "";
  302. local default = options.default or "";
  303. local data = options.data
  304. local location = options.location or self.flags;
  305. local flag = options.flag or "";
  306. local callback = callback or function() end;
  307. local min = options.min or 0;
  308. local max = options.max or 9e9;
  309.  
  310. if type == 'number' and (not tonumber(default)) then
  311. location[flag] = default;
  312. else
  313. location[flag] = "";
  314. default = "";
  315. end
  316.  
  317. local check = library:Create('Frame', {
  318. BackgroundTransparency = 1;
  319. Size = UDim2.new(1, 0, 0, 25);
  320. LayoutOrder = self:GetOrder();
  321. library:Create('TextLabel', {
  322. Name = name;
  323. Text = "\r" .. name;
  324. BackgroundTransparency = 1;
  325. TextColor3 = library.options.textcolor;
  326. TextStrokeTransparency = library.options.textstroke;
  327. TextStrokeColor3 = library.options.strokecolor;
  328. Position = UDim2.new(0, 5, 0, 0);
  329. Size = UDim2.new(1, -5, 1, 0);
  330. TextXAlignment = Enum.TextXAlignment.Left;
  331. Font = library.options.font;
  332. TextSize = library.options.fontsize;
  333. library:Create('TextBox', {
  334. TextStrokeTransparency = library.options.textstroke;
  335. TextStrokeColor3 = library.options.strokecolor;
  336. Text = tostring(default);
  337. Font = library.options.font;
  338. TextSize = library.options.fontsize;
  339. Name = 'Box';
  340. Size = UDim2.new(0, 65, 0, 25);
  341. Position = UDim2.new(1, -65, 0, 3);
  342. TextColor3 = library.options.textcolor;
  343. BackgroundColor3 = library.options.boxcolor;
  344. BorderColor3 = library.options.bordercolor;
  345. PlaceholderColor3 = library.options.placeholdercolor;
  346. })
  347. });
  348. Parent = self.container;
  349. });
  350.  
  351. local box = check:FindFirstChild(name):FindFirstChild('Box');
  352. box.FocusLost:connect(function(e)
  353. local old = location[flag];
  354. if type == "number" then
  355. local num = tonumber(box.Text)
  356. if (not num) then
  357. box.Text = tonumber(location[flag])
  358. else
  359. location[flag] = math.clamp(num, min, max)
  360. box.Text = tonumber(location[flag])
  361. end
  362. else
  363. location[flag] = tostring(box.Text)
  364. end
  365.  
  366. callback(location[flag], old, e)
  367. end)
  368.  
  369. if type == 'number' then
  370. box:GetPropertyChangedSignal('Text'):connect(function()
  371. box.Text = string.gsub(box.Text, "[%a+]", "");
  372. end)
  373. end
  374.  
  375. self:Resize();
  376. return box
  377. end
  378.  
  379. function types:Bind(name, options, callback)
  380. local location = options.location or self.flags;
  381. local keyboardOnly = options.kbonly or false
  382. local flag = options.flag or "";
  383. local callback = callback or function() end;
  384. local default = options.default;
  385.  
  386. if keyboardOnly and (not tostring(default):find('MouseButton')) then
  387. location[flag] = default
  388. end
  389.  
  390. local banned = {
  391. Return = true;
  392. Space = true;
  393. Tab = true;
  394. Unknown = true;
  395. }
  396.  
  397. local shortNames = {
  398. RightControl = 'RightCtrl';
  399. LeftControl = 'LeftCtrl';
  400. LeftShift = 'LShift';
  401. RightShift = 'RShift';
  402. MouseButton1 = "Mouse1";
  403. MouseButton2 = "Mouse2";
  404. }
  405.  
  406. local allowed = {
  407. MouseButton1 = true;
  408. MouseButton2 = true;
  409. }
  410.  
  411. local nm = (default and (shortNames[default.Name] or default.Name) or "None");
  412. local check = library:Create('Frame', {
  413. BackgroundTransparency = 1;
  414. Size = UDim2.new(1, 0, 0, 30);
  415. LayoutOrder = self:GetOrder();
  416. library:Create('TextLabel', {
  417. Name = name;
  418. Text = "\r" .. name;
  419. BackgroundTransparency = 1;
  420. TextColor3 = library.options.textcolor;
  421. Position = UDim2.new(0, 5, 0, 0);
  422. Size = UDim2.new(1, -5, 1, 0);
  423. TextXAlignment = Enum.TextXAlignment.Left;
  424. Font = library.options.font;
  425. TextSize = library.options.fontsize;
  426. TextStrokeTransparency = library.options.textstroke;
  427. TextStrokeColor3 = library.options.strokecolor;
  428. BorderColor3 = library.options.bordercolor;
  429. BorderSizePixel = 1;
  430. library:Create('TextButton', {
  431. Name = 'Keybind';
  432. Text = nm;
  433. TextStrokeTransparency = library.options.textstroke;
  434. TextStrokeColor3 = library.options.strokecolor;
  435. Font = library.options.font;
  436. TextSize = library.options.fontsize;
  437. Size = UDim2.new(0, 60, 0, 20);
  438. Position = UDim2.new(1, -65, 0, 5);
  439. TextColor3 = library.options.textcolor;
  440. BackgroundColor3 = library.options.bgcolor;
  441. BorderColor3 = library.options.bordercolor;
  442. BorderSizePixel = 1;
  443. })
  444. });
  445. Parent = self.container;
  446. });
  447.  
  448. local button = check:FindFirstChild(name).Keybind;
  449. button.MouseButton1Click:connect(function()
  450. library.binding = true
  451.  
  452. button.Text = "..."
  453. local a, b = game:GetService('UserInputService').InputBegan:wait();
  454. local name = tostring(a.KeyCode.Name);
  455. local typeName = tostring(a.UserInputType.Name);
  456.  
  457. if (a.UserInputType ~= Enum.UserInputType.Keyboard and (allowed[a.UserInputType.Name]) and (not keyboardOnly)) or (a.KeyCode and (not banned[a.KeyCode.Name])) then
  458. local name = (a.UserInputType ~= Enum.UserInputType.Keyboard and a.UserInputType.Name or a.KeyCode.Name);
  459. location[flag] = (a);
  460. button.Text = shortNames[name] or name;
  461.  
  462. else
  463. if (location[flag]) then
  464. if (not pcall(function()
  465. return location[flag].UserInputType
  466. end)) then
  467. local name = tostring(location[flag])
  468. button.Text = shortNames[name] or name
  469. else
  470. local name = (location[flag].UserInputType ~= Enum.UserInputType.Keyboard and location[flag].UserInputType.Name or location[flag].KeyCode.Name);
  471. button.Text = shortNames[name] or name;
  472. end
  473. end
  474. end
  475.  
  476. wait(0.1)
  477. library.binding = false;
  478. end)
  479.  
  480. if location[flag] then
  481. button.Text = shortNames[tostring(location[flag].Name)] or tostring(location[flag].Name)
  482. end
  483.  
  484. library.binds[flag] = {
  485. location = location;
  486. callback = callback;
  487. };
  488.  
  489. self:Resize();
  490. end
  491.  
  492. function types:Section(name)
  493. local order = self:GetOrder();
  494. local determinedSize = UDim2.new(1, 0, 0, 25)
  495. local determinedPos = UDim2.new(0, 0, 0, 4);
  496. local secondarySize = UDim2.new(1, 0, 0, 20);
  497.  
  498. if order == 0 then
  499. determinedSize = UDim2.new(1, 0, 0, 21)
  500. determinedPos = UDim2.new(0, 0, 0, -1);
  501. secondarySize = nil
  502. end
  503.  
  504. local check = library:Create('Frame', {
  505. Name = 'Section';
  506. BackgroundTransparency = 1;
  507. Size = determinedSize;
  508. BackgroundColor3 = library.options.sectncolor;
  509. BorderSizePixel = 0;
  510. LayoutOrder = order;
  511. library:Create('TextLabel', {
  512. Name = 'section_lbl';
  513. Text = name;
  514. BackgroundTransparency = 0;
  515. BorderSizePixel = 0;
  516. BackgroundColor3 = library.options.sectncolor;
  517. TextColor3 = library.options.textcolor;
  518. Position = determinedPos;
  519. Size = (secondarySize or UDim2.new(1, 0, 1, 0));
  520. Font = library.options.font;
  521. TextSize = library.options.fontsize;
  522. TextStrokeTransparency = library.options.textstroke;
  523. TextStrokeColor3 = library.options.strokecolor;
  524. });
  525. Parent = self.container;
  526. });
  527.  
  528. self:Resize();
  529. end
  530.  
  531. function types:Slider(name, options, callback)
  532. local default = options.default or options.min;
  533. local min = options.min or 0;
  534. local max = options.max or 1;
  535. local location = options.location or self.flags;
  536. local precise = options.precise or false -- e.g 0, 1 vs 0, 0.1, 0.2, ...
  537. local flag = options.flag or "";
  538. local callback = callback or function() end
  539.  
  540. location[flag] = default;
  541.  
  542. local check = library:Create('Frame', {
  543. BackgroundTransparency = 1;
  544. Size = UDim2.new(1, 0, 0, 25);
  545. LayoutOrder = self:GetOrder();
  546. library:Create('TextLabel', {
  547. Name = name;
  548. TextStrokeTransparency = library.options.textstroke;
  549. TextStrokeColor3 = library.options.strokecolor;
  550. Text = "\r" .. name;
  551. BackgroundTransparency = 1;
  552. TextColor3 = library.options.textcolor;
  553. Position = UDim2.new(0, 5, 0, 2);
  554. Size = UDim2.new(1, -5, 1, 0);
  555. TextXAlignment = Enum.TextXAlignment.Left;
  556. Font = library.options.font;
  557. TextSize = library.options.fontsize;
  558. library:Create('Frame', {
  559. Name = 'Container';
  560. Size = UDim2.new(0, 60, 0, 20);
  561. Position = UDim2.new(1, -65, 0, 3);
  562. BackgroundTransparency = 1;
  563. --BorderColor3 = library.options.bordercolor;
  564. BorderSizePixel = 0;
  565. library:Create('TextLabel', {
  566. Name = 'ValueLabel';
  567. Text = default;
  568. BackgroundTransparency = 1;
  569. TextColor3 = library.options.textcolor;
  570. Position = UDim2.new(0, -10, 0, 0);
  571. Size = UDim2.new(0, 1, 1, 0);
  572. TextXAlignment = Enum.TextXAlignment.Right;
  573. Font = library.options.font;
  574. TextSize = library.options.fontsize;
  575. TextStrokeTransparency = library.options.textstroke;
  576. TextStrokeColor3 = library.options.strokecolor;
  577. });
  578. library:Create('TextButton', {
  579. Name = 'Button';
  580. Size = UDim2.new(0, 5, 1, -2);
  581. Position = UDim2.new(0, 0, 0, 1);
  582. AutoButtonColor = false;
  583. Text = "";
  584. BackgroundColor3 = Color3.fromRGB(20, 20, 20);
  585. BorderSizePixel = 0;
  586. ZIndex = 2;
  587. TextStrokeTransparency = library.options.textstroke;
  588. TextStrokeColor3 = library.options.strokecolor;
  589. });
  590. library:Create('Frame', {
  591. Name = 'Line';
  592. BackgroundTransparency = 0;
  593. Position = UDim2.new(0, 0, 0.5, 0);
  594. Size = UDim2.new(1, 0, 0, 1);
  595. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  596. BorderSizePixel = 0;
  597. });
  598. })
  599. });
  600. Parent = self.container;
  601. });
  602.  
  603. local overlay = check:FindFirstChild(name);
  604.  
  605. local renderSteppedConnection;
  606. local inputBeganConnection;
  607. local inputEndedConnection;
  608. local mouseLeaveConnection;
  609. local mouseDownConnection;
  610. local mouseUpConnection;
  611.  
  612. check:FindFirstChild(name).Container.MouseEnter:connect(function()
  613. local function update()
  614. if renderSteppedConnection then renderSteppedConnection:disconnect() end
  615.  
  616.  
  617. renderSteppedConnection = game:GetService('RunService').RenderStepped:connect(function()
  618. local mouse = game:GetService("UserInputService"):GetMouseLocation()
  619. local percent = (mouse.X - overlay.Container.AbsolutePosition.X) / (overlay.Container.AbsoluteSize.X)
  620. percent = math.clamp(percent, 0, 1)
  621. percent = tonumber(string.format("%.2f", percent))
  622.  
  623. overlay.Container.Button.Position = UDim2.new(math.clamp(percent, 0, 0.99), 0, 0, 1)
  624.  
  625. local num = min + (max - min) * percent
  626. local value = (precise and num or math.floor(num))
  627.  
  628. overlay.Container.ValueLabel.Text = value;
  629. callback(tonumber(value))
  630. location[flag] = tonumber(value)
  631. end)
  632. end
  633.  
  634. local function disconnect()
  635. if renderSteppedConnection then renderSteppedConnection:disconnect() end
  636. if inputBeganConnection then inputBeganConnection:disconnect() end
  637. if inputEndedConnection then inputEndedConnection:disconnect() end
  638. if mouseLeaveConnection then mouseLeaveConnection:disconnect() end
  639. if mouseUpConnection then mouseUpConnection:disconnect() end
  640. end
  641.  
  642. inputBeganConnection = check:FindFirstChild(name).Container.InputBegan:connect(function(input)
  643. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  644. update()
  645. end
  646. end)
  647.  
  648. inputEndedConnection = check:FindFirstChild(name).Container.InputEnded:connect(function(input)
  649. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  650. disconnect()
  651. end
  652. end)
  653.  
  654. mouseDownConnection = check:FindFirstChild(name).Container.Button.MouseButton1Down:connect(update)
  655. mouseUpConnection = game:GetService("UserInputService").InputEnded:connect(function(a, b)
  656. if a.UserInputType == Enum.UserInputType.MouseButton1 and (mouseDownConnection.Connected) then
  657. disconnect()
  658. end
  659. end)
  660. end)
  661.  
  662. if default ~= min then
  663. local percent = 1 - ((max - default) / (max - min))
  664. local number = default
  665.  
  666. number = tonumber(string.format("%.2f", number))
  667. if (not precise) then
  668. number = math.floor(number)
  669. end
  670.  
  671. overlay.Container.Button.Position = UDim2.new(math.clamp(percent, 0, 0.99), 0, 0, 1)
  672. overlay.Container.ValueLabel.Text = number
  673. end
  674.  
  675. self:Resize();
  676. return {
  677. Set = function(self, value)
  678. local percent = 1 - ((max - value) / (max - min))
  679. local number = value
  680.  
  681. number = tonumber(string.format("%.2f", number))
  682. if (not precise) then
  683. number = math.floor(number)
  684. end
  685.  
  686. overlay.Container.Button.Position = UDim2.new(math.clamp(percent, 0, 0.99), 0, 0, 1)
  687. overlay.Container.ValueLabel.Text = number
  688. location[flag] = number
  689. callback(number)
  690. end
  691. }
  692. end
  693.  
  694. function types:SearchBox(text, options, callback)
  695. local list = options.list or {};
  696. local flag = options.flag or "";
  697. local location = options.location or self.flags;
  698. local callback = callback or function() end;
  699.  
  700. local busy = false;
  701. local box = library:Create('Frame', {
  702. BackgroundTransparency = 1;
  703. Size = UDim2.new(1, 0, 0, 25);
  704. LayoutOrder = self:GetOrder();
  705. library:Create('TextBox', {
  706. Text = "";
  707. PlaceholderText = text;
  708. PlaceholderColor3 = Color3.fromRGB(60, 60, 60);
  709. Font = library.options.font;
  710. TextSize = library.options.fontsize;
  711. Name = 'Box';
  712. Size = UDim2.new(1, -10, 0, 20);
  713. Position = UDim2.new(0, 5, 0, 4);
  714. TextColor3 = library.options.textcolor;
  715. BackgroundColor3 = library.options.dropcolor;
  716. BorderColor3 = library.options.bordercolor;
  717. TextStrokeTransparency = library.options.textstroke;
  718. TextStrokeColor3 = library.options.strokecolor;
  719. library:Create('ScrollingFrame', {
  720. Position = UDim2.new(0, 0, 1, 1);
  721. Name = 'Container';
  722. BackgroundColor3 = library.options.btncolor;
  723. ScrollBarThickness = 0;
  724. BorderSizePixel = 0;
  725. BorderColor3 = library.options.bordercolor;
  726. Size = UDim2.new(1, 0, 0, 0);
  727. library:Create('UIListLayout', {
  728. Name = 'ListLayout';
  729. SortOrder = Enum.SortOrder.LayoutOrder;
  730. });
  731. ZIndex = 2;
  732. });
  733. });
  734. Parent = self.container;
  735. })
  736.  
  737. local function rebuild(text)
  738. box:FindFirstChild('Box').Container.ScrollBarThickness = 0
  739. for i, child in next, box:FindFirstChild('Box').Container:GetChildren() do
  740. if (not child:IsA('UIListLayout')) then
  741. child:Destroy();
  742. end
  743. end
  744.  
  745. if #text > 0 then
  746. for i, v in next, list do
  747. if string.sub(string.lower(v), 1, string.len(text)) == string.lower(text) then
  748. local button = library:Create('TextButton', {
  749. Text = v;
  750. Font = library.options.font;
  751. TextSize = library.options.fontsize;
  752. TextColor3 = library.options.textcolor;
  753. BorderColor3 = library.options.bordercolor;
  754. TextStrokeTransparency = library.options.textstroke;
  755. TextStrokeColor3 = library.options.strokecolor;
  756. Parent = box:FindFirstChild('Box').Container;
  757. Size = UDim2.new(1, 0, 0, 20);
  758. LayoutOrder = i;
  759. BackgroundColor3 = library.options.btncolor;
  760. ZIndex = 2;
  761. })
  762.  
  763. button.MouseButton1Click:connect(function()
  764. busy = true;
  765. box:FindFirstChild('Box').Text = button.Text;
  766. wait();
  767. busy = false;
  768.  
  769. location[flag] = button.Text;
  770. callback(location[flag])
  771.  
  772. box:FindFirstChild('Box').Container.ScrollBarThickness = 0
  773. for i, child in next, box:FindFirstChild('Box').Container:GetChildren() do
  774. if (not child:IsA('UIListLayout')) then
  775. child:Destroy();
  776. end
  777. end
  778. box:FindFirstChild('Box').Container:TweenSize(UDim2.new(1, 0, 0, 0), 'Out', 'Quad', 0.25, true)
  779. end)
  780. end
  781. end
  782. end
  783.  
  784. local c = box:FindFirstChild('Box').Container:GetChildren()
  785. local ry = (20 * (#c)) - 20
  786.  
  787. local y = math.clamp((20 * (#c)) - 20, 0, 100)
  788. if ry > 100 then
  789. box:FindFirstChild('Box').Container.ScrollBarThickness = 5;
  790. end
  791.  
  792. box:FindFirstChild('Box').Container:TweenSize(UDim2.new(1, 0, 0, y), 'Out', 'Quad', 0.25, true)
  793. box:FindFirstChild('Box').Container.CanvasSize = UDim2.new(1, 0, 0, (20 * (#c)) - 20)
  794. end
  795.  
  796. box:FindFirstChild('Box'):GetPropertyChangedSignal('Text'):connect(function()
  797. if (not busy) then
  798. rebuild(box:FindFirstChild('Box').Text)
  799. end
  800. end);
  801.  
  802. local function reload(new_list)
  803. list = new_list;
  804. rebuild("")
  805. end
  806. self:Resize();
  807. return reload, box:FindFirstChild('Box');
  808. end
  809.  
  810. function types:Dropdown(name, options, callback)
  811. local location = options.location or self.flags;
  812. local flag = options.flag or "";
  813. local callback = callback or function() end;
  814. local list = options.list or {};
  815.  
  816. location[flag] = list[1]
  817. local check = library:Create('Frame', {
  818. BackgroundTransparency = 1;
  819. Size = UDim2.new(1, 0, 0, 25);
  820. BackgroundColor3 = Color3.fromRGB(25, 25, 25);
  821. BorderSizePixel = 0;
  822. LayoutOrder = self:GetOrder();
  823. library:Create('Frame', {
  824. Name = 'dropdown_lbl';
  825. BackgroundTransparency = 0;
  826. BackgroundColor3 = library.options.dropcolor;
  827. Position = UDim2.new(0, 5, 0, 4);
  828. BorderColor3 = library.options.bordercolor;
  829. Size = UDim2.new(1, -10, 0, 20);
  830. library:Create('TextLabel', {
  831. Name = 'Selection';
  832. Size = UDim2.new(1, 0, 1, 0);
  833. Text = list[1];
  834. TextColor3 = library.options.textcolor;
  835. BackgroundTransparency = 1;
  836. Font = library.options.font;
  837. TextSize = library.options.fontsize;
  838. TextStrokeTransparency = library.options.textstroke;
  839. TextStrokeColor3 = library.options.strokecolor;
  840. });
  841. library:Create("TextButton", {
  842. Name = 'drop';
  843. BackgroundTransparency = 1;
  844. Size = UDim2.new(0, 20, 1, 0);
  845. Position = UDim2.new(1, -25, 0, 0);
  846. Text = 'v';
  847. TextColor3 = library.options.textcolor;
  848. Font = library.options.font;
  849. TextSize = library.options.fontsize;
  850. TextStrokeTransparency = library.options.textstroke;
  851. TextStrokeColor3 = library.options.strokecolor;
  852. })
  853. });
  854. Parent = self.container;
  855. });
  856.  
  857. local button = check:FindFirstChild('dropdown_lbl').drop;
  858. local input;
  859.  
  860. button.MouseButton1Click:connect(function()
  861. if (input and input.Connected) then
  862. return
  863. end
  864.  
  865. check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').TextColor3 = Color3.fromRGB(60, 60, 60);
  866. check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').Text = name;
  867. local c = 0;
  868. for i, v in next, list do
  869. c = c + 20;
  870. end
  871.  
  872. local size = UDim2.new(1, 0, 0, c)
  873.  
  874. local clampedSize;
  875. local scrollSize = 0;
  876. if size.Y.Offset > 100 then
  877. clampedSize = UDim2.new(1, 0, 0, 100)
  878. scrollSize = 5;
  879. end
  880.  
  881. local goSize = (clampedSize ~= nil and clampedSize) or size;
  882. local container = library:Create('ScrollingFrame', {
  883. TopImage = 'rbxasset://textures/ui/Scroll/scroll-middle.png';
  884. BottomImage = 'rbxasset://textures/ui/Scroll/scroll-middle.png';
  885. Name = 'DropContainer';
  886. Parent = check:FindFirstChild('dropdown_lbl');
  887. Size = UDim2.new(1, 0, 0, 0);
  888. BackgroundColor3 = library.options.bgcolor;
  889. BorderColor3 = library.options.bordercolor;
  890. Position = UDim2.new(0, 0, 1, 0);
  891. ScrollBarThickness = scrollSize;
  892. CanvasSize = UDim2.new(0, 0, 0, size.Y.Offset);
  893. ZIndex = 5;
  894. ClipsDescendants = true;
  895. library:Create('UIListLayout', {
  896. Name = 'List';
  897. SortOrder = Enum.SortOrder.LayoutOrder
  898. })
  899. })
  900.  
  901. for i, v in next, list do
  902. local btn = library:Create('TextButton', {
  903. Size = UDim2.new(1, 0, 0, 20);
  904. BackgroundColor3 = library.options.btncolor;
  905. BorderColor3 = library.options.bordercolor;
  906. Text = v;
  907. Font = library.options.font;
  908. TextSize = library.options.fontsize;
  909. LayoutOrder = i;
  910. Parent = container;
  911. ZIndex = 5;
  912. TextColor3 = library.options.textcolor;
  913. TextStrokeTransparency = library.options.textstroke;
  914. TextStrokeColor3 = library.options.strokecolor;
  915. })
  916.  
  917. btn.MouseButton1Click:connect(function()
  918. check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').TextColor3 = library.options.textcolor
  919. check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').Text = btn.Text;
  920.  
  921. location[flag] = tostring(btn.Text);
  922. callback(location[flag])
  923.  
  924. game:GetService('Debris'):AddItem(container, 0)
  925. input:disconnect();
  926. end)
  927. end
  928.  
  929. container:TweenSize(goSize, 'Out', 'Quad', 0.15, true)
  930.  
  931. local function isInGui(frame)
  932. local mloc = game:GetService('UserInputService'):GetMouseLocation();
  933. local mouse = Vector2.new(mloc.X, mloc.Y - 36);
  934.  
  935. local x1, x2 = frame.AbsolutePosition.X, frame.AbsolutePosition.X + frame.AbsoluteSize.X;
  936. local y1, y2 = frame.AbsolutePosition.Y, frame.AbsolutePosition.Y + frame.AbsoluteSize.Y;
  937.  
  938. return (mouse.X >= x1 and mouse.X <= x2) and (mouse.Y >= y1 and mouse.Y <= y2)
  939. end
  940.  
  941. input = game:GetService('UserInputService').InputBegan:connect(function(a)
  942. if a.UserInputType == Enum.UserInputType.MouseButton1 and (not isInGui(container)) then
  943. check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').TextColor3 = library.options.textcolor
  944. check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').Text = location[flag];
  945.  
  946. container:TweenSize(UDim2.new(1, 0, 0, 0), 'In', 'Quad', 0.15, true)
  947. wait(0.15)
  948.  
  949. game:GetService('Debris'):AddItem(container, 0)
  950. input:disconnect();
  951. end
  952. end)
  953. end)
  954.  
  955. self:Resize();
  956. local function reload(self, array)
  957. options = array;
  958. location[flag] = array[1];
  959. pcall(function()
  960. input:disconnect()
  961. end)
  962. check:WaitForChild('dropdown_lbl').Selection.Text = location[flag]
  963. check:FindFirstChild('dropdown_lbl'):WaitForChild('Selection').TextColor3 = library.options.textcolor
  964. game:GetService('Debris'):AddItem(container, 0)
  965. end
  966.  
  967. return {
  968. Refresh = reload;
  969. }
  970. end
  971. end
  972.  
  973. function library:Create(class, data)
  974. local obj = Instance.new(class);
  975. for i, v in next, data do
  976. if i ~= 'Parent' then
  977.  
  978. if typeof(v) == "Instance" then
  979. v.Parent = obj;
  980. else
  981. obj[i] = v
  982. end
  983. end
  984. end
  985.  
  986. obj.Parent = data.Parent;
  987. return obj
  988. end
  989.  
  990. function library:CreateWindow(name, options)
  991. if (not library.container) then
  992. library.container = self:Create("ScreenGui", {
  993. self:Create('Frame', {
  994. Name = 'Container';
  995. Size = UDim2.new(0, 205, 0, 45);
  996. Position = UDim2.new(0, 20, 0, 20);
  997. BackgroundTransparency = 1;
  998. Active = false;
  999. });
  1000. Parent = game:GetService("CoreGui");
  1001. }):FindFirstChild('Container');
  1002. end
  1003.  
  1004. if (not library.options) then
  1005. library.options = setmetatable(options or {}, {__index = defaults})
  1006. end
  1007.  
  1008. local window = types.window(name, library.options);
  1009. dragger.new(window.object);
  1010. return window
  1011. end
  1012.  
  1013. default = {
  1014. topcolor = Color3.fromRGB(29, 29, 29);
  1015. titlecolor = Color3.fromRGB(255, 255, 255);
  1016.  
  1017. buttonbordersizepixel = 0;
  1018. underlinecolor = Color3.fromRGB(29, 29, 29);
  1019. bgcolor = Color3.fromRGB(22, 22, 22);
  1020. boxcolor = Color3.fromRGB(35, 35, 35);
  1021. btncolor = Color3.fromRGB(36, 36, 36);
  1022. dropcolor = Color3.fromRGB(25, 25, 25);
  1023. sectncolor = Color3.fromRGB(25, 25, 25);
  1024. bordercolor = Color3.fromRGB(80, 80, 80);
  1025.  
  1026. font = Enum.Font.SourceSans;
  1027. titlefont = Enum.Font.Code;
  1028.  
  1029. fontsize = 16;
  1030. titlesize = 16;
  1031.  
  1032. textstroke = 1;
  1033. titlestroke = 1;
  1034.  
  1035. strokecolor = Color3.fromRGB(0, 0, 0);
  1036.  
  1037. textcolor = Color3.fromRGB(255, 255, 255);
  1038. titletextcolor = Color3.fromRGB(255, 255, 255);
  1039.  
  1040. placeholdercolor = Color3.fromRGB(255, 255, 255);
  1041. titlestrokecolor = Color3.fromRGB(0, 0, 0);
  1042. }
  1043. library.options = setmetatable({}, {__index = default})
  1044.  
  1045. spawn(function()
  1046. while true do
  1047. for i=0, 1, 1 / 300 do
  1048. for _, obj in next, library.rainbowtable do
  1049. obj.BackgroundColor3 = Color3.fromHSV(i, 1, 1);
  1050. end
  1051. wait()
  1052. end;
  1053. end
  1054. end)
  1055.  
  1056. local function isreallypressed(bind, inp)
  1057. local key = bind
  1058. if typeof(key) == "Instance" then
  1059. if key.UserInputType == Enum.UserInputType.Keyboard and inp.KeyCode == key.KeyCode then
  1060. return true;
  1061. elseif tostring(key.UserInputType):find('MouseButton') and inp.UserInputType == key.UserInputType then
  1062. return true
  1063. end
  1064. end
  1065. if tostring(key):find'MouseButton1' then
  1066. return key == inp.UserInputType
  1067. else
  1068. return key == inp.KeyCode
  1069. end
  1070. end
  1071.  
  1072. game:GetService("UserInputService").InputBegan:connect(function(input)
  1073. if (not library.binding) then
  1074. for idx, binds in next, library.binds do
  1075. local real_binding = binds.location[idx];
  1076. if real_binding and isreallypressed(real_binding, input) then
  1077. binds.callback()
  1078. end
  1079. end
  1080. end
  1081. end)
  1082. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement