sbfashfbsajfhsbafbas

Untitled

Sep 21st, 2020
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.52 KB | None | 0 0
  1. local function initLibrary()
  2. local library = {flags = {}, callbacks = {}, rainbowI = 0};
  3.  
  4. local GetService = game.GetService;
  5. local Players = GetService(game, "Players");
  6. local RunService = GetService(game, "RunService");
  7. local CoreGui = GetService(game, "CoreGui");
  8. local TweenService = GetService(game, "TweenService");
  9. local UserInputService = GetService(game, "UserInputService");
  10.  
  11. local LocalPlayer = Players.LocalPlayer;
  12.  
  13. do -- library funcs
  14.  
  15. function library:Create(class, data)
  16. local obj = Instance.new(class);
  17. for i, v in next, data do
  18. if i ~= 'Parent' then
  19. if typeof(v) == "Instance" then
  20. v.Parent = obj;
  21. else
  22. obj[i] = v
  23. end
  24. end
  25. end
  26.  
  27. obj.Parent = data.Parent;
  28. return obj;
  29. end;
  30.  
  31. function library:Dragger(Frame)
  32. dragToggle = nil
  33. dragSpeed = 0.1
  34. dragInput = nil
  35. dragStart = nil
  36. dragPos = nil
  37.  
  38. function updateInput(input)
  39. Delta = input.Position - dragStart
  40. Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y)
  41. game:GetService("TweenService"):Create(Frame, TweenInfo.new(dragSpeed), {Position = Position}):Play()
  42. end
  43.  
  44. Frame.InputBegan:Connect(function(input)
  45. if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
  46. dragToggle = true
  47. dragStart = input.Position
  48. startPos = Frame.Position
  49. input.Changed:Connect(function()
  50. if (input.UserInputState == Enum.UserInputState.End) then
  51. dragToggle = false
  52. end
  53. end)
  54. end
  55. end)
  56.  
  57. Frame.InputChanged:Connect(function(input)
  58. if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  59. dragInput = input
  60. end
  61. end)
  62.  
  63. game:GetService("UserInputService").InputChanged:Connect(function(input)
  64. if (input == dragInput and dragToggle) then
  65. updateInput(input)
  66. end
  67. end)
  68. end;
  69.  
  70. function library:Tween(instance, properties, callback)
  71. local callback = callback or function() end;
  72. local time = properties.time;
  73. properties.time = nil;
  74. local anim = TweenService:Create(instance, TweenInfo.new(time), properties);
  75.  
  76. anim.Completed:Connect(callback);
  77. anim:Play();
  78. return anim;
  79. end;
  80.  
  81. local ui_Settings = {
  82. mainColor = Color3.fromRGB(36, 36, 36);
  83. bottomColor = Color3.fromRGB(34, 34, 34);
  84. borderColor = Color3.fromRGB(42, 42, 42);
  85. scrollingBarColor = Color3.fromRGB(115, 41, 255);
  86. toggleColor = Color3.fromRGB(34, 34, 34);
  87. toggleBorderColor = Color3.fromRGB(102, 41, 255);
  88. boxColor = Color3.fromRGB(32, 32, 32);
  89. boxBorderColor = Color3.fromRGB(102, 41, 255);
  90. gradientColorSection = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(102, 41, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(122, 41, 255))};
  91. gradientColor = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(102, 41, 255)), ColorSequenceKeypoint.new(0, Color3.fromRGB(142, 61, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(210, 74, 255))};
  92. shadowGradientColor = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(20, 20, 20)), ColorSequenceKeypoint.new(1, Color3.fromRGB(36, 36, 36))};
  93. };
  94.  
  95. UserInputService.InputBegan:Connect(function(input)
  96. for i, v in next, library.flags do
  97. if(v == input.KeyCode) then
  98. library.callbacks[i]();
  99. elseif(v == input.UserInputType) then
  100. library.callbacks[i]();
  101. end;
  102. end;
  103. end);
  104.  
  105. local gui = Instance.new("ScreenGui", CoreGui);
  106. gui.Enabled = false;
  107. library.gui = gui;
  108.  
  109. local main = library:Create("Frame", {
  110. Name = "main";
  111. Parent = gui;
  112. Position = UDim2.new(0.5, -200, 0.5, -135);
  113. BorderSizePixel = 0;
  114. BackgroundColor3 = ui_Settings.mainColor; -- main color
  115. Size = UDim2.new(0, 400,0, 270);
  116. library:Create("ImageLabel", {
  117. Name = "Search";
  118. BackgroundTransparency = 1.000;
  119. Position = UDim2.new(0, 4, 0, 46);
  120. Size = UDim2.new(1, -8, 0, 26);
  121. Image = "rbxassetid://4641155515";
  122. ImageColor3 = Color3.fromRGB(30, 30, 30);
  123. ScaleType = Enum.ScaleType.Slice;
  124. SliceCenter = Rect.new(4, 4, 296, 296);
  125. library:Create("TextBox", {
  126. Name = "textbox";
  127. BackgroundTransparency = 1.000;
  128. Position = UDim2.new(1, -362, 0, 0);
  129. Size = UDim2.new(1, -30, 1, 0);
  130. Font = Enum.Font.Gotham;
  131. PlaceholderText = "Search";
  132. Text = "";
  133. TextColor3 = Color3.fromRGB(255, 255, 255);
  134. TextSize = 14.000;
  135. TextXAlignment = Enum.TextXAlignment.Left;
  136. });
  137. library:Create("ImageLabel", {
  138. Name = "icon";
  139. BackgroundTransparency = 1.000;
  140. Position = UDim2.new(0, 2, 0, 1);
  141. Size = UDim2.new(0, 24, 0, 24);
  142. Image = "http://www.roblox.com/asset/?id=4645651350";
  143. library:Create("UIGradient", {
  144. Color = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(39, 133, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(210, 74, 255))};
  145. Rotation = 45;
  146. });
  147. });
  148. });
  149. library:Create("Frame", {
  150. Name = "border";
  151. BackgroundColor3 = ui_Settings.bottomColor;
  152. BorderColor3 = ui_Settings.borderColor;
  153. BorderSizePixel = 1;
  154. Position = UDim2.new(0, 5, 0, 78);
  155. Size = UDim2.new(0, 390, 0, 186);
  156. library:Create("Frame", {
  157. Name = "shadow";
  158. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  159. BackgroundTransparency = 0.100;
  160. BorderSizePixel = 0;
  161. Position = UDim2.new(0, 0, 1, -8);
  162. Size = UDim2.new(1, 0, 0, 8);
  163. library:Create("UIGradient", {
  164. Color = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(20, 20, 20)), ColorSequenceKeypoint.new(1, Color3.fromRGB(36, 36, 36))};
  165. Rotation = 270;
  166. Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0.00, 0.00), NumberSequenceKeypoint.new(1.00, 1.00)};
  167. });
  168. });
  169. library:Create("Frame", {
  170. Name = "shadow";
  171. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  172. BackgroundTransparency = 0.100;
  173. BorderSizePixel = 0;
  174. Size = UDim2.new(1, 0, 0, 8);
  175. library:Create("UIGradient", {
  176. Color = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(20, 20, 20)), ColorSequenceKeypoint.new(1, Color3.fromRGB(36, 36, 36))};
  177. Rotation = 90;
  178. Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0.00, 0.00), NumberSequenceKeypoint.new(1.00, 1.00)};
  179. });
  180. });
  181. });
  182. library:Create("Frame", {
  183. Name = "bar";
  184. BorderSizePixel = 0;
  185. BackgroundColor3 = Color3.fromRGB(255, 255, 255); -- bar color
  186. Size = UDim2.new(1, 0,0, 4);
  187. Position = UDim2.new(0, 0, 0, 0);
  188. library:Create("UIGradient", {
  189. Color = ui_Settings.gradientColor;
  190. });
  191. library:Create("Frame", {
  192. Name = "bottom";
  193. BorderSizePixel = 0;
  194. BackgroundColor3 = ui_Settings.bottomColor;
  195. Position = UDim2.new(0, 0, 0, 4);
  196. Size = UDim2.new(1, 0, 0, 34);
  197. library:Create("Frame", {
  198. BackgroundTransparency = 0.1;
  199. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  200. BorderSizePixel = 0;
  201. Name = "shadow";
  202. Position = UDim2.new(0, 0, 1, 0);
  203. });
  204. library:Create("TextLabel", {
  205. Name = "Title";
  206. BackgroundTransparency = 1;
  207. Position = UDim2.new(0, 10, 0.5, -10);
  208. Size = UDim2.new(0, 70, 0, 24);
  209. TextColor3 = Color3.fromRGB(255, 255, 255);
  210. Text = "Ducky";
  211. Font = "GothamSemibold";
  212. TextSize = 14;
  213. library:Create("UIGradient", {
  214. Color = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(39, 133, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(210, 74, 255))}
  215. });
  216. });
  217. library:Create("Frame", {
  218. Name = "topcontainer";
  219. BackgroundTransparency = 1;
  220. BorderSizePixel = 0;
  221. Position = UDim2.new(0, 88, 0, 9);
  222. Size = UDim2.new(1, -90, 0.73, 0);
  223. library:Create("UIListLayout", {
  224. Padding = UDim.new(0, 2);
  225. FillDirection = "Horizontal";
  226. HorizontalAlignment = "Left";
  227. SortOrder = "LayoutOrder";
  228. VerticalAlignment = "Top";
  229. });
  230. });
  231. });
  232. });
  233. });
  234.  
  235. local modal = Instance.new("TextButton", main);
  236. modal.Modal = true;
  237. modal.BackgroundTransparency = 1;
  238. modal.Text = "";
  239.  
  240. main.Search.textbox.Changed:Connect(function()
  241. local Entry = main.Search.textbox.Text:lower();
  242.  
  243. if(Entry ~= "") then
  244. for i,v in next, library.currentSection:GetChildren() do
  245. if(not v:IsA("UIPadding") and not v:IsA("UIListLayout")) then
  246. local label = v:FindFirstChild("label");
  247. local button = v:FindFirstChild("button");
  248.  
  249. local find = false;
  250. if(label and label.Text:gsub("%s", ""):lower():sub(1, #Entry) == Entry) then
  251. v.Visible = true;
  252. find = true;
  253. end;
  254.  
  255. if(button and button:FindFirstChild("label") and button.label.Text:gsub("%s", ""):lower():sub(1, #Entry) == Entry) then
  256. v.Visible = true;
  257. find = true;
  258. end;
  259.  
  260. if(not find) then
  261. v.Visible = false;
  262. end;
  263. end;
  264. end;
  265. elseif library.currentSection then
  266. for i,v in next, library.currentSection:GetChildren() do
  267. if(not v:IsA("UIPadding") and not v:IsA("UIListLayout")) then
  268. v.Visible = true;
  269. end;
  270. end;
  271. end;
  272.  
  273. library.currentSectionObject:Update();
  274. end);
  275.  
  276. library:Dragger(main.bar.bottom)
  277. library:Dragger(main)
  278.  
  279. function library:Ready()
  280. gui.Enabled = true;
  281. end;
  282.  
  283. function library:CreateSection(name)
  284. local topContainer = gui.main.bar.bottom.topcontainer;
  285.  
  286. local sectionSelector = library:Create("ImageButton", {
  287. Parent = topContainer;
  288. BackgroundTransparency = 1;
  289. Size = UDim2.new(0, 60, 1, 0);
  290. Image = "rbxassetid://4641155773";
  291. ImageColor3 = Color3.fromRGB(255, 255, 255);
  292. ScaleType = "Slice";
  293. SliceCenter = Rect.new(4, 4, 296, 296);
  294. SliceScale = 1;
  295. Name = "back";
  296. library:Create("UIGradient", {
  297. Color = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(102, 41, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(132, 41, 255))}
  298. });
  299. library:Create("TextLabel", {
  300. BackgroundTransparency = 1;
  301. Text = name;
  302. Size = UDim2.new(1, 0, 1, 0);
  303. TextColor3 = Color3.fromRGB(255, 255, 255);
  304. });
  305. });
  306.  
  307. local boxContainer = library:Create("ScrollingFrame", {
  308. Name = "box";
  309. BorderSizePixel = 0;
  310. BackgroundColor3 = Color3.fromRGB(34, 34, 34);
  311. Parent = main.border;
  312. Position = UDim2.new(0, 1, 0, 1);
  313. Size = UDim2.new(1, -2, 1, -2);
  314. BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png";
  315. TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png";
  316. ScrollBarThickness = 4;
  317. CanvasSize = UDim2.new(0, 0, 0, 0);
  318. library:Create("UIPadding", {
  319. PaddingTop = UDim.new(0, 2);
  320. PaddingLeft = UDim.new(0, 2);
  321. });
  322. library:Create("UIListLayout", {
  323. Padding = UDim.new(0, 5);
  324. FillDirection = "Vertical";
  325. HorizontalAlignment = "Left";
  326. VerticalAlignment = "Top";
  327. });
  328. });
  329.  
  330. local section = {};
  331.  
  332. boxContainer.ChildAdded:Connect(function(Obj)
  333. section:Update();
  334. end);
  335.  
  336. if(not library.currentSection) then
  337. library.currentSectionSelector = sectionSelector;
  338. library.currentSection = boxContainer;
  339. library.currentSectionObject = section;
  340.  
  341. library.currentSectionSelector.ImageColor3 = Color3.fromRGB(150, 150, 150);
  342. boxContainer.Visible = true;
  343. else
  344. boxContainer.Visible = false;
  345. end;
  346.  
  347. sectionSelector.MouseButton1Click:Connect(function()
  348. if(library.currentSection) then
  349. library.currentSectionSelector.ImageColor3 = Color3.fromRGB(255, 255, 255);
  350. library.currentSection.Visible = false;
  351. end;
  352.  
  353. sectionSelector.ImageColor3 = Color3.fromRGB(150, 150, 150);
  354. boxContainer.Visible = true;
  355. library.currentSectionSelector = sectionSelector;
  356. library.currentSection = boxContainer;
  357. end);
  358.  
  359. function section:Update()
  360. local CanvasSize = UDim2.new(0, 0, 0, 85)
  361. for i,v in next, boxContainer:GetChildren() do
  362. if(not v:IsA("UIListLayout") and not v:IsA("UIPadding") and v.Visible) then
  363. CanvasSize = CanvasSize + UDim2.new(0, 0, 0, v.AbsoluteSize.Y + 5);
  364. end;
  365. end;
  366.  
  367. library:Tween(boxContainer, {time = 0.1, CanvasSize = CanvasSize});
  368. end;
  369.  
  370. function section:Label(labelName)
  371. local holder = library:Create("Frame", {
  372. Name = "holder";
  373. Parent = boxContainer;
  374. BackgroundColor3 = Color3.fromRGB(25, 25, 25);
  375. BorderSizePixel = 0;
  376. Position = UDim2.new(0, 0, 0, 350);
  377. Size = UDim2.new(1, 0, 0, 18);
  378. library:Create("TextLabel", {
  379. Name = "label";
  380. BackgroundTransparency = 1.000;
  381. Size = UDim2.new(1, 0, 1, 0);
  382. Font = "Gotham";
  383. Text = labelName;
  384. TextColor3 = Color3.fromRGB(255, 255, 255);
  385. TextSize = 12.000;
  386. });
  387. });
  388.  
  389. local LabelChange = {}
  390.  
  391. function LabelChange:Change(NetText)
  392. holder:FindFirstChild("label").Text = NetText
  393. end
  394.  
  395. function LabelChange:SetColor(C)
  396. holder:FindFirstChild("label").TextColor3 = C
  397. end
  398.  
  399. return LabelChange;
  400. end;
  401.  
  402. function section:Toggle(toggleName, callback)
  403. local callback = callback or function() end;
  404. local toggle = false;
  405.  
  406. library.flags[toggleName] = toggle;
  407.  
  408. local holder = library:Create("Frame", {
  409. BackgroundTransparency = 1;
  410. Parent = boxContainer;
  411. Size = UDim2.new(1, -20, 0, 18);
  412. Name = "holder";
  413. library:Create("TextLabel", {
  414. Name = "label";
  415. BackgroundTransparency = 1;
  416. TextColor3 = Color3.fromRGB(255, 255, 255);
  417. Position = UDim2.new(0, 22, 0, 0);
  418. Size = UDim2.new(1, -22, 1, 0);
  419. Font = "Gotham";
  420. TextXAlignment = "Left";
  421. TextSize = 12;
  422. Text = toggleName;
  423. });
  424. library:Create("TextButton", {
  425. Name = "toggle";
  426. AutoButtonColor = false;
  427. BackgroundColor3 = ui_Settings.toggleColor;
  428. BorderColor3 = ui_Settings.toggleBorderColor;
  429. BorderSizePixel = 1;
  430. Size = UDim2.new(0, 16, 0, 16);
  431. Text = "";
  432. library:Create("Frame", {
  433. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  434. Size = toggle and UDim2.new(1, 0, 1, 0) or UDim2.new(0, 0, 0, 0);
  435. Name = "fill";
  436. BorderSizePixel = 0;
  437. library:Create("UIGradient", {
  438. Color = ui_Settings.gradientColorSection;
  439. Rotation = 45;
  440. });
  441. });
  442. library:Create("UIListLayout", {
  443. FillDirection = "Vertical";
  444. HorizontalAlignment = "Center";
  445. VerticalAlignment = "Center";
  446. });
  447. library:Create("UIPadding", {
  448. PaddingBottom = UDim.new(0, 1);
  449. PaddingTop = UDim.new(0, 1);
  450. PaddingLeft = UDim.new(0, 1);
  451. PaddingRight = UDim.new(0, 1);
  452. });
  453. });
  454. });
  455.  
  456. local function onClick()
  457. toggle = not toggle;
  458. library:Tween(holder.toggle.fill, {time = 0.1, Size = toggle and UDim2.new(1, 0, 1, 0) or UDim2.new(0, 0, 0, 0)});
  459. library.flags[toggleName] = toggle;
  460. callback(toggle);
  461. end;
  462.  
  463. holder.toggle.MouseButton1Click:Connect(onClick);
  464. return holder;
  465. end;
  466.  
  467. function section:Box(boxName, callback)
  468. local holder = library:Create("Frame", {
  469. Size = UDim2.new(1, -20, 0, 18);
  470. BackgroundTransparency = 1;
  471. Name = "holder";
  472. Parent = boxContainer;
  473. library:Create("TextLabel", {
  474. BackgroundTransparency = 1;
  475. Name = "label";
  476. TextColor3 = Color3.fromRGB(255, 255, 255);
  477. Text = boxName;
  478. TextSize = 12;
  479. Font = "Gotham";
  480. Size = UDim2.new(1, 0, 1, 0);
  481. TextXAlignment = "Left";
  482. });
  483. library:Create("TextBox", {
  484. BackgroundColor3 = Color3.fromRGB(32, 32, 32);
  485. BorderColor3 = ui_Settings.boxBorderColor;
  486. BorderSizePixel = 1;
  487. Name = "textbox";
  488. TextSize = 14;
  489. Position = UDim2.new(1, -160, 0, 0);
  490. Size = UDim2.new(0, 160, 1, 0);
  491. PlaceholderColor3 = Color3.fromRGB(200, 200, 200);
  492. PlaceholderText = "Value";
  493. Text = "";
  494. TextColor3 = Color3.fromRGB(255, 255, 255);
  495. Font = "SourceSans";
  496. });
  497. });
  498.  
  499. holder.textbox.FocusLost:Connect(function(Enter)
  500. if(Enter) then
  501. library.flags[boxName] = holder.textbox.Text;
  502. callback(holder.textbox.Text);
  503. end;
  504. end);
  505. end;
  506.  
  507. function section:Slider(sliderName, properties, callback)
  508. local callback = callback or function() end;
  509. library.flags[sliderName] = properties.min;
  510.  
  511. local holder = library:Create("Frame", {
  512. Size = UDim2.new(1, -20, 0, 36);
  513. BackgroundTransparency = 1;
  514. Name = "holder";
  515. Parent = boxContainer;
  516. library:Create("TextLabel", {
  517. Name = "label";
  518. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  519. BackgroundTransparency = 1.000;
  520. Size = UDim2.new(1, 0, 0, 17);
  521. Font = "Gotham";
  522. Text = sliderName;
  523. TextColor3 = Color3.fromRGB(255, 255, 255);
  524. TextSize = 12.000;
  525. TextXAlignment = "Left";
  526. });
  527. library:Create("TextButton", {
  528. Name = "slider";
  529. BackgroundColor3 = Color3.fromRGB(34, 34, 34);
  530. BorderColor3 = Color3.fromRGB(102, 41, 255);
  531. Position = UDim2.new(0, 0, 1, -19);
  532. Size = UDim2.new(1, 0, 0, 16);
  533. AutoButtonColor = false;
  534. Font = "SourceSans";
  535. Text = "";
  536. TextColor3 = Color3.fromRGB(0, 0, 0);
  537. TextSize = 14.000;
  538. library:Create("TextLabel", {
  539. Name = "value";
  540. BackgroundTransparency = 1;
  541. Size = UDim2.new(1, 0, 1, 0);
  542. Font = "SourceSans";
  543. Text = properties.default and tostring(properties.default) or tostring(properties.min);
  544. TextColor3 = Color3.fromRGB(255, 255, 255);
  545. TextSize = 14.000;
  546. ZIndex = 2;
  547. });
  548. library:Create("Frame", {
  549. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  550. Position = UDim2.new(0, 1, 0, 1);
  551. Name = "fill";
  552. Size = UDim2.new(0, 0, 1, -2);
  553. BorderSizePixel = 0;
  554. library:Create("UIGradient", {
  555. Color = ui_Settings.gradientColorSection;
  556. Rotation = 90;
  557. });
  558. });
  559. });
  560. });
  561.  
  562. local Connection;
  563. UserInputService.InputEnded:Connect(function(input)
  564. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  565. if(Connection) then
  566. Connection:Disconnect();
  567. Connection = nil;
  568. end;
  569. end;
  570. end);
  571.  
  572. holder.slider.MouseButton1Down:Connect(function()
  573. if(Connection) then
  574. Connection:Disconnect();
  575. end;
  576.  
  577. Connection = RunService.Heartbeat:Connect(function()
  578. local mouse = UserInputService:GetMouseLocation();
  579. local percent = math.clamp((mouse.X - holder.slider.AbsolutePosition.X) / (holder.slider.AbsoluteSize.X), 0, 1);
  580. local Value = properties.min + (properties.max - properties.min) * percent;
  581.  
  582. if not properties.precise then
  583. Value = math.floor(Value);
  584. end;
  585.  
  586. Value = tonumber(string.format("%.2f", Value));
  587.  
  588. library:Tween(holder.slider.fill, {time = 0.1, Size = UDim2.new(percent, 0, 1, -2)})
  589. holder.slider.value.Text = tostring(Value);
  590. library.flags[sliderName] = Value;
  591.  
  592. callback(Value);
  593. end);
  594. end);
  595. end;
  596.  
  597. function section:Bind(bindName, defaultKey, callback)
  598. local callback = callback or function() end;
  599. local input = defaultKey and tostring(defaultKey):gsub("Enum.", ""):gsub("UserInputType.", ""):gsub("KeyCode.", "") or "None";
  600. library.callbacks[bindName] = callback;
  601. library.flags[bindName] = defaultKey;
  602.  
  603. local holder = library:Create("Frame", {
  604. Name = "holder";
  605. Parent = boxContainer;
  606. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  607. BackgroundTransparency = 1.000;
  608. LayoutOrder = 2;
  609. Position = UDim2.new(0, 10, 0, 76);
  610. Size = UDim2.new(1, -20, 0, 18);
  611. library:Create("TextLabel", {
  612. Name = "label";
  613. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  614. BackgroundTransparency = 1.000;
  615. Size = UDim2.new(1, 0, 1, 0);
  616. Font = "Gotham";
  617. Text = bindName;
  618. TextColor3 = Color3.fromRGB(255, 255, 255);
  619. TextSize = 12.000;
  620. TextXAlignment = "Left";
  621. });
  622. library:Create("TextButton", {
  623. Name = "keybind";
  624. BackgroundColor3 = Color3.fromRGB(34, 34, 34);
  625. BorderColor3 = Color3.fromRGB(102, 41, 255);
  626. ClipsDescendants = true;
  627. Position = UDim2.new(1, -80, 0, 0);
  628. Size = UDim2.new(0, 80, 1, 0);
  629. AutoButtonColor = false;
  630. Font = Enum.Font.SourceSans;
  631. Text = input;
  632. TextColor3 = Color3.fromRGB(255, 255, 255);
  633. TextSize = 14.000;
  634. });
  635. });
  636.  
  637. local whitelistedType = {
  638. [Enum.KeyCode.LeftShift] = "L-Shift",
  639. [Enum.KeyCode.RightShift] = "R-Shift",
  640. [Enum.KeyCode.LeftControl] = "L-Ctrl",
  641. [Enum.KeyCode.RightControl] = "R-Ctrl",
  642. [Enum.KeyCode.LeftAlt] = "L-Alt",
  643. [Enum.KeyCode.RightAlt] = "R-Alt",
  644. [Enum.KeyCode.CapsLock] = "CAPS",
  645. [Enum.KeyCode.One] = "1",
  646. [Enum.KeyCode.Two] = "2",
  647. [Enum.KeyCode.Three] = "3",
  648. [Enum.KeyCode.Four] = "4",
  649. [Enum.KeyCode.Five] = "5",
  650. [Enum.KeyCode.Six] = "6",
  651. [Enum.KeyCode.Seven] = "7",
  652. [Enum.KeyCode.Eight] = "8",
  653. [Enum.KeyCode.Nine] = "9",
  654. [Enum.KeyCode.Zero] = "0",
  655. [Enum.KeyCode.KeypadOne] = "Num-1",
  656. [Enum.KeyCode.KeypadTwo] = "Num-2",
  657. [Enum.KeyCode.KeypadThree] = "Num-3",
  658. [Enum.KeyCode.KeypadFour] = "Num-4",
  659. [Enum.KeyCode.KeypadFive] = "Num-5",
  660. [Enum.KeyCode.KeypadSix] = "Num-6",
  661. [Enum.KeyCode.KeypadSeven] = "Num-7",
  662. [Enum.KeyCode.KeypadEight] = "Num-8",
  663. [Enum.KeyCode.KeypadNine] = "Num-9",
  664. [Enum.KeyCode.KeypadZero] = "Num-0",
  665. [Enum.KeyCode.Minus] = "-",
  666. [Enum.KeyCode.Equals] = "=",
  667. [Enum.KeyCode.Tilde] = "~",
  668. [Enum.KeyCode.LeftBracket] = "[",
  669. [Enum.KeyCode.RightBracket] = "]",
  670. [Enum.KeyCode.RightParenthesis] = ")",
  671. [Enum.KeyCode.LeftParenthesis] = "(",
  672. [Enum.KeyCode.Semicolon] = ";",
  673. [Enum.KeyCode.Quote] = "'",
  674. [Enum.KeyCode.BackSlash] = "\\",
  675. [Enum.KeyCode.Comma] = ",",
  676. [Enum.KeyCode.Period] = ".",
  677. [Enum.KeyCode.Slash] = "/",
  678. [Enum.KeyCode.Asterisk] = "*",
  679. [Enum.KeyCode.Plus] = "+",
  680. [Enum.KeyCode.Period] = ".",
  681. [Enum.KeyCode.Backquote] = "`",
  682. [Enum.UserInputType.MouseButton1] = "Button-1",
  683. [Enum.UserInputType.MouseButton2] = "Button-2",
  684. [Enum.UserInputType.MouseButton3] = "Button-3",
  685. };
  686.  
  687. holder.keybind.MouseButton1Click:Connect(function()
  688. holder.keybind.Text = ". . .";
  689. local connection;
  690. connection = UserInputService.InputBegan:Connect(function(input)
  691. connection:Disconnect();
  692. wait();
  693.  
  694. local KeyCodeName = whitelistedType[input.KeyCode] or whitelistedType[input.UserInputType];
  695.  
  696. holder.keybind.Text = KeyCodeName or tostring(input.KeyCode):gsub("Enum.KeyCode.", "");
  697. if(input.UserInputType == Enum.UserInputType.Keyboard) then
  698. library.flags[bindName] = input.KeyCode;
  699. else
  700. library.flags[bindName] = input.UserInputType;
  701. end;
  702. end);
  703. end);
  704. end;
  705.  
  706. function section:Button(buttonName, callback)
  707. local callback = callback or function() end;
  708. local holder = library:Create("Frame", {
  709. Name = "holder";
  710. Parent = boxContainer;
  711. BackgroundTransparency = 1.000;
  712. Position = UDim2.new(0, 10, 0, 148);
  713. Size = UDim2.new(1, -20, 0, 18);
  714. library:Create("TextButton", {
  715. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  716. Size = UDim2.new(1, 0, 1, 0);
  717. BorderSizePixel = 0;
  718. TextColor3 = Color3.fromRGB(255, 255, 255);
  719. Text = "";
  720. Name = "button";
  721. AutoButtonColor = false;
  722. library:Create("TextLabel", {
  723. Name = "label";
  724. BackgroundTransparency = 1;
  725. Size = UDim2.new(1, 0, 1, 0);
  726. Font = "SourceSans";
  727. TextSize = 14;
  728. TextColor3 = Color3.fromRGB(255, 255, 255);
  729. Text = buttonName;
  730. });
  731. library:Create("UIGradient", {
  732. Rotation = 90;
  733. Color = ui_Settings.gradientColorSection;
  734. });
  735. });
  736. });
  737.  
  738. holder.button.MouseButton1Click:Connect(callback);
  739. end;
  740.  
  741. function section:Dropdown(name, list, callback)
  742. local callback = callback or function() end;
  743. local toggle = false;
  744.  
  745. local holder = library:Create("Frame", {
  746. Name = "holder";
  747. BackgroundTransparency = 1.000;
  748. LayoutOrder = 3;
  749. Position = UDim2.new(0, 10, 0, 98);
  750. Size = UDim2.new(1, -20, 0, 36);
  751. Parent = boxContainer;
  752. library:Create("TextLabel", {
  753. Name = "label";
  754. BackgroundTransparency = 1.000;
  755. Size = UDim2.new(1, 0, 0, 18);
  756. Font = Enum.Font.Gotham;
  757. Text = name;
  758. TextColor3 = Color3.fromRGB(255, 255, 255);
  759. TextSize = 12.000;
  760. TextXAlignment = Enum.TextXAlignment.Left;
  761. });
  762. library:Create("TextButton", {
  763. Name = "dropdown";
  764. BackgroundColor3 = Color3.fromRGB(102, 41, 255);
  765. BorderColor3 = Color3.fromRGB(102, 41, 255);
  766. Size = UDim2.new(1, 0, 0, 18);
  767. AutoButtonColor = false;
  768. Font = "SourceSans";
  769. Text = "";
  770. TextColor3 = Color3.fromRGB(0, 0, 0);
  771. TextSize = 14.000;
  772. Position = UDim2.new(0, 0, 0, 18);
  773. library:Create("ImageLabel", {
  774. Name = "icon";
  775. BackgroundTransparency = 1.000;
  776. Position = UDim2.new(1, -18, 0, 0);
  777. Size = UDim2.new(0, 18, 0, 16);
  778. Image = "http://www.roblox.com/asset/?id=4641587888";
  779. ZIndex = 2;
  780. });
  781. library:Create("TextLabel", {
  782. Name = "label";
  783. BackgroundTransparency = 1.000;
  784. Position = UDim2.new(0, 4, 0, 0);
  785. Size = UDim2.new(1, -4, 0, 18);
  786. Font = Enum.Font.Gotham;
  787. Text = "Drop value";
  788. TextColor3 = Color3.fromRGB(255, 255, 255);
  789. TextSize = 12.000;
  790. TextXAlignment = Enum.TextXAlignment.Left;
  791. ZIndex = 2;
  792. });
  793. library:Create("Frame", {
  794. Name = "dropframe";
  795. BackgroundColor3 = Color3.fromRGB(32, 32, 32);
  796. BorderColor3 = Color3.fromRGB(102, 41, 255);
  797. BorderSizePixel = 0;
  798. ClipsDescendants = true;
  799. Position = UDim2.new(0, -1, 1, 1);
  800. Size = UDim2.new(1, 2, 0, 0);
  801. library:Create("UIListLayout", {
  802. SortOrder = "LayoutOrder";
  803. Padding = UDim.new(0, 2);
  804. });
  805. });
  806. library:Create("Frame", {
  807. Name = "fill";
  808. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  809. BorderSizePixel = 0;
  810. Position = UDim2.new(0, 1, 0, 1);
  811. Size = UDim2.new(1, 0, 1, 0);
  812. library:Create("UIGradient", {
  813. Rotation = 90;
  814. Color = ui_Settings.gradientColorSection;
  815. });
  816. });
  817. });
  818. });
  819.  
  820. for i, v in next, list do
  821. local button = library:Create("TextButton", {
  822. Name = "button";
  823. Text = v;
  824. Parent = holder.dropdown.dropframe;
  825. BackgroundColor3 = Color3.fromRGB(32, 32, 32);
  826. BorderColor3 = Color3.fromRGB(255, 255, 255);
  827. BorderSizePixel = 0;
  828. Size = UDim2.new(1, 0, 0, 16);
  829. Font = "SourceSans";
  830. TextColor3 = Color3.fromRGB(255, 255, 255);
  831. TextSize = 14.000;
  832. ZIndex = 1;
  833. });
  834.  
  835. button.MouseButton1Click:Connect(function()
  836. toggle = false;
  837. holder.dropdown.label.Text = v;
  838. library:Tween(holder.dropdown.icon, {time = 0.1, Rotation = 180});
  839. library:Tween(holder, {time = 0.1, Size = UDim2.new(1, -20, 0, 35)});
  840. library:Tween(holder.dropdown.dropframe, {time = 0.1, Size = UDim2.new(1, 2, 0, 0)}, self.Update);
  841. callback(button.Text);
  842. end);
  843. end;
  844.  
  845. holder.dropdown.MouseButton1Click:Connect(function()
  846. toggle = not toggle;
  847. local TotalY = 0;
  848. for i, v in next, holder.dropdown.dropframe:GetChildren() do
  849. if(v:IsA("TextButton")) then
  850. TotalY = TotalY + v.AbsoluteSize.Y + 2;
  851. end;
  852. end;
  853.  
  854. if(toggle) then
  855. library:Tween(holder.dropdown.icon, {time = 0.1, Rotation = 0});
  856. library:Tween(holder, {time = 0.1, Size = UDim2.new(1, -20, 0, TotalY + 50)});
  857. library:Tween(holder.dropdown.dropframe, {time = 0.1, Size = UDim2.new(1, 2, 0, TotalY)}, self.Update);
  858. else
  859. library:Tween(holder.dropdown.icon, {time = 0.1, Rotation = 180});
  860. library:Tween(holder, {time = 0.1, Size = UDim2.new(1, -20, 0, 36)});
  861. library:Tween(holder.dropdown.dropframe, {time = 0.1, Size = UDim2.new(1, 2, 0, 0)}, self.Update);
  862. end;
  863. end);
  864. end;
  865.  
  866. function section:ColorPicker(pickerName, defaultColor, callback)
  867. local callback = callback or function() end;
  868. local defaultColor = defaultColor or Color3.fromRGB(102, 41, 255);
  869. local rainbowToggle = false;
  870. local Mouse = Players.LocalPlayer:GetMouse();
  871.  
  872. local holder = library:Create("Frame", {
  873. Name = "holder";
  874. Parent = boxContainer;
  875. BackgroundTransparency = 1.000;
  876. Position = UDim2.new(0, 10, 0, 172);
  877. Size = UDim2.new(1, -20, 0, 18);
  878. library:Create("TextLabel", {
  879. Name = "label";
  880. BackgroundTransparency = 1.000;
  881. Size = UDim2.new(1, 0, 1, 0);
  882. Font = "Gotham";
  883. Text = pickerName;
  884. TextColor3 = Color3.fromRGB(255, 255, 255);
  885. TextSize = 12.000;
  886. TextXAlignment = Enum.TextXAlignment.Left;
  887. });
  888. library:Create("TextButton", {
  889. Name = "colorpicker";
  890. BackgroundColor3 = Color3.fromRGB(34, 34, 34);
  891. BorderColor3 = Color3.fromRGB(102, 41, 255);
  892. Position = UDim2.new(1, -16, 0, 0);
  893. Size = UDim2.new(0, 16, 0, 16);
  894. AutoButtonColor = false;
  895. Font = Enum.Font.SourceSans;
  896. Text = "";
  897. TextColor3 = Color3.fromRGB(0, 0, 0);
  898. TextSize = 14.000;
  899. library:Create("Frame", {
  900. Name = "colorframe";
  901. BackgroundColor3 = Color3.fromRGB(32, 32, 32);
  902. BorderColor3 = Color3.fromRGB(102, 41, 255);
  903. Position = UDim2.new(0, -148, 1, 6);
  904. Size = UDim2.new(0, 144, 0, 139);
  905. Visible = false;
  906. ZIndex = 2;
  907. library:Create("ImageButton", {
  908. Name = "satval";
  909. Image = "http://www.roblox.com/asset/?id=4650897272";
  910. BorderSizePixel = 0;
  911. AutoButtonColor = false;
  912. BackgroundColor3 = defaultColor;
  913. Position = UDim2.new(0, 4, 0, 3);
  914. Size = UDim2.new(0, 110, 0, 102);
  915. ZIndex = 2;
  916. library:Create("TextButton", {
  917. Name = "picker";
  918. BackgroundColor3 = Color3.fromRGB(53, 53, 53);
  919. BackgroundTransparency = 0.500;
  920. BorderSizePixel = 0;
  921. Position = UDim2.new(0.5, 0, 0.5, 0);
  922. Size = UDim2.new(0, 5, 0, 5);
  923. ZIndex = 2;
  924. Text = "";
  925. });
  926. });
  927. library:Create("TextButton", {
  928. Name = "rainbow";
  929. ZIndex = 2;
  930. BackgroundColor3 = Color3.fromRGB(255, 255, 255);
  931. BorderColor3 = Color3.fromRGB(255, 255, 255);
  932. ClipsDescendants = true;
  933. Position = UDim2.new(0, 5, 1, -25);
  934. Size = UDim2.new(0, 133, 0, 20);
  935. AutoButtonColor = false;
  936. Font = "SourceSans";
  937. Text = "";
  938. TextColor3 = Color3.fromRGB(255, 255, 255);
  939. TextSize = 14.000;
  940. library:Create("UIGradient", {
  941. Color = ui_Settings.gradientColorSection;
  942. Rotation = -90;
  943. });
  944. library:Create("TextLabel", {
  945. Name = "label";
  946. Parent = button;
  947. BackgroundTransparency = 1.000;
  948. Size = UDim2.new(1, 0, 1, 0);
  949. Font = "SourceSans";
  950. Text = "Rainbow: OFF";
  951. TextColor3 = Color3.fromRGB(255, 255, 255);
  952. TextSize = 14.000;
  953. ZIndex = 2;
  954. });
  955. });
  956. library:Create("ImageButton", {
  957. Name = "hue";
  958. AutoButtonColor = false;
  959. ZIndex = 2;
  960. Position = UDim2.new(0, 118, 0, 3);
  961. Size = UDim2.new(0, 18, 0, 102);
  962. Image = "http://www.roblox.com/asset/?id=4650897105";
  963. library:Create("TextButton", {
  964. Name = "selector";
  965. BackgroundColor3 = Color3.fromRGB(53, 53, 53);
  966. BorderSizePixel = 0;
  967. Size = UDim2.new(1, 0, 0, 5);
  968. Text = "";
  969. ZIndex = 2;
  970. });
  971. });
  972. });
  973. library:Create("Frame", {
  974. Name = "color";
  975. BackgroundColor3 = defaultColor;
  976. BorderSizePixel = 0;
  977. Position = UDim2.new(0, 1, 0, 1);
  978. Size = UDim2.new(0, 14, 0, 14);
  979. });
  980. });
  981. });
  982.  
  983.  
  984. local colorData = {
  985. H = 1;
  986. S = 1;
  987. V = 1;
  988. };
  989.  
  990. local Connection1;
  991. local Connection2;
  992.  
  993. local function getXY(frame)
  994. local x, y = Mouse.X - frame.AbsolutePosition.X, Mouse.Y - frame.AbsolutePosition.Y;
  995. local maxX, maxY = frame.AbsoluteSize.X,frame.AbsoluteSize.Y;
  996. x = math.clamp(x, 0, maxX);
  997. y = math.clamp(y, 0, maxY);
  998. return x / maxX, y / maxY;
  999. end;
  1000.  
  1001. local function Update()
  1002. local Color = Color3.fromHSV(colorData.H, colorData.S, colorData.V);
  1003. holder.colorpicker.color.BackgroundColor3 = Color;
  1004. holder.colorpicker.colorframe.satval.BackgroundColor3 = Color3.fromHSV(colorData.H, 1, 1);
  1005. callback(Color);
  1006. end;
  1007.  
  1008. holder.colorpicker.MouseButton1Click:Connect(function()
  1009. toggle = not toggle;
  1010. holder.colorpicker.colorframe.Visible = toggle;
  1011. end);
  1012.  
  1013. UserInputService.InputEnded:Connect(function(i)
  1014. if i.UserInputType == Enum.UserInputType.MouseButton1 then
  1015. if(Connection1) then
  1016. Connection1:Disconnect();
  1017. Connection1 = nil;
  1018. end;
  1019. if(Connection2) then
  1020. Connection2:Disconnect();
  1021. Connection2 = nil;
  1022. end;
  1023. isFocused = false;
  1024. end;
  1025. end);
  1026.  
  1027. holder.colorpicker.colorframe.rainbow.MouseButton1Click:Connect(function()
  1028. rainbowToggle = not rainbowToggle;
  1029. holder.colorpicker.colorframe.rainbow.label.Text = rainbowToggle and "Rainbow: ON" or "Rainbow: OFF";
  1030.  
  1031. if(rainbowToggle) then
  1032. repeat
  1033. library:Tween(holder.colorpicker.colorframe.hue.selector, {time = 0.1, Position = UDim2.new(0, 0, library.rainbowI, 0)});
  1034. holder.colorpicker.colorframe.satval.BackgroundColor3 = Color3.fromHSV(1 - library.rainbowI, 1, 1);
  1035. holder.colorpicker.color.BackgroundColor3 = library.rainbowVal;
  1036. callback(library.rainbowVal);
  1037. RunService.Heartbeat:Wait();
  1038. until not rainbowToggle;
  1039. end;
  1040. end);
  1041.  
  1042. holder.colorpicker.colorframe.satval.InputBegan:Connect(function(i)
  1043. if i.UserInputType == Enum.UserInputType.MouseButton1 then
  1044. if(Connection1) then
  1045. Connection1:Disconnect();
  1046. end;
  1047. Connection1 = RunService.Heartbeat:Connect(function()
  1048. local X, Y = getXY(holder.colorpicker.colorframe.satval);
  1049.  
  1050. holder.colorpicker.colorframe.satval.picker.Position = UDim2.new(X, 0, Y, 0);
  1051. colorData.S = X;
  1052. colorData.V = 1 - Y;
  1053. Update();
  1054. end);
  1055. end;
  1056. end);
  1057.  
  1058. holder.colorpicker.colorframe.hue.InputBegan:Connect(function(i)
  1059. if i.UserInputType == Enum.UserInputType.MouseButton1 then
  1060. if(Connection2) then
  1061. Connection2:Disconnect();
  1062. end;
  1063.  
  1064. Connection2 = RunService.Heartbeat:Connect(function()
  1065. local X, Y = getXY(holder.colorpicker.colorframe.hue);
  1066.  
  1067. colorData.H = 1 - Y;
  1068. holder.colorpicker.colorframe.hue.selector.Position = UDim2.new(0, 0, Y, 0);
  1069. Update();
  1070. end);
  1071. end;
  1072. end);
  1073. end;
  1074.  
  1075. return section;
  1076. end;
  1077. end;
  1078.  
  1079. return library;
  1080. end;
  1081.  
  1082. return initLibrary();
Add Comment
Please, Sign In to add comment