Advertisement
simoehf

Untitled

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