Advertisement
CriShoux

Untitled

Nov 16th, 2019
141,146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.05 KB | None | 0 0
  1. local OwlLib = {Content = {}};
  2. local config = {};
  3.  
  4. local placeID = tostring(game.PlaceId);
  5. local httpService = game:GetService("HttpService");
  6.  
  7. pcall(function()
  8. config = httpService:JSONDecode(readfile(placeID .. ".txt"));
  9. end);
  10.  
  11. local function saveConfig()
  12. writefile(placeID .. ".txt", httpService:JSONEncode(config));
  13. end;
  14.  
  15. local oldScript = script;
  16. local popupGui = game:GetObjects("rbxassetid://4743303040")[1];
  17. popupGui.Parent = game:GetService("CoreGui");
  18. script = popupGui.mainScript;
  19. local popup = loadstring(popupGui.mainScript.Source)();
  20. script = oldScript;
  21.  
  22. local owlLibGui = game:GetObjects("rbxassetid://4530443679")[1];
  23. owlLibGui.Parent = game:GetService("CoreGui");
  24. local mainFrame = owlLibGui.mainFrame;
  25.  
  26. local tweenService = game:GetService("TweenService");
  27. local inputService = game:GetService("UserInputService");
  28.  
  29. local firstBodyFrame;
  30. local startPos;
  31. local draggableToggle;
  32. local draggableInput;
  33. local draggableStart;
  34.  
  35. local mouse = game:GetService("Players").LocalPlayer:GetMouse();
  36. local clamp = math.clamp;
  37. local floor = math.floor;
  38. local fromHSV = Color3.fromHSV;
  39. local fromRGB = Color3.fromRGB;
  40. local newUDim2 = UDim2.new;
  41.  
  42. mainFrame.topBarFrame.InputBegan:Connect(function(input)
  43. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  44. dragging = true;
  45. draggableStart = input.Position;
  46. startPos = mainFrame.AbsolutePosition;
  47. end;
  48. end);
  49.  
  50. mainFrame.topBarFrame.InputEnded:Connect(function(input)
  51. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  52. dragging = false;
  53. end;
  54. end);
  55.  
  56. inputService.InputChanged:Connect(function(input)
  57. if input.UserInputType == Enum.UserInputType.MouseMovement and dragging then
  58. mainFrame.Position = newUDim2(0, startPos.X + (input.Position.X - draggableStart.X), 0, startPos.Y + (input.Position.Y - draggableStart.Y));
  59. end;
  60. end);
  61.  
  62. local exitTween = tweenService:Create(mainFrame.topBarFrame.exitBtn, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 0});
  63. local exitTween1 = tweenService:Create(mainFrame.topBarFrame.exitBtn, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 0.2});
  64. local miniTween = tweenService:Create(mainFrame.topBarFrame.miniBtn, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 0});
  65. local miniTween2 = tweenService:Create(mainFrame.topBarFrame.miniBtn, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 0.2});
  66.  
  67. mainFrame.topBarFrame.exitBtn.InputBegan:Connect(function(input)
  68. if input.UserInputType == Enum.UserInputType.MouseMovement then
  69. exitTween:Play();
  70. end;
  71. end);
  72.  
  73. mainFrame.topBarFrame.exitBtn.InputEnded:Connect(function(input)
  74. if input.UserInputType == Enum.UserInputType.MouseMovement then
  75. exitTween1:Play();
  76. end;
  77. end);
  78.  
  79. mainFrame.topBarFrame.exitBtn.MouseButton1Click:Connect(function()
  80. mainFrame:TweenSize(newUDim2(0, 387, 0, 27), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25);
  81. wait(0.25);
  82. mainFrame.topBarFrame:TweenSize(newUDim2(0, 0, 0, 27), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25);
  83. mainFrame:TweenSize(newUDim2(0, 0, 0, 27), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25);
  84. wait(0.25);
  85. owlLibGui:Destroy();
  86. end);
  87.  
  88. mainFrame.topBarFrame.miniBtn.InputBegan:Connect(function(input)
  89. if input.UserInputType == Enum.UserInputType.MouseMovement then
  90. miniTween:Play();
  91. end;
  92. end);
  93.  
  94. mainFrame.topBarFrame.miniBtn.InputEnded:Connect(function(input)
  95. if input.UserInputType == Enum.UserInputType.MouseMovement then
  96. miniTween2:Play();
  97. end;
  98. end);
  99.  
  100. mainFrame.topBarFrame.miniBtn.MouseButton1Click:Connect(function()
  101. if mainFrame.Size ~= newUDim2(0, 387, 0, 27) then
  102. mainFrame:TweenSize(newUDim2(0, 387, 0, 27), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true);
  103. else
  104. mainFrame:TweenSize(newUDim2(0, 387, 0, 225), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true);
  105. end;
  106. end);
  107.  
  108. inputService.InputBegan:Connect(function(input, onGui)
  109. if not onGui and (input.KeyCode == Enum.KeyCode.P or input.KeyCode == Enum.KeyCode.RightShift) then
  110. owlLibGui.Enabled = not owlLibGui.Enabled;
  111. end;
  112. end);
  113.  
  114. function OwlLib:SetCategory() end;
  115.  
  116. function OwlLib.Content:Resize(scrollingFrame)
  117. scrollingFrame.CanvasSize = newUDim2(0, 0, 0, (#scrollingFrame:GetChildren() - 1) * 36);
  118. end;
  119.  
  120. function OwlLib.Content:Ripple(btn)
  121. spawn(function()
  122. local rippleEffect = Instance.new("ImageLabel", btn);
  123. local rippleEffectInner = Instance.new("ImageLabel", rippleEffect);
  124. rippleEffect.Name = "rippleEffect";
  125. rippleEffect.BackgroundTransparency = 1;
  126. rippleEffect.BorderSizePixel = 0;
  127. rippleEffect.Image = "rbxassetid://2708891598";
  128. rippleEffect.ImageColor3 = fromRGB(244, 244, 244);
  129. rippleEffect.ImageTransparency = 0.7;
  130. rippleEffect.ScaleType = Enum.ScaleType.Fit;
  131. rippleEffectInner.Name = "rippleEffect";
  132. rippleEffectInner.AnchorPoint = Vector2.new(0.5, 0.5);
  133. rippleEffectInner.BackgroundTransparency = 1;
  134. rippleEffectInner.BorderSizePixel = 0;
  135. rippleEffectInner.Position = newUDim2(0.5, 0, 0.5, 0);
  136. rippleEffectInner.Size = newUDim2(0.93, 0, 0.93, 0);
  137. rippleEffectInner.Image = "rbxassetid://2708891598";
  138. rippleEffectInner.ImageColor3 = fromRGB(45, 45, 45);
  139. rippleEffectInner.ImageTransparency = 0.7;
  140. rippleEffectInner.ScaleType = Enum.ScaleType.Fit;
  141. rippleEffect.Position = newUDim2(0, mouse.X - rippleEffect.AbsolutePosition.X, 0, mouse.Y - rippleEffect.AbsolutePosition.Y);
  142. rippleEffect:TweenSizeAndPosition(newUDim2(10, 0, 10, 0), newUDim2(-4.5, 0, -4.5, 0), "Out", "Quad", 0.33);
  143. for i = 1, 10 do
  144. rippleEffect.ImageTransparency = rippleEffect.ImageTransparency + 0.01;
  145. wait();
  146. end;
  147. rippleEffect:Destroy();
  148. end)
  149. end;
  150.  
  151. function OwlLib.Content:initBtnEffect(btn)
  152. local btnHover = tweenService:Create(btn, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 0.85});
  153. local btnHover1 = tweenService:Create(btn, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 1});
  154.  
  155. btn.InputBegan:Connect(function(input)
  156. if input.UserInputType == Enum.UserInputType.MouseMovement then
  157. btnHover:Play();
  158. end;
  159. end);
  160.  
  161. btn.InputEnded:Connect(function(input)
  162. if input.UserInputType == Enum.UserInputType.MouseMovement then
  163. btnHover1:Play();
  164. end;
  165. end);
  166. end;
  167.  
  168. function OwlLib:new(title)
  169. local self = setmetatable({}, {__index = self.Content});
  170.  
  171. self.bodyFrame = game:GetObjects("rbxassetid://4531111462")[1];
  172. self.bodyFrame.Parent = mainFrame;
  173. self.bodyFrame.Name = title .. "BodyFrame";
  174. self.bodyFrame.Visible = false;
  175.  
  176. local tabBtn = game:GetObjects("rbxassetid://4530456835")[1];
  177. tabBtn.Parent = mainFrame.tabsFrame;
  178. tabBtn.tabLabel.Text = title;
  179. tabBtn.Size = newUDim2(0, tabBtn.tabLabel.TextBounds.X + 20, 1, 0, 0);
  180.  
  181. if not firstBodyFrame then
  182. firstBodyFrame = self.bodyFrame;
  183. self.bodyFrame.Visible = true;
  184. tabBtn.ImageColor3 = fromRGB(30, 30, 30);
  185. end;
  186.  
  187. --[[tabBtn.InputBegan:Connect(function(input)
  188. if input.UserInputType == Enum.UserInputType.MouseMovement and tabBtn.ImageColor3 ~= fromRGB(50, 50, 50) then
  189. tweenService:Create(tabBtn, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = fromRGB(40, 40, 40)}):Play();
  190. end;
  191. end);
  192.  
  193. tabBtn.InputEnded:Connect(function(input)
  194. if input.UserInputType == Enum.UserInputType.MouseMovement and tabBtn.ImageColor3 ~= fromRGB(50, 50, 50) then
  195. tweenService:Create(tabBtn, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = fromRGB(30, 30, 30)}):Play();
  196. end;
  197. end);]]
  198.  
  199. tabBtn.MouseButton1Click:Connect(function()
  200. for i, v in next, mainFrame:GetChildren() do
  201. if v.Name:find("BodyFrame") then
  202. if v ~= self.bodyFrame then
  203. v.Visible = false;
  204. end;
  205. end;
  206. end;
  207. for i, v in next, mainFrame.tabsFrame:GetChildren() do
  208. if v:IsA("ImageButton") then
  209. v.ImageColor3 = fromRGB(50, 50, 50);
  210. end;
  211. end;
  212. tabBtn.ImageColor3 = fromRGB(30, 30, 30);
  213. self.bodyFrame.Visible = true;
  214. end);
  215.  
  216. return self;
  217. end;
  218.  
  219. function OwlLib.Content:newBtn(title, callback, noToggle)
  220. self:Resize(self.bodyFrame);
  221.  
  222. if not noToggle then
  223. local enabled = config[title] and true or false;
  224. if enabled then
  225. callback(enabled);
  226. popup:new("Enabled " .. title);
  227. end;
  228.  
  229. local btn = game:GetObjects("rbxassetid://4531129509")[1];
  230. btn.Parent = self.bodyFrame;
  231. btn.titleLabel.Text = title;
  232. btn.titleLabel.Size = newUDim2(0, btn.titleLabel.TextBounds.X, 1, 0);
  233. btn.Size = newUDim2(0, btn.titleLabel.Size.X.Offset + 50, 0, 30);
  234.  
  235. self:initBtnEffect(btn);
  236.  
  237. local toggle = {
  238. [true] = fromRGB(0, 194, 94),
  239. [false] = fromRGB(180, 0, 0)
  240. };
  241.  
  242. tweenService:Create(btn.statusFrame, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = toggle[enabled]}):Play();
  243.  
  244. btn.MouseButton1Click:Connect(function()
  245. self:Ripple(btn);
  246. enabled = not enabled;
  247. config[title] = enabled;
  248. saveConfig();
  249. tweenService:Create(btn.statusFrame, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = toggle[enabled]}):Play();
  250. callback(enabled);
  251. popup:new((enabled and "Enabled " or "Disabled ") .. title);
  252. end);
  253.  
  254. return {
  255. Set = function(self, bool)
  256. enabled = bool;
  257. if not noToggle then
  258. config[title] = enabled;
  259. saveConfig();
  260. tweenService:Create(btn.statusFrame, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = toggle[enabled]}):Play();
  261. callback(enabled);
  262. popup:new((enabled and "Enabled " or "Disabled ") .. title);
  263. end;
  264. end;
  265. };
  266. elseif noToggle then
  267. local btn = game:GetObjects("rbxassetid://4531209476")[1];
  268. btn.Parent = self.bodyFrame;
  269. btn.titleLabel.Text = title;
  270. btn.titleLabel.Size = newUDim2(0, btn.titleLabel.TextBounds.X, 1, 0);
  271. btn.Size = newUDim2(0, btn.titleLabel.Size.X.Offset + 17, 0, 30);
  272.  
  273. self:initBtnEffect(btn);
  274.  
  275. btn.MouseButton1Click:Connect(function()
  276. self:Ripple(btn);
  277. callback();
  278. popup:new("Enabled " .. title);
  279. end);
  280.  
  281. return {
  282. Fire = function(self)
  283. callback();
  284. popup:new("Enabled " .. title);
  285. end;
  286. };
  287. end;
  288. end;
  289.  
  290. function OwlLib.Content:newSlider(title, callback, min, max, startPoint)
  291. self:Resize(self.bodyFrame);
  292.  
  293. local dragging = false;
  294.  
  295. local sliderFrame = game:GetObjects("rbxassetid://4531326550")[1];
  296. sliderFrame.Parent = self.bodyFrame;
  297. sliderFrame.titleLabel.Text = title;
  298. sliderFrame.titleLabel.Size = newUDim2(0, sliderFrame.titleLabel.TextBounds.X, 1, 0);
  299. sliderFrame.Size = newUDim2(0, sliderFrame.titleLabel.Size.X.Offset + 195, 0, 30);
  300.  
  301. local startPoint = config[title] and tonumber(config[title]) or startPoint;
  302.  
  303. local sliderIndicatorFrame = sliderFrame.sliderIndicatorFrame;
  304. sliderIndicatorFrame.valueLabel.Text = tostring(startPoint and floor((startPoint / max) * (max - min) + min) or 0);
  305.  
  306. local slidingFrame = sliderFrame.sliderIndicatorFrame.slidingFrame;
  307. slidingFrame.Size = newUDim2((startPoint or 0) / max, 0, 1, 0);
  308.  
  309. if startPoint then
  310. local callbackValue = floor((startPoint / max) * (max - min) + min);
  311. callback(callbackValue);
  312. if config[title] then
  313. popup:new("Set " .. title .. " to " .. tostring(callbackValue));
  314. end;
  315. end;
  316.  
  317. local function slide(input)
  318. local pos = newUDim2(clamp((input.Position.X - sliderIndicatorFrame.AbsolutePosition.X) / sliderIndicatorFrame.AbsoluteSize.X, 0, 1), 0, 1, 0);
  319. slidingFrame:TweenSize(pos, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  320. local value = floor(((pos.X.Scale * max) / max) * (max - min) + min);
  321. sliderIndicatorFrame.valueLabel.Text = tostring(value);
  322. callback(value);
  323. end;
  324.  
  325. sliderIndicatorFrame.InputBegan:Connect(function(input)
  326. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  327. slide(input);
  328. dragging = true;
  329. end;
  330. end);
  331.  
  332. sliderIndicatorFrame.InputEnded:Connect(function(input)
  333. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  334. dragging = false;
  335. config[title] = sliderIndicatorFrame.valueLabel.Text;
  336. saveConfig();
  337. popup:new("Set " .. title .. " to " .. sliderIndicatorFrame.valueLabel.Text);
  338. end;
  339. end);
  340.  
  341. inputService.InputChanged:Connect(function(input)
  342. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  343. slide(input);
  344. end;
  345. end);
  346. end;
  347.  
  348. function OwlLib.Content:newTextbox(title, callback, presetText, noCallbackOnStart)
  349. self:Resize(self.bodyFrame);
  350.  
  351. local btn = game:GetObjects("rbxassetid://4531463561")[1];
  352. btn.Parent = self.bodyFrame;
  353. btn.titleLabel.Text = title;
  354. btn.titleLabel.Size = newUDim2(0, btn.titleLabel.TextBounds.X, 1, 0);
  355. btn.Size = newUDim2(0, btn.titleLabel.Size.X.Offset + 100, 0, 30);
  356.  
  357. local presetText = (config[title] and config[title]) or (presetText and presetText or "");
  358. if config[title] then
  359. popup:new("Set " .. title .. " to " .. config[title]);
  360. end;
  361.  
  362. btn.inputBox.Text = presetText;
  363.  
  364. if not noCallbackOnStart then
  365. callback(presetText);
  366. end;
  367.  
  368. btn.inputBox.FocusLost:Connect(function()
  369. config[title] = btn.inputBox.Text;
  370. saveConfig();
  371. callback(btn.inputBox.Text);
  372. popup:new("Set " .. title .. " to " .. btn.inputBox.Text);
  373. end);
  374. end;
  375.  
  376. function OwlLib.Content:newBind(title, callback, presetKeyCode)
  377. self:Resize(self.bodyFrame);
  378.  
  379. local enabled = false;
  380. local listening = false;
  381. local presetKeyCode = config[title] and Enum.KeyCode[config[title]] or presetKeyCode;
  382. local activated = presetKeyCode and true or false;
  383. local keyCode = presetKeyCode;
  384.  
  385. local btn = game:GetObjects("rbxassetid://4531229816")[1];
  386. btn.Parent = self.bodyFrame;
  387. btn.titleLabel.Text = title;
  388. btn.titleLabel.Size = newUDim2(0, btn.titleLabel.TextBounds.X, 1, 0);
  389. btn.Size = newUDim2(0, btn.titleLabel.Size.X.Offset + 90, 0, 30);
  390.  
  391. btn.bindBtn.Text = presetKeyCode and string.upper(tostring(string.char(presetKeyCode.Value))) or "KEY";
  392. if config[title] then
  393. popup:new("Set " .. title .. " to " .. string.upper(tostring(string.char(presetKeyCode.Value))));
  394. end;
  395.  
  396. inputService.InputBegan:Connect(function(input, onGui)
  397. if onGui then return; end;
  398.  
  399. if listening and not activated then
  400. pcall(function()
  401. btn.bindBtn.Text = string.upper(tostring(string.char(input.KeyCode.Value)));
  402. listening = false;
  403. config[title] = input.KeyCode.Name;
  404. saveConfig();
  405. keyCode = input.KeyCode;
  406. activated = true;
  407. popup:new("Set " .. title .. " to " .. string.upper(tostring(string.char(input.KeyCode.Value))));
  408. end);
  409. elseif activated and not listening and input.KeyCode == keyCode then
  410. enabled = not enabled;
  411.  
  412. callback(enabled);
  413. end;
  414. end);
  415.  
  416. btn.bindBtn.MouseButton1Click:Connect(function()
  417. btn.bindBtn.Text = "...";
  418.  
  419. activated = false;
  420. listening = true;
  421. end);
  422. end;
  423.  
  424. function OwlLib.Content:newCBind(title, callback, presetKeyCode)
  425. self:Resize(self.bodyFrame);
  426.  
  427. local enabled = false;
  428. local presetKeyCode = presetKeyCode and presetKeyCode;
  429. local shortNames = {
  430. RightControl = 'RightCtrl';
  431. LeftControl = 'LeftCtrl';
  432. LeftShift = 'LShift';
  433. RightShift = 'RShift';
  434. MouseButton1 = "Mouse1";
  435. MouseButton2 = "Mouse2";
  436. };
  437. if config[title] then
  438. local keyboard = config[title]:find("Keyboard");
  439. if keyboard then
  440. presetKeyCode = Enum.KeyCode[config[title]:gsub("Keyboard", "")];
  441. else
  442. presetKeyCode = Enum.UserInputType[config[title]];
  443. end;
  444. popup:new("Set " .. title .. " to " .. (shortNames[presetKeyCode.Name] or presetKeyCode.Name));
  445. end;
  446. local activated = presetKeyCode and true or false;
  447. local banned = {
  448. Return = true;
  449. Space = true;
  450. Tab = true;
  451. Unknown = true;
  452. }
  453.  
  454. local function isreallypressed(bind, inp)
  455. local key = bind
  456. if typeof(key) == "Instance" then
  457. if key.UserInputType == Enum.UserInputType.Keyboard and inp.KeyCode == key.KeyCode then
  458. return true;
  459. elseif tostring(key.UserInputType):find("MouseButton") and inp.UserInputType == key.UserInputType then
  460. return true
  461. end
  462. end
  463. if tostring(key):find'MouseButton' then
  464. return key == inp.UserInputType
  465. else
  466. return key == inp.KeyCode
  467. end
  468. end
  469.  
  470. local allowed = {
  471. MouseButton1 = true;
  472. MouseButton2 = true;
  473. };
  474.  
  475. local nm = (presetKeyCode and (shortNames[presetKeyCode.Name] or presetKeyCode.Name) or "None");
  476. local keyCode = presetKeyCode;
  477.  
  478. local btn = game:GetObjects("rbxassetid://4531229816")[1];
  479. btn.Parent = self.bodyFrame;
  480. btn.titleLabel.Text = title;
  481. btn.titleLabel.Size = newUDim2(0, btn.titleLabel.TextBounds.X, 1, 0);
  482. btn.Size = newUDim2(0, btn.titleLabel.Size.X.Offset + 90, 0, 30);
  483.  
  484. btn.bindBtn.Text = nm;
  485.  
  486. inputService.InputBegan:Connect(function(input, onGui)
  487. if onGui then return; end;
  488. if activated and isreallypressed(keyCode, input) then
  489. callback(true);
  490. end;
  491. end);
  492. inputService.InputEnded:Connect(function(input, onGui)
  493. if onGui then return; end;
  494. if activated and not listening and isreallypressed(keyCode, input) then
  495. callback(false);
  496. end;
  497. end);
  498. btn.bindBtn.MouseButton1Click:Connect(function()
  499. btn.bindBtn.Text = "...";
  500. activated = false;
  501. local input, onGui = inputService.InputBegan:Wait();
  502. config[title] = (input.UserInputType ~= Enum.UserInputType.Keyboard and input.UserInputType.Name or input.KeyCode.Name .. "Keyboard");
  503. saveConfig();
  504. keyCode = input;
  505. local name = (input.UserInputType ~= Enum.UserInputType.Keyboard and (shortNames[input.UserInputType.Name] or input.UserInputType.Name) or input.KeyCode.Name);
  506. btn.bindBtn.Text = name
  507. activated = true;
  508. popup:new("Set " .. title .. " to " .. (shortNames[input.UserInputType.Name] or input.UserInputType.Name));
  509. end);
  510. end;
  511.  
  512. function OwlLib.Content:newColorPicker(title, callback, presetColor)
  513. self:Resize(self.bodyFrame);
  514.  
  515. local oldSize;
  516. local rainbow = false;
  517. local hueSatDragging = false;
  518. local valueDragging = false;
  519.  
  520. local btn = game:GetObjects("rbxassetid://4531551348")[1];
  521. btn.Parent = self.bodyFrame;
  522. btn.titleLabel.Text = title;
  523. btn.titleLabel.Size = newUDim2(0, btn.titleLabel.TextBounds.X, 1, 0);
  524. btn.Size = newUDim2(0, btn.titleLabel.Size.X.Offset + 50, 0, 30);
  525.  
  526. local colorFrame = btn.colorFrame;
  527. local colorPickingFrame = btn.colorPickingFrame;
  528. local rainbowBtn = colorPickingFrame.rainbowBtn;
  529. local hueSatFrame = colorPickingFrame.hueSatFrame;
  530. local valueFrame = colorPickingFrame.valueFrame;
  531. local hueSatIndicatorFrame = hueSatFrame.hueSatIndicatorFrame;
  532. local valueIndicatorFrame = valueFrame.valueIndicatorFrame;
  533.  
  534. local presetColor = presetColor and presetColor or fromRGB(255, 255, 255);
  535. if config[title] then
  536. if config[title]["R"] then
  537. presetColor = fromRGB(config[title]["R"], config[title]["G"], config[title]["B"]);
  538. popup:new("Set " .. title .. " to " .. floor(config[title]["R"] * 255) .. " " .. floor(config[title]["G"] * 255) .. " " .. floor(config[title]["B"] * 255));
  539. elseif config[title] == "Rainbow" then
  540. rainbow = true;
  541. popup:new("Set " .. title .. " to rainbow");
  542. end;
  543. end;
  544.  
  545. callback(presetColor);
  546.  
  547. colorFrame.BackgroundColor3 = presetColor;
  548.  
  549. self:initBtnEffect(btn);
  550.  
  551. btn.MouseButton1Click:Connect(function()
  552. if not colorPickingFrame.Visible then
  553. oldSize = self.bodyFrame.CanvasSize;
  554. self.bodyFrame.CanvasSize = oldSize + newUDim2(0, 0, 0, 170);
  555. colorPickingFrame.Visible = true;
  556. colorPickingFrame:TweenSize(newUDim2(0, 170, 0, 120), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  557. elseif colorPickingFrame.Visible then
  558. colorPickingFrame:TweenSize(newUDim2(0, 170, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  559. wait(0.15);
  560. colorPickingFrame.Visible = false;
  561. self.bodyFrame.CanvasSize = oldSize;
  562. end;
  563. end);
  564.  
  565. rainbowBtn.MouseButton1Click:Connect(function()
  566. config[title] = "Rainbow";
  567. saveConfig();
  568. rainbow = true;
  569. popup:new("Set " .. title .. " to rainbow");
  570. end);
  571.  
  572. hueSatFrame.InputBegan:Connect(function(input)
  573. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  574. hueSatDragging = true;
  575. end;
  576. end);
  577.  
  578. hueSatFrame.InputEnded:Connect(function(input)
  579. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  580. hueSatDragging = false;
  581. config[title] = {R = colorFrame.BackgroundColor3.R * 255, G = colorFrame.BackgroundColor3.G * 255, B = colorFrame.BackgroundColor3.B * 255};
  582. saveConfig();
  583. popup:new("Set " .. title .. " to " .. floor(colorFrame.BackgroundColor3.R * 255) .. " " .. floor(colorFrame.BackgroundColor3.G * 255) .. " " .. floor(colorFrame.BackgroundColor3.B * 255));
  584. end;
  585. end);
  586.  
  587. valueFrame.InputBegan:Connect(function(input)
  588. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  589. valueDragging = true;
  590. end;
  591. end)
  592.  
  593. valueFrame.InputEnded:Connect(function(input)
  594. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  595. valueDragging = false;
  596. config[title] = {R = colorFrame.BackgroundColor3.R * 255, G = colorFrame.BackgroundColor3.G * 255, B = colorFrame.BackgroundColor3.B * 255};
  597. saveConfig();
  598. popup:new("Set " .. title .. " to " .. floor(colorFrame.BackgroundColor3.R) .. " " .. floor(colorFrame.BackgroundColor3.G) .. " " .. floor(colorFrame.BackgroundColor3.B));
  599. end;
  600. end);
  601.  
  602. game:GetService("UserInputService").InputChanged:Connect(function(input)
  603. if hueSatDragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  604. rainbow = false;
  605. hueSatIndicatorFrame.Position = newUDim2(clamp((input.Position.X - hueSatFrame.AbsolutePosition.X) / hueSatFrame.AbsoluteSize.X, 0, 1), 0, clamp((input.Position.Y - hueSatFrame.AbsolutePosition.Y) / hueSatFrame.AbsoluteSize.Y, 0, 1), 0);
  606. valueIndicatorFrame.BackgroundColor3 = fromHSV(h, 1 - (1 - hueSatIndicatorFrame.Position.Y.Scale), 1);
  607. colorFrame.BackgroundColor3 = fromHSV(hueSatIndicatorFrame.Position.X.Scale, 1 - hueSatIndicatorFrame.Position.Y.Scale, 1 - valueIndicatorFrame.Position.Y.Scale);
  608. valueFrame.ImageColor3 = fromHSV(hueSatIndicatorFrame.Position.X.Scale, 1 - hueSatIndicatorFrame.Position.Y.Scale, 1);
  609. callback(colorFrame.BackgroundColor3);
  610. elseif valueDragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  611. rainbow = false;
  612. valueIndicatorFrame.Position = newUDim2(0, 0, clamp((input.Position.Y - valueFrame.AbsolutePosition.Y) / valueFrame.AbsoluteSize.Y, 0, 1), 0);
  613. valueIndicatorFrame.BackgroundColor3 = fromHSV(h, 1 - (1 - hueSatIndicatorFrame.Position.Y.Scale), 1);
  614. colorFrame.BackgroundColor3 = fromHSV(hueSatIndicatorFrame.Position.X.Scale, 1 - hueSatIndicatorFrame.Position.Y.Scale, 1 - valueIndicatorFrame.Position.Y.Scale);
  615. valueFrame.ImageColor3 = fromHSV(hueSatIndicatorFrame.Position.X.Scale, 1 - hueSatIndicatorFrame.Position.Y.Scale, 1);
  616. callback(colorFrame.BackgroundColor3);
  617. end;
  618. end);
  619.  
  620. spawn(function()
  621. while true do
  622. for i = 1, 230 do
  623. rainbowBtn.TextColor3 = fromHSV(i / 230, 1, 1);
  624. if rainbow then
  625. colorFrame.BackgroundColor3 = fromHSV(i / 230, 1, 1);
  626. callback(fromHSV(i / 230, 1, 1));
  627. end;
  628. wait();
  629. end;
  630. wait();
  631. end;
  632. end);
  633. end;
  634.  
  635. function OwlLib.Content:newDropdown(title, callback, list, noCallbackOnStart)
  636. self:Resize(self.bodyFrame);
  637.  
  638. local oldSize;
  639. local btn = game:GetObjects("rbxassetid://4531687341")[1];
  640. btn.Parent = self.bodyFrame;
  641. btn.titleLabel.Text = title;
  642. btn.titleLabel.Size = newUDim2(0, btn.titleLabel.TextBounds.X, 1, 0);
  643. btn.Size = newUDim2(0, btn.titleLabel.Size.X.Offset + 80, 0, 30);
  644.  
  645. if not noCallbackOnStart then
  646. callback(config[title] and config[title] or list[1]);
  647. if config[title] then
  648. popup:new("Set " .. title .. " to " .. config[title]);
  649. end;
  650. end;
  651.  
  652. local arrowLabel = btn.arrowLabel;
  653. local bodyFrame = btn.bodyFrame;
  654.  
  655. self:initBtnEffect(btn);
  656.  
  657. local function refresh(list)
  658. for i, v in next, bodyFrame:GetChildren() do
  659. if not v:IsA("UIListLayout") then v:Destroy(); end;
  660. end
  661. for i, v in next, list do
  662. local btn = game:GetObjects("rbxassetid://4531683854")[1];
  663. btn.Parent = bodyFrame;
  664. btn.Text = v;
  665. btn.ZIndex = 2;
  666.  
  667. local btnHover = tweenService:Create(btn, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 0.5});
  668. local btnHover1 = tweenService:Create(btn, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 1});
  669.  
  670. btn.InputBegan:Connect(function(input)
  671. if input.UserInputType == Enum.UserInputType.MouseMovement then
  672. btnHover:Play();
  673. end;
  674. end);
  675.  
  676. btn.InputEnded:Connect(function(input)
  677. if input.UserInputType == Enum.UserInputType.MouseMovement then
  678. btnHover1:Play();
  679. end;
  680. end);
  681.  
  682. local arrowTween = tweenService:Create(arrowLabel, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = 180});
  683.  
  684. btn.MouseButton1Click:Connect(function()
  685. config[title] = v;
  686. saveConfig();
  687. callback(v);
  688. popup:new("Set " .. title .. " to " .. v);
  689. arrowTween:Play();
  690. bodyFrame:TweenSize(newUDim2(0, 170, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  691. wait(0.15);
  692. bodyFrame.Visible = false;
  693. self.bodyFrame.CanvasSize = oldSize;
  694. end);
  695. end;
  696. end
  697.  
  698. refresh(list);
  699.  
  700. local arrowTween = tweenService:Create(arrowLabel, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = 0});
  701. local arrowTween1 = tweenService:Create(arrowLabel, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = 180});
  702.  
  703. btn.MouseButton1Click:Connect(function()
  704. if not bodyFrame.Visible then
  705. oldSize = self.bodyFrame.CanvasSize;
  706. self.bodyFrame.CanvasSize = oldSize + newUDim2(0, 0, 0, 170);
  707. bodyFrame.Visible = true;
  708. arrowTween:Play();
  709. bodyFrame:TweenSize(newUDim2(0, 170, 0, (#bodyFrame:GetChildren() - 1) * 27), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  710. elseif bodyFrame.Visible then
  711. arrowTween1:Play();
  712. bodyFrame:TweenSize(newUDim2(0, 170, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
  713. wait(0.15);
  714. bodyFrame.Visible = false;
  715. self.bodyFrame.CanvasSize = oldSize;
  716. end;
  717. end);
  718.  
  719. return {
  720. Refresh = function(self, list)
  721. refresh(list);
  722. end
  723. }
  724. end;
  725.  
  726. return OwlLib;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement