WolfScripts

Wally V2 Edit

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