Advertisement
MegumuSenpai

K Project: Missing Kings | AutoFarm GUI

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