Advertisement
Vzurxy

owlhubuiport

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