Advertisement
NeverCords

bura

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