Advertisement
Joldezz

Untitled

Apr 24th, 2022 (edited)
910
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.41 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Mouse = Player:GetMouse()
  3.  
  4. local TweenService = game:GetService("TweenService")
  5. local UserInputService = game:GetService("UserInputService")
  6. local CoreGuiService = game:GetService("CoreGui")
  7. local RunService = game:GetService("RunService")
  8. local TextService = game:GetService("TextService")
  9.  
  10. local TweenTime = 0.09
  11. local Level = 1
  12.  
  13. local GlobalTweenInfo = TweenInfo.new(TweenTime)
  14. local AlteredTweenInfo = TweenInfo.new(TweenTime, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
  15.  
  16. local DropShadowID = "rbxassetid://297774371"
  17. local DropShadowTransparency = 0.7
  18.  
  19. local IconLibraryID = "rbxassetid://3926305904"
  20. local IconLibraryID2 = "rbxassetid://3926307971"
  21.  
  22. local MainFont = Enum.Font.Gotham
  23.  
  24. local function GetXY(GuiObject)
  25.     local X, Y = Mouse.X - GuiObject.AbsolutePosition.X, Mouse.Y - GuiObject.AbsolutePosition.Y
  26.     local MaxX, MaxY = GuiObject.AbsoluteSize.X, GuiObject.AbsoluteSize.Y
  27.     X, Y = math.clamp(X, 0, MaxX), math.clamp(Y, 0, MaxY)
  28.     return X, Y, X/MaxX, Y/MaxY
  29. end
  30.  
  31. local function TitleIcon(ButtonOrNot)
  32.     local NewTitleIcon = Instance.new(ButtonOrNot and "ImageButton" or "ImageLabel")
  33.     NewTitleIcon.Name = "TitleIcon"
  34.     NewTitleIcon.BackgroundTransparency = 1
  35.     NewTitleIcon.Image = IconLibraryID
  36.     NewTitleIcon.ImageRectOffset = Vector2.new(524, 764)
  37.     NewTitleIcon.ImageRectSize = Vector2.new(36, 36)
  38.     NewTitleIcon.Size = UDim2.new(0,14,0,14)
  39.     NewTitleIcon.Position = UDim2.new(1,-17,0,3)
  40.     NewTitleIcon.Rotation = 180
  41.     NewTitleIcon.ZIndex = Level
  42.     return NewTitleIcon
  43. end
  44.  
  45. local function TickIcon(ButtonOrNot)
  46.     local NewTickIcon = Instance.new(ButtonOrNot and "ImageButton" or "ImageLabel")
  47.     NewTickIcon.Name = "TickIcon"
  48.     NewTickIcon.BackgroundTransparency = 1
  49.     NewTickIcon.Image = "rbxassetid://3926305904"
  50.     NewTickIcon.ImageRectOffset = Vector2.new(312,4)
  51.     NewTickIcon.ImageRectSize = Vector2.new(24,24)
  52.     NewTickIcon.Size = UDim2.new(1,-6,1,-6)
  53.     NewTickIcon.Position = UDim2.new(0,3,0,3)
  54.     NewTickIcon.ZIndex = Level
  55.     return NewTickIcon
  56. end
  57.  
  58. local function DropdownIcon(ButtonOrNot)
  59.     local NewDropdownIcon = Instance.new(ButtonOrNot and "ImageButton" or "ImageLabel")
  60.     NewDropdownIcon.Name = "DropdownIcon"
  61.     NewDropdownIcon.BackgroundTransparency = 1
  62.     NewDropdownIcon.Image = IconLibraryID2
  63.     NewDropdownIcon.ImageRectOffset = Vector2.new(324,364)
  64.     NewDropdownIcon.ImageRectSize = Vector2.new(36,36)
  65.     NewDropdownIcon.Size = UDim2.new(0,16,0,16)
  66.     NewDropdownIcon.Position = UDim2.new(1,-18,0,2)
  67.     NewDropdownIcon.ZIndex = Level
  68.     return NewDropdownIcon
  69. end
  70.  
  71. local function SearchIcon(ButtonOrNot)
  72.     local NewSearchIcon = Instance.new(ButtonOrNot and "ImageButton" or "ImageLabel")
  73.     NewSearchIcon.Name = "SearchIcon"
  74.     NewSearchIcon.BackgroundTransparency = 1
  75.     NewSearchIcon.Image = IconLibraryID
  76.     NewSearchIcon.ImageRectOffset = Vector2.new(964,324)
  77.     NewSearchIcon.ImageRectSize = Vector2.new(36,36)
  78.     NewSearchIcon.Size = UDim2.new(0,16,0,16)
  79.     NewSearchIcon.Position = UDim2.new(0,2,0,2)
  80.     NewSearchIcon.ZIndex = Level
  81.     return NewSearchIcon
  82. end
  83.  
  84. local function RoundBox(CornerRadius, ButtonOrNot)
  85.     local NewRoundBox = Instance.new(ButtonOrNot and "ImageButton" or "ImageLabel")
  86.     NewRoundBox.BackgroundTransparency = 1
  87.     NewRoundBox.Image = "rbxassetid://3570695787"
  88.     NewRoundBox.SliceCenter = Rect.new(100,100,100,100)
  89.     NewRoundBox.SliceScale = math.clamp((CornerRadius or 5) * 0.01, 0.01, 1)
  90.     NewRoundBox.ScaleType = Enum.ScaleType.Slice
  91.     NewRoundBox.ZIndex = Level
  92.     return NewRoundBox
  93. end
  94.  
  95. local function DropShadow()
  96.     local NewDropShadow = Instance.new("ImageLabel")
  97.     NewDropShadow.Name = "DropShadow"
  98.     NewDropShadow.BackgroundTransparency = 1
  99.     NewDropShadow.Image = DropShadowID
  100.     NewDropShadow.ImageTransparency = DropShadowTransparency
  101.     NewDropShadow.Size = UDim2.new(1,0,1,0)
  102.     NewDropShadow.ZIndex = Level
  103.     return NewDropShadow
  104. end
  105.  
  106. local function Frame()
  107.     local NewFrame = Instance.new("Frame")
  108.     NewFrame.BorderSizePixel = 0
  109.     NewFrame.ZIndex = Level
  110.     return NewFrame
  111. end
  112.  
  113. local function ScrollingFrame()
  114.     local NewScrollingFrame = Instance.new("ScrollingFrame")
  115.     NewScrollingFrame.BackgroundTransparency = 1
  116.     NewScrollingFrame.BorderSizePixel = 0
  117.     NewScrollingFrame.ScrollBarThickness = 0
  118.     NewScrollingFrame.ZIndex = Level
  119.     return NewScrollingFrame
  120. end
  121.  
  122. local function TextButton(Text, Size)
  123.     local NewTextButton = Instance.new("TextButton")
  124.     NewTextButton.Text = Text
  125.     NewTextButton.AutoButtonColor = false
  126.     NewTextButton.Font = MainFont
  127.     NewTextButton.TextColor3 = Color3.fromRGB(255,255,255)
  128.     NewTextButton.BackgroundTransparency = 1
  129.     NewTextButton.TextSize = Size or 12
  130.     NewTextButton.Size = UDim2.new(1,0,1,0)
  131.     NewTextButton.ZIndex = Level
  132.     return NewTextButton
  133. end
  134.  
  135. local function TextBox(Text, Size)
  136.     local NewTextBox = Instance.new("TextBox")
  137.     NewTextBox.Text = Text
  138.     NewTextBox.Font = MainFont
  139.     NewTextBox.TextColor3 = Color3.fromRGB(255,255,255)
  140.     NewTextBox.BackgroundTransparency = 1
  141.     NewTextBox.TextSize = Size or 12
  142.     NewTextBox.Size = UDim2.new(1,0,1,0)
  143.     NewTextBox.ZIndex = Level
  144.     return NewTextBox
  145. end
  146.  
  147. local function TextLabel(Text, Size)
  148.     local NewTextLabel = Instance.new("TextLabel")
  149.     NewTextLabel.Text = Text
  150.     NewTextLabel.Font = MainFont
  151.     NewTextLabel.TextColor3 = Color3.fromRGB(255,255,255)
  152.     NewTextLabel.BackgroundTransparency = 1
  153.     NewTextLabel.TextSize = Size or 12
  154.     NewTextLabel.Size = UDim2.new(1,0,1,0)
  155.     NewTextLabel.ZIndex = Level
  156.     return NewTextLabel
  157. end
  158.  
  159. local function Tween(GuiObject, Dictionary)
  160.     local TweenBase = TweenService:Create(GuiObject, GlobalTweenInfo, Dictionary)
  161.     TweenBase:Play()
  162.     return TweenBase
  163. end
  164.  
  165. local UILibrary = {}
  166.  
  167. function UILibrary.Load(GUITitle)
  168.     local TargetedParent = RunService:IsStudio() and Player:WaitForChild("PlayerGui") or CoreGuiService
  169.    
  170.     local FindOldInstance = TargetedParent:FindFirstChild(GUITitle)
  171.    
  172.     if FindOldInstance then
  173.         FindOldInstance:Destroy()
  174.     end
  175.    
  176.     local NewInstance, ContainerFrame, ContainerShadow, MainFrame
  177.    
  178.     NewInstance = Instance.new("ScreenGui")
  179.     NewInstance.Name = GUITitle
  180.     NewInstance.Parent = TargetedParent
  181.    
  182.     ContainerFrame = Frame()
  183.     ContainerFrame.Name = "ContainerFrame"
  184.     ContainerFrame.Size = UDim2.new(0,500,0,300)
  185.     ContainerFrame.Position = UDim2.new(0.5,-250,0.5,-150)
  186.     ContainerFrame.BackgroundTransparency = 1
  187.     ContainerFrame.Parent = NewInstance
  188.    
  189.     ContainerShadow = DropShadow()
  190.     ContainerShadow.Name = "Shadow"
  191.     ContainerShadow.Parent = ContainerFrame
  192.    
  193.     Level += 1
  194.    
  195.     MainFrame = RoundBox(5)
  196.     MainFrame.ClipsDescendants = true
  197.     MainFrame.Name = "MainFrame"
  198.     MainFrame.Size = UDim2.new(1,-50,1,-30)
  199.     MainFrame.Position = UDim2.new(0,25,0,15)
  200.     MainFrame.ImageColor3 = Color3.fromRGB(30,30,30)
  201.     MainFrame.Parent = ContainerFrame
  202.    
  203.     local MenuBar, DisplayFrame, TitleBar
  204.    
  205.     MenuBar = ScrollingFrame()
  206.     MenuBar.Name = "MenuBar"
  207.     MenuBar.BackgroundTransparency = 0.7
  208.     MenuBar.BackgroundColor3 = Color3.fromRGB(20,20,20)
  209.     MenuBar.Size = UDim2.new(0,100,0,235)
  210.     MenuBar.Position = UDim2.new(0,5,0,30)
  211.     MenuBar.CanvasSize = UDim2.new(0,0,0,0)
  212.     MenuBar.Parent = MainFrame
  213.    
  214.     DisplayFrame = RoundBox(5)
  215.     DisplayFrame.Name = "Display"
  216.     DisplayFrame.ImageColor3 = Color3.fromRGB(20,20,20)
  217.     DisplayFrame.Size = UDim2.new(1,-115,0,235)
  218.     DisplayFrame.Position = UDim2.new(0,110,0,30)
  219.     DisplayFrame.Parent = MainFrame
  220.    
  221.     TitleBar = RoundBox(5)
  222.     TitleBar.Name = "TitleBar"
  223.     TitleBar.ImageColor3 = Color3.fromRGB(40,40,40)
  224.     TitleBar.Size = UDim2.new(1,-10,0,20)
  225.     TitleBar.Position = UDim2.new(0,5,0,5)
  226.     TitleBar.Parent = MainFrame
  227.    
  228.     Level += 1
  229.    
  230.     local MinimiseButton, TitleButton
  231.     local MinimiseToggle = true
  232.    
  233.     MinimiseButton = TitleIcon(true)
  234.     MinimiseButton.Name = "Minimise"
  235.     MinimiseButton.Parent = TitleBar
  236.     MinimiseButton.Visible = false
  237.    
  238.     TitleButton = TextButton(GUITitle, 14)
  239.     TitleButton.Name = "TitleButton"
  240.     TitleButton.Size = UDim2.new(1,-20,1,0)
  241.     TitleButton.Parent = TitleBar
  242.    
  243.     MinimiseButton.MouseButton1Down:Connect(function()
  244.         MinimiseToggle = not MinimiseToggle
  245.         if not MinimiseToggle then
  246.             Tween(MainFrame, {Size = UDim2.new(1,-50,0,30)})
  247.             Tween(MinimiseButton, {Rotation = 0})
  248.             Tween(ContainerShadow, {ImageTransparency = 1})
  249.         else
  250.             Tween(MainFrame, {Size = UDim2.new(1,-50,1,-30)})
  251.             Tween(MinimiseButton, {Rotation = 180})
  252.             Tween(ContainerShadow, {ImageTransparency = DropShadowTransparency})
  253.         end
  254.     end)
  255.    
  256.     TitleButton.MouseButton1Down:Connect(function()
  257.         local LastMX, LastMY = Mouse.X, Mouse.Y
  258.         local Move, Kill
  259.         Move = Mouse.Move:Connect(function()
  260.             local NewMX, NewMY = Mouse.X, Mouse.Y
  261.             local DX, DY = NewMX - LastMX, NewMY - LastMY
  262.             ContainerFrame.Position += UDim2.new(0,DX,0,DY)
  263.             LastMX, LastMY = NewMX, NewMY
  264.         end)
  265.         Kill = UserInputService.InputEnded:Connect(function(input)
  266.             if input.UserInputType == Enum.UserInputType.MouseButton1 then
  267.                 Move:Disconnect()
  268.                 Kill:Disconnect()
  269.             end
  270.         end)
  271.     end)
  272.    
  273.     Level += 1
  274.    
  275.     local MenuListLayout
  276.    
  277.     MenuListLayout = Instance.new("UIListLayout")
  278.     MenuListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  279.     MenuListLayout.Padding = UDim.new(0,5)
  280.     MenuListLayout.Parent = MenuBar
  281.    
  282.     local TabCount = 0
  283.    
  284.     local TabLibrary = {}
  285.    
  286.     function TabLibrary.AddPage(PageTitle)
  287.        
  288.         local PageContainer = RoundBox(5)
  289.         PageContainer.Name = PageTitle
  290.         PageContainer.Size = UDim2.new(1,0,0,20)
  291.         PageContainer.LayoutOrder = TabCount
  292.         PageContainer.ImageColor3 = (TabCount == 0) and Color3.fromRGB(50,50,50) or Color3.fromRGB(40,40,40)
  293.         PageContainer.Parent = MenuBar
  294.        
  295.         local PageButton = TextButton(PageTitle, 14)
  296.         PageButton.Name = PageTitle.."Button"
  297.         PageButton.TextTransparency = (TabCount == 0) and 0 or 0.5
  298.         PageButton.Parent = PageContainer
  299.        
  300.         PageButton.MouseButton1Down:Connect(function()
  301.             spawn(function()
  302.                 for _, Button in next, MenuBar:GetChildren() do
  303.                     if Button:IsA("GuiObject") then
  304.                         local IsButton = string.find(Button.Name:lower(), PageContainer.Name:lower())
  305.                         local Button2 = Button:FindFirstChild(Button.Name.."Button")
  306.                         Tween(Button, {ImageColor3 = IsButton and Color3.fromRGB(50,50,50) or Color3.fromRGB(40,40,40)})
  307.                         Tween(Button2, {TextTransparency = IsButton and 0 or 0.5})
  308.                     end
  309.                 end
  310.             end)
  311.             spawn(function()
  312.                 for _, Display in next, DisplayFrame:GetChildren() do
  313.                     if Display:IsA("GuiObject") then
  314.                         Display.Visible = string.find(Display.Name:lower(), PageContainer.Name:lower())
  315.                     end
  316.                 end
  317.             end)
  318.         end)
  319.        
  320.         local DisplayPage = ScrollingFrame()
  321.         DisplayPage.Visible = (TabCount == 0)
  322.         DisplayPage.Name = PageTitle
  323.         DisplayPage.Size = UDim2.new(1,0,1,0)
  324.         DisplayPage.Parent = DisplayFrame
  325.        
  326.         TabCount += 1
  327.        
  328.         local DisplayList = Instance.new("UIListLayout")
  329.         DisplayList.SortOrder = Enum.SortOrder.LayoutOrder
  330.         DisplayList.Padding = UDim.new(0,5)
  331.         DisplayList.Parent = DisplayPage
  332.        
  333.         DisplayList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  334.             local Y1 = DisplayList.AbsoluteContentSize.Y
  335.             local Y2 = DisplayPage.AbsoluteWindowSize.Y
  336.             DisplayPage.CanvasSize = UDim2.new(0,0,(Y1/Y2)+0.05,0)
  337.         end)
  338.        
  339.         local DisplayPadding = Instance.new("UIPadding")
  340.         DisplayPadding.PaddingBottom = UDim.new(0,5)
  341.         DisplayPadding.PaddingTop = UDim.new(0,5)
  342.         DisplayPadding.PaddingLeft = UDim.new(0,5)
  343.         DisplayPadding.PaddingRight = UDim.new(0,5)
  344.         DisplayPadding.Parent = DisplayPage
  345.        
  346.         local PageLibrary = {}
  347.        
  348.         function PageLibrary.AddButton(Text, Callback, Parent, Underline)
  349.             local ButtonContainer = Frame()
  350.             ButtonContainer.Name = Text.."BUTTON"
  351.             ButtonContainer.Size = UDim2.new(1,0,0,20)
  352.             ButtonContainer.BackgroundTransparency = 1
  353.             ButtonContainer.Parent = Parent or DisplayPage
  354.            
  355.             local ButtonForeground = RoundBox(5)
  356.             ButtonForeground.Name = "ButtonForeground"
  357.             ButtonForeground.Size = UDim2.new(1,0,1,0)
  358.             ButtonForeground.ImageColor3 = Color3.fromRGB(35,35,35)
  359.             ButtonForeground.Parent = ButtonContainer
  360.            
  361.             if Underline then
  362.                 local TextSize = TextService:GetTextSize(Text, 12, Enum.Font.Gotham, Vector2.new(0,0))
  363.            
  364.                 local BottomEffect = Frame()
  365.                 BottomEffect.Size = UDim2.new(0,TextSize.X,0,1)
  366.                 BottomEffect.Position = UDim2.new(0.5,(-TextSize.X/2)-1,1,-1)
  367.                 BottomEffect.BackgroundColor3 = Color3.fromRGB(255,255,255)
  368.                 BottomEffect.BackgroundTransparency = 0.5
  369.                 BottomEffect.Parent = ButtonForeground
  370.             end
  371.            
  372.             local HiddenButton = TextButton(Text, 12)
  373.             HiddenButton.Parent = ButtonForeground
  374.            
  375.             HiddenButton.MouseButton1Down:Connect(function()
  376.                 Callback()
  377.                 Tween(ButtonForeground, {ImageColor3 = Color3.fromRGB(45,45,45)})
  378.                 Tween(HiddenButton, {TextTransparency = 0.5})
  379.                 wait(TweenTime)
  380.                 Tween(ButtonForeground, {ImageColor3 = Color3.fromRGB(35,35,35)})
  381.                 Tween(HiddenButton, {TextTransparency = 0})
  382.             end)
  383.         end
  384.        
  385.         function PageLibrary.AddLabel(Text)
  386.             local LabelContainer = Frame()
  387.             LabelContainer.Name = Text.."LABEL"
  388.             LabelContainer.Size = UDim2.new(1,0,0,20)
  389.             LabelContainer.BackgroundTransparency = 1
  390.             LabelContainer.Parent = DisplayPage
  391.            
  392.             local LabelForeground = RoundBox(5)
  393.             LabelForeground.Name = "LabelForeground"
  394.             LabelForeground.ImageColor3 = Color3.fromRGB(45,45,45)
  395.             LabelForeground.Size = UDim2.new(1,0,1,0)
  396.             LabelForeground.Parent = LabelContainer
  397.            
  398.             local HiddenLabel = TextLabel(Text, 12)
  399.             HiddenLabel.Parent = LabelForeground
  400.         end
  401.        
  402.         function PageLibrary.AddDropdown(Text, ConfigurationArray, Callback)
  403.             local DropdownArray = ConfigurationArray or {}
  404.            
  405.             local DropdownToggle = false
  406.            
  407.             local DropdownContainer = Frame()
  408.             DropdownContainer.Size = UDim2.new(1,0,0,20)
  409.             DropdownContainer.Name = Text.."DROPDOWN"
  410.             DropdownContainer.BackgroundTransparency = 1
  411.             DropdownContainer.Parent = DisplayPage
  412.            
  413.             local DropdownForeground = RoundBox(5)
  414.             DropdownForeground.ClipsDescendants = true
  415.             DropdownForeground.ImageColor3 = Color3.fromRGB(35,35,35)
  416.             DropdownForeground.Size = UDim2.new(1,0,1,0)
  417.             DropdownForeground.Parent = DropdownContainer
  418.            
  419.             local DropdownExpander = DropdownIcon(true)
  420.             DropdownExpander.Parent = DropdownForeground
  421.            
  422.             local DropdownLabel = TextLabel(Text, 12)
  423.             DropdownLabel.Size = UDim2.new(1,0,0,20)
  424.             DropdownLabel.Parent = DropdownForeground
  425.            
  426.             local DropdownFrame = Frame()
  427.             DropdownFrame.Position = UDim2.new(0,0,0,20)
  428.             DropdownFrame.BackgroundTransparency = 1
  429.             DropdownFrame.Size = UDim2.new(1,0,0,#DropdownArray*20)
  430.             DropdownFrame.Parent = DropdownForeground
  431.            
  432.             local DropdownList = Instance.new("UIListLayout")
  433.             DropdownList.Parent = DropdownFrame
  434.            
  435.             for OptionIndex, Option in next, DropdownArray do
  436.                 PageLibrary.AddButton(Option, function()
  437.                     Callback(Option)
  438.                     DropdownLabel.Text = Text..": "..Option
  439.                 end, DropdownFrame, OptionIndex < #DropdownArray)
  440.             end
  441.            
  442.             DropdownExpander.MouseButton1Down:Connect(function()
  443.                 DropdownToggle = not DropdownToggle
  444.                 Tween(DropdownContainer, {Size = DropdownToggle and UDim2.new(1,0,0,20+(#DropdownArray*20)) or UDim2.new(1,0,0,20)})
  445.                 Tween(DropdownExpander, {Rotation = DropdownToggle and 135 or 0})
  446.             end)
  447.         end
  448.        
  449.         function PageLibrary.AddColourPicker(Text, DefaultColour, Callback)
  450.             local DefaultColour = DefaultColour or Color3.fromRGB(255,255,255)
  451.            
  452.             local ColourDictionary = {
  453.                 white = Color3.fromRGB(255,255,255),
  454.                 black = Color3.fromRGB(0,0,0),
  455.                 red = Color3.fromRGB(255,0,0),
  456.                 green = Color3.fromRGB(0,255,0),
  457.                 blue = Color3.fromRGB(0,0,255)
  458.             }
  459.            
  460.             if typeof(DefaultColour) == "table" then
  461.                 DefaultColour = Color3.fromRGB(DefaultColour[1] or 255, DefaultColour[2] or 255, DefaultColour[3] or 255)
  462.             elseif typeof(DefaultColour) == "string" then
  463.                 DefaultColour = ColourDictionary[DefaultColour:lower()] or ColourDictionary["white"]
  464.             end
  465.            
  466.             local PickerContainer = Frame()
  467.             PickerContainer.ClipsDescendants = true
  468.             PickerContainer.Size = UDim2.new(1,0,0,20)
  469.             PickerContainer.Name = Text.."COLOURPICKER"
  470.             PickerContainer.BackgroundTransparency = 1
  471.             PickerContainer.Parent = DisplayPage
  472.            
  473.             local ColourTracker = Instance.new("Color3Value")
  474.             ColourTracker.Value = DefaultColour
  475.             ColourTracker.Parent = PickerContainer
  476.            
  477.             local PickerLeftSide, PickerRightSide, PickerFrame = RoundBox(5), RoundBox(5), RoundBox(5)
  478.            
  479.             PickerLeftSide.Size = UDim2.new(1,-22,1,0)
  480.             PickerLeftSide.ImageColor3 = Color3.fromRGB(35,35,35)
  481.             PickerLeftSide.Parent = PickerContainer
  482.            
  483.             PickerRightSide.Size = UDim2.new(0,20,1,0)
  484.             PickerRightSide.Position = UDim2.new(1,-20,0,0)
  485.             PickerRightSide.ImageColor3 = DefaultColour
  486.             PickerRightSide.Parent = PickerContainer
  487.            
  488.             PickerFrame.ImageColor3 = Color3.fromRGB(35,35,35)
  489.             PickerFrame.Size = UDim2.new(1,-22,0,60)
  490.             PickerFrame.Position = UDim2.new(0,0,0,20)
  491.             PickerFrame.Parent = PickerContainer
  492.            
  493.             local PickerList = Instance.new("UIListLayout")
  494.             PickerList.SortOrder = Enum.SortOrder.LayoutOrder
  495.             PickerList.Parent = PickerFrame
  496.            
  497.             local RedPicker = PageLibrary.AddSlider("R", {Min = 0, Max = 255, Def = ColourTracker.Value.R * 255}, function(Value)
  498.                 ColourTracker.Value = Color3.fromRGB(Value, ColourTracker.Value.G * 255, ColourTracker.Value.B * 255)
  499.                 Callback(ColourTracker.Value)
  500.             end, PickerFrame)
  501.            
  502.             local BluePicker = PageLibrary.AddSlider("G", {Min = 0, Max = 255, Def = ColourTracker.Value.G * 255}, function(Value)
  503.                 ColourTracker.Value = Color3.fromRGB(ColourTracker.Value.R * 255, Value, ColourTracker.Value.B * 255)
  504.                 Callback(ColourTracker.Value)
  505.             end, PickerFrame)
  506.            
  507.             local GreenPicker = PageLibrary.AddSlider("B", {Min = 0, Max = 255, Def = ColourTracker.Value.B * 255}, function(Value)
  508.                 ColourTracker.Value = Color3.fromRGB(ColourTracker.Value.R * 255, ColourTracker.Value.G * 255, Value)
  509.                 Callback(ColourTracker.Value)
  510.             end, PickerFrame)
  511.            
  512.             local EffectLeft, EffectRight = Frame(), Frame()
  513.            
  514.             EffectLeft.BackgroundColor3 = Color3.fromRGB(35,35,35)
  515.             EffectLeft.Position = UDim2.new(1,-5,0,0)
  516.             EffectLeft.Size = UDim2.new(0,5,1,0)
  517.             EffectLeft.Parent = PickerLeftSide
  518.            
  519.             EffectRight.BackgroundColor3 = DefaultColour
  520.             EffectRight.Size = UDim2.new(0,5,1,0)
  521.             EffectRight.Parent = PickerRightSide
  522.            
  523.             local PickerLabel = TextLabel(Text, 12)
  524.             PickerLabel.Size = UDim2.new(1,0,0,20)
  525.             PickerLabel.Parent = PickerLeftSide
  526.            
  527.             ColourTracker:GetPropertyChangedSignal("Value"):Connect(function()
  528.                 local NewValue = ColourTracker.Value
  529.                 EffectRight.BackgroundColor3 = NewValue
  530.                 PickerRightSide.ImageColor3 = NewValue
  531.             end)
  532.            
  533.             local PickerToggle = false
  534.            
  535.             local PickerButton = TextButton("")
  536.             PickerButton.Parent = PickerRightSide
  537.            
  538.             PickerButton.MouseButton1Down:Connect(function()
  539.                 PickerToggle = not PickerToggle
  540.                 Tween(PickerContainer, {Size = PickerToggle and UDim2.new(1,0,0,80) or UDim2.new(1,0,0,20)})
  541.             end)
  542.         end
  543.        
  544.         function PageLibrary.AddSlider(Text, ConfigurationDictionary, Callback, Parent)
  545.             local Configuration = ConfigurationDictionary
  546.             local Minimum = Configuration.Minimum or Configuration.minimum or Configuration.Min or Configuration.min
  547.             local Maximum = Configuration.Maximum or Configuration.maximum or Configuration.Max or Configuration.max
  548.             local Default = Configuration.Default or Configuration.default or Configuration.Def or Configuration.def
  549.            
  550.             if Minimum > Maximum then
  551.                 local StoreValue = Minimum
  552.                 Minimum = Maximum
  553.                 Maximum = StoreValue
  554.             end
  555.            
  556.             Default = math.clamp(Default, Minimum, Maximum)
  557.            
  558.             local DefaultScale = Default/Maximum
  559.            
  560.             local SliderContainer = Frame()
  561.             SliderContainer.Name = Text.."SLIDER"
  562.             SliderContainer.Size = UDim2.new(1,0,0,20)
  563.             SliderContainer.BackgroundTransparency = 1
  564.             SliderContainer.Parent = Parent or DisplayPage
  565.            
  566.             local SliderForeground = RoundBox(5)
  567.             SliderForeground.Name = "SliderForeground"
  568.             SliderForeground.ImageColor3 = Color3.fromRGB(35,35,35)
  569.             SliderForeground.Size = UDim2.new(1,0,1,0)
  570.             SliderForeground.Parent = SliderContainer
  571.            
  572.             local SliderButton = TextButton(Text..": "..Default)
  573.             SliderButton.Size = UDim2.new(1,0,1,0)
  574.             SliderButton.ZIndex = 6
  575.             SliderButton.Parent = SliderForeground
  576.            
  577.             local SliderFill = RoundBox(5)
  578.             SliderFill.Size = UDim2.new(DefaultScale,0,1,0)
  579.             SliderFill.ImageColor3 = Color3.fromRGB(70,70,70)
  580.             SliderFill.ZIndex = 5
  581.             SliderFill.ImageTransparency = 0.7
  582.             SliderFill.Parent = SliderButton
  583.            
  584.             SliderButton.MouseButton1Down:Connect(function()
  585.                 Tween(SliderFill, {ImageTransparency = 0.5})
  586.                 local X, Y, XScale, YScale = GetXY(SliderButton)
  587.                 local Value = math.floor(Minimum + ((Maximum - Minimum) * XScale))
  588.                 Callback(Value)
  589.                 SliderButton.Text = Text..": "..tostring(Value)
  590.                 local TargetSize = UDim2.new(XScale,0,1,0)
  591.                 Tween(SliderFill, {Size = TargetSize})
  592.                 local SliderMove, SliderKill
  593.                 SliderMove = Mouse.Move:Connect(function()
  594.                     Tween(SliderFill, {ImageTransparency = 0.5})
  595.                     local X, Y, XScale, YScale = GetXY(SliderButton)
  596.                     local Value = math.floor(Minimum + ((Maximum - Minimum) * XScale))
  597.                     Callback(Value)
  598.                     SliderButton.Text = Text..": "..tostring(Value)
  599.                     local TargetSize = UDim2.new(XScale,0,1,0)
  600.                     Tween(SliderFill, {Size = TargetSize})
  601.                 end)
  602.                 SliderKill = UserInputService.InputEnded:Connect(function(UserInput)
  603.                     if UserInput.UserInputType == Enum.UserInputType.MouseButton1 then
  604.                         Tween(SliderFill, {ImageTransparency = 0.7})
  605.                         SliderMove:Disconnect()
  606.                         SliderKill:Disconnect()
  607.                     end
  608.                 end)
  609.             end)
  610.         end
  611.        
  612.         function PageLibrary.AddToggle(Text, Default, Callback)
  613.             local ThisToggle = Default or false
  614.            
  615.             local ToggleContainer = Frame()
  616.             ToggleContainer.Name = Text.."TOGGLE"
  617.             ToggleContainer.Size = UDim2.new(1,0,0,20)
  618.             ToggleContainer.BackgroundTransparency = 1
  619.             ToggleContainer.Parent = DisplayPage
  620.            
  621.             local ToggleLeftSide, ToggleRightSide, EffectFrame, RightTick = RoundBox(5), RoundBox(5), Frame(), TickIcon()
  622.             local FlatLeft, FlatRight = Frame(), Frame()
  623.            
  624.             ToggleLeftSide.Size = UDim2.new(1,-22,1,0)
  625.             ToggleLeftSide.ImageColor3 = Color3.fromRGB(35,35,35)
  626.             ToggleLeftSide.Parent = ToggleContainer
  627.            
  628.             ToggleRightSide.Position = UDim2.new(1,-20,0,0)
  629.             ToggleRightSide.Size = UDim2.new(0,20,1,0)
  630.             ToggleRightSide.ImageColor3 = Color3.fromRGB(45,45,45)
  631.             ToggleRightSide.Parent = ToggleContainer
  632.            
  633.             FlatLeft.BackgroundColor3 = Color3.fromRGB(35,35,35)
  634.             FlatLeft.Size = UDim2.new(0,5,1,0)
  635.             FlatLeft.Position = UDim2.new(1,-5,0,0)
  636.             FlatLeft.Parent = ToggleLeftSide
  637.            
  638.             FlatRight.BackgroundColor3 = Color3.fromRGB(45,45,45)
  639.             FlatRight.Size = UDim2.new(0,5,1,0)
  640.             FlatRight.Parent = ToggleRightSide
  641.            
  642.             EffectFrame.BackgroundColor3 = ThisToggle and Color3.fromRGB(0,255,109) or Color3.fromRGB(255,160,160)
  643.             EffectFrame.Position = UDim2.new(1,-22,0.2,0)
  644.             EffectFrame.Size = UDim2.new(0,2,0.6,0)
  645.             EffectFrame.Parent = ToggleContainer
  646.            
  647.             RightTick.ImageTransparency = ThisToggle and 0 or 1
  648.             RightTick.Parent = ToggleRightSide
  649.            
  650.             local ToggleButton = TextButton(Text, 12)
  651.             ToggleButton.Name = "ToggleButton"
  652.             ToggleButton.Size = UDim2.new(1,0,1,0)
  653.             ToggleButton.Parent = ToggleLeftSide
  654.            
  655.             ToggleButton.MouseButton1Down:Connect(function()
  656.                 ThisToggle = not ThisToggle
  657.                 Tween(EffectFrame, {BackgroundColor3 = ThisToggle and Color3.fromRGB(0,255,109) or Color3.fromRGB(255,160,160)})
  658.                 Tween(RightTick, {ImageTransparency = ThisToggle and 0 or 1})
  659.                 Callback(ThisToggle)
  660.             end)   
  661.         end
  662.        
  663.         return PageLibrary
  664.     end
  665.    
  666.     return TabLibrary
  667. end
  668.  
  669. return UILibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement