AOM-GU-PRO

SwordBurst 2 AutoFarm

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