Advertisement
Guest User

Untitled

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