Advertisement
Ihaveashortname

OwlHub LIB

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