Advertisement
urmomkindagaytho

Untitled

Feb 23rd, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.RightControl 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.SourceSansSemibold;
  69. TextSize = options.titlesize;
  70. Font = Enum.Font.SourceSansSemibold;
  71. TextColor3 = options.titletextcolor;
  72. TextStrokeTransparency = library.options.titlestroke;
  73. TextStrokeColor3 = library.options.titlestrokecolor;
  74. ZIndex = 3;
  75. });
  76. library:Create("TextButton", {
  77. Size = UDim2.new(0, 30, 0, 30);
  78. Position = UDim2.new(1, -35, 0, 0);
  79. BackgroundTransparency = 1;
  80. Text = "-";
  81. TextSize = options.titlesize;
  82. Font = Enum.Font.SourceSansSemibold;--Enum.Font.Code;
  83. Name = 'window_toggle';
  84. TextColor3 = options.titletextcolor;
  85. TextStrokeTransparency = library.options.titlestroke;
  86. TextStrokeColor3 = library.options.titlestrokecolor;
  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").Text = (window.toggled and "+" or "-")
  132. if (not window.toggled) then
  133. window.container.ClipsDescendants = true;
  134. end
  135. wait();
  136. local y = 0;
  137. for i, v in next, window.container:GetChildren() do
  138. if (not v:IsA('UIListLayout')) then
  139. y = y + v.AbsoluteSize.Y;
  140. end
  141. end
  142.  
  143. local targetSize = window.toggled and UDim2.new(1, 0, 0, y+5) or UDim2.new(1, 0, 0, 0);
  144. local targetDirection = window.toggled and "In" or "Out"
  145.  
  146. window.container:TweenSize(targetSize, targetDirection, "Quad", 0.15, true)
  147. wait(.15)
  148. if window.toggled then
  149. window.container.ClipsDescendants = false;
  150. end
  151. end)
  152.  
  153. return window;
  154. end
  155.  
  156. function types:Resize()
  157. local y = 0;
  158. for i, v in next, self.container:GetChildren() do
  159. if (not v:IsA('UIListLayout')) then
  160. y = y + v.AbsoluteSize.Y;
  161. end
  162. end
  163. self.container.Size = UDim2.new(1, 0, 0, y+5)
  164. end
  165.  
  166. function types:GetOrder()
  167. local c = 0;
  168. for i, v in next, self.container:GetChildren() do
  169. if (not v:IsA('UIListLayout')) then
  170. c = c + 1
  171. end
  172. end
  173. return c
  174. end
  175.  
  176. function types:Label(text)
  177. local v = game:GetService'TextService':GetTextSize(text, 18, Enum.Font.SourceSans, Vector2.new(math.huge, math.huge))
  178. local object = library:Create('Frame', {
  179. Size = UDim2.new(1, 0, 0, v.Y + 5);
  180. BackgroundTransparency = 1;
  181. library:Create('TextLabel', {
  182. Size = UDim2.new(1, 0, 1, 0);
  183. Position = UDim2.new(0, 10, 0, 0);
  184. LayoutOrder = self:GetOrder();
  185.  
  186. Text = text;
  187. TextSize = 18;
  188. Font = Enum.Font.SourceSansLight;
  189. TextColor3 = Color3.fromRGB(255, 255, 255);
  190. BackgroundTransparency = 1;
  191. TextXAlignment = Enum.TextXAlignment.Left;
  192. TextWrapped = true;
  193. });
  194. Parent = self.container
  195. })
  196. self:Resize();
  197. end
  198.  
  199. function types:Toggle(name, options, callback)
  200. local default = options.default or false;
  201. local location = options.location or self.flags;
  202. local flag = options.flag or "";
  203. local callback = callback or function() end;
  204.  
  205. location[flag] = default;
  206.  
  207. local check = library:Create('Frame', {
  208. BackgroundTransparency = 1;
  209. Size = UDim2.new(1, 0, 0, 25);
  210. LayoutOrder = self:GetOrder();
  211. library:Create('TextLabel', {
  212. Name = name;
  213. Text = "\r" .. name;
  214. BackgroundTransparency = 1;
  215. TextColor3 = library.options.textcolor;
  216. Position = UDim2.new(0, 5, 0, 0);
  217. Size = UDim2.new(1, -5, 1, 0);
  218. TextXAlignment = Enum.TextXAlignment.Left;
  219. Font = Enum.Font.SourceSansLight;
  220. TextSize = library.options.fontsize;
  221. TextStrokeTransparency = library.options.textstroke;
  222. TextStrokeColor3 = library.options.strokecolor;
  223. library:Create('TextButton', {
  224. Text = (location[flag] and "◻️" or "");
  225. Font = Enum.Font.SourceSansLight;
  226. TextSize = library.options.fontsize;
  227. Name = 'Checkmark';
  228. Size = UDim2.new(0, 20, 0, 20);
  229. Position = UDim2.new(1, -25, 0, 4);
  230. TextColor3 = library.options.textcolor;
  231. BackgroundColor3 = library.options.bgcolor;
  232. BorderColor3 = Color3.fromRGB(55, 55, 55);
  233. TextStrokeTransparency = library.options.textstroke;
  234. TextStrokeColor3 = library.options.strokecolor;
  235. })
  236. });
  237. Parent = self.container;
  238. });
  239.  
  240. local function click(t)
  241. location[flag] = not location[flag];
  242. callback(location[flag])
  243. check:FindFirstChild(name).Checkmark.Text = location[flag] and "◻️" or "";
  244. end
  245.  
  246. check:FindFirstChild(name).Checkmark.MouseButton1Click:connect(click)
  247. library.callbacks[flag] = click;
  248.  
  249. if location[flag] == true then
  250. callback(location[flag])
  251. end
  252.  
  253. self:Resize();
  254. return {
  255. Set = function(self, b)
  256. location[flag] = b;
  257. callback(location[flag])
  258. check:FindFirstChild(name).Checkmark.Text = location[flag] and "◻️" or "";
  259. end
  260. }
  261. end
  262.  
  263. function types:Button(name, callback)
  264. callback = callback or function() end;
  265.  
  266. local check = library:Create('Frame', {
  267. BackgroundTransparency = 1;
  268. Size = UDim2.new(1, 0, 0, 25);
  269. LayoutOrder = self:GetOrder();
  270. library:Create('TextButton', {
  271. Name = name;
  272. Text = name;
  273. BackgroundColor3 = library.options.btncolor;
  274. BorderColor3 = library.options.bordercolor;
  275. TextStrokeTransparency = library.options.textstroke;
  276. TextStrokeColor3 = library.options.strokecolor;
  277. TextColor3 = library.options.textcolor;
  278. Position = UDim2.new(0, 5, 0, 5);
  279. Size = UDim2.new(1, -10, 0, 20);
  280. Font = Enum.Font.SourceSansLight;
  281. TextSize = library.options.fontsize;
  282. });
  283. Parent = self.container;
  284. });
  285.  
  286. check:FindFirstChild(name).MouseButton1Click:connect(callback)
  287. self:Resize();
  288.  
  289. return {
  290. Fire = function()
  291. callback();
  292. end
  293. }
  294. end
  295.  
  296. function types:Box(name, options, callback) --type, default, data, location, flag)
  297. local type = options.type or "";
  298. local default = options.default or "";
  299. local data = options.data
  300. local location = options.location or self.flags;
  301. local flag = options.flag or "";
  302. local callback = callback or function() end;
  303. local min = options.min or 0;
  304. local max = options.max or 9e9;
  305.  
  306. if type == 'number' and (not tonumber(default)) then
  307. location[flag] = default;
  308. else
  309. location[flag] = "";
  310. default = "";
  311. end
  312.  
  313. local check = library:Create('Frame', {
  314. BackgroundTransparency = 1;
  315. Size = UDim2.new(1, 0, 0, 25);
  316. LayoutOrder = self:GetOrder();
  317. library:Create('TextLabel', {
  318. Name = name;
  319. Text = "\r" .. name;
  320. BackgroundTransparency = 1;
  321. TextColor3 = library.options.textcolor;
  322. TextStrokeTransparency = library.options.textstroke;
  323. TextStrokeColor3 = library.options.strokecolor;
  324. Position = UDim2.new(0, 5, 0, 0);
  325. Size = UDim2.new(1, -5, 1, 0);
  326. TextXAlignment = Enum.TextXAlignment.Left;
  327. Font = Enum.Font.SourceSansLight;
  328. TextSize = library.options.fontsize;
  329. library:Create('TextBox', {
  330. TextStrokeTransparency = library.options.textstroke;
  331. TextStrokeColor3 = library.options.strokecolor;
  332. Text = tostring(default);
  333. Font = Enum.Font.SourceSansLight;
  334. TextSize = library.options.fontsize;
  335. Name = 'Box';
  336. Size = UDim2.new(0, 60, 0, 20);
  337. Position = UDim2.new(1, -65, 0, 3);
  338. TextColor3 = library.options.textcolor;
  339. BackgroundColor3 = library.options.boxcolor;
  340. BorderColor3 = library.options.bordercolor;
  341. PlaceholderColor3 = library.options.placeholdercolor;
  342. })
  343. });
  344. Parent = self.container;
  345. });
  346.  
  347. local box = check:FindFirstChild(name):FindFirstChild('Box');
  348. box.FocusLost:connect(function(e)
  349. local old = location[flag];
  350. if type == "number" then
  351. local num = tonumber(box.Text)
  352. if (not num) then
  353. box.Text = tonumber(location[flag])
  354. else
  355. location[flag] = math.clamp(num, min, max)
  356. box.Text = tonumber(location[flag])
  357. end
  358. else
  359. location[flag] = tostring(box.Text)
  360. end
  361.  
  362. callback(location[flag], old, e)
  363. end)
  364.  
  365. if type == 'number' then
  366. box:GetPropertyChangedSignal('Text'):connect(function()
  367. box.Text = string.gsub(box.Text, "[%a+]", "");
  368. end)
  369. end
  370.  
  371. self:Resize();
  372. return box
  373. end
  374.  
  375. function types:Bind(name, options, callback)
  376. local location = options.location or self.flags;
  377. local keyboardOnly = options.kbonly or false
  378. local flag = options.flag or "";
  379. local callback = callback or function() end;
  380. local default = options.default;
  381.  
  382. local passed = true;
  383. if keyboardOnly and (tostring(default):find('MouseButton')) then
  384. passed = false
  385. end
  386. if passed 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 = Enum.Font.SourceSansLight;
  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 = Enum.Font.SourceSansLight;
  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 = Enum.Font.SourceSansItalic;
  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 = Enum.Font.SourceSansLight;
  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 = Enum.Font.SourceSansLight;
  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 = Enum.Font.SourceSansLight;
  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 = Enum.Font.SourceSansLight;
  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 = Enum.Font.SourceSansLight;
  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 = Enum.Font.SourceSansLight;
  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 = Enum.Font.SourceSansLight;
  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(1, -30, 1, 0);
  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(40, 40, 40);
  1015. titlecolor = Color3.fromRGB(255, 255, 255);
  1016.  
  1017. underlinecolor = Color3.fromRGB(0, 255, 140);
  1018. bgcolor = Color3.fromRGB(45, 45, 45);
  1019. boxcolor = Color3.fromRGB(35, 35, 35);
  1020. btncolor = Color3.fromRGB(35, 35, 35);
  1021. dropcolor = Color3.fromRGB(35, 35, 35);
  1022. sectncolor = Color3.fromRGB(35, 35, 35);
  1023. bordercolor = Color3.fromRGB(35, 35, 35);
  1024.  
  1025. font = Enum.Font.SourceSans;
  1026. titlefont = Enum.Font.Code;
  1027.  
  1028. fontsize = 17;
  1029. titlesize = 18;
  1030.  
  1031. textstroke = 1;
  1032. titlestroke = 1;
  1033.  
  1034. strokecolor = Color3.fromRGB(0, 0, 0);
  1035.  
  1036. textcolor = Color3.fromRGB(255, 255, 255);
  1037. titletextcolor = Color3.fromRGB(255, 255, 255);
  1038.  
  1039. placeholdercolor = Color3.fromRGB(255, 255, 255);
  1040. titlestrokecolor = Color3.fromRGB(0, 0, 0);
  1041. }
  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
  1083.  
  1084. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement