ou1z

Untitled

Aug 7th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 19.88 KB | None | 0 0
  1. local HttpService = game:GetService("HttpService")
  2. local RunService = game:GetService("RunService")
  3. local TweenService = game:GetService("TweenService")
  4. local InputService = game:GetService("UserInputService")
  5.  
  6. local Player = game.Players.LocalPlayer
  7. local Mouse = Player:GetMouse()
  8.  
  9. local library = {}
  10. library.Colours  = {}
  11.  
  12. local libraryColours = library.Colours
  13. libraryColours.Main = Color3.fromRGB(20, 20, 20)
  14. libraryColours.Primary = Color3.fromRGB(26, 26, 26)
  15. libraryColours.Secondary = Color3.fromRGB(38, 38, 38)
  16. libraryColours.Status = Color3.fromRGB(65, 65, 65)
  17. libraryColours.Check = Color3.fromRGB(30, 30, 30)
  18. libraryColours.Text = Color3.fromRGB(170, 170, 170)
  19. libraryColours.Picker = Color3.fromRGB(50, 50, 50)
  20. libraryColours.Accents = Color3.fromRGB(0, 255, 109)
  21. libraryColours.White = Color3.fromRGB(255,255,255)
  22. libraryColours.OffWhite = Color3.fromRGB(225,225,225)
  23. libraryColours.Black = Color3.fromRGB(0,0,0)
  24.  
  25. local function RelativeXY(GuiObject)
  26.     local x, y = Mouse.X - GuiObject.AbsolutePosition.X, Mouse.Y - GuiObject.AbsolutePosition.Y
  27.     local xm, ym = GuiObject.AbsoluteSize.X, GuiObject.AbsoluteSize.Y
  28.     x = math.clamp(x, 0, xm)
  29.     y = math.clamp(y, 0, ym)
  30.     return x, y, x/xm, y/ym
  31. end
  32.  
  33. local function RoundBox()
  34.     local Round = Instance.new("ImageLabel")
  35.     Round.BackgroundTransparency = 1
  36.     Round.Image = "rbxasset://textures/ui/dialog_white@2x.png"
  37.     Round.ScaleType = Enum.ScaleType.Slice
  38.     Round.SliceCenter = Rect.new(10, 10, 10, 10)
  39.     return Round
  40. end
  41.  
  42. local function RoundButton()
  43.     local Round = Instance.new("ImageButton")
  44.     Round.AutoButtonColor = false
  45.     Round.BackgroundTransparency = 1
  46.     Round.Image = "rbxasset://textures/ui/dialog_white@2x.png"
  47.     Round.ScaleType = Enum.ScaleType.Slice
  48.     Round.SliceCenter = Rect.new(10, 10, 10, 10)
  49.     return Round
  50. end
  51.  
  52. local function Status()
  53.     local Stat = Instance.new("ImageButton")
  54.     Stat.Size = UDim2.new(0,14,0,14)
  55.     Stat.AutoButtonColor = false
  56.     Stat.BackgroundTransparency = 1
  57.     Stat.ImageColor3 = libraryColours.Status
  58.     Stat.Image = "http://www.roblox.com/asset/?id=71659683"
  59.     Stat.Rotation = -90
  60.     return Stat
  61. end
  62.  
  63. local function Label(text)
  64.     local NewLabel = Instance.new("TextLabel")
  65.     NewLabel.Text = text
  66.     NewLabel.BackgroundTransparency = 1
  67.     NewLabel.Position = UDim2.new(0, 0, 0, 0)
  68.     return NewLabel
  69. end
  70.  
  71. local function Button(text)
  72.     local NewLabel = Instance.new("TextButton")
  73.     NewLabel.AutoButtonColor = false
  74.     NewLabel.Text = text
  75.     NewLabel.BackgroundTransparency = 1
  76.     NewLabel.Position = UDim2.new(0, 0, 0, 0)
  77.     return NewLabel
  78. end
  79.  
  80. local function GetUUID()
  81.     local NewUUID = HttpService:GenerateGUID(false)
  82.     return NewUUID
  83. end
  84.  
  85. local function Gui(bool)
  86.     local NewGui = Instance.new("ScreenGui")
  87.     NewGui.ResetOnSpawn = bool or false
  88.     return NewGui
  89. end
  90.  
  91. local function Frame()
  92.     local NewFrame = Instance.new("Frame")
  93.     NewFrame.BorderSizePixel = 0
  94.     return NewFrame
  95. end
  96.  
  97. local function List()
  98.     local NewList = Instance.new("UIListLayout")
  99.     return NewList
  100. end
  101.  
  102. local function Click()
  103.     local ClickImage = Instance.new("ImageLabel")
  104.     ClickImage.Size = UDim2.new(0,14,0,14)
  105.     ClickImage.Image = "http://www.roblox.com/asset/?id=4941650889"
  106.     ClickImage.BackgroundTransparency = 1
  107.     return ClickImage
  108. end
  109.  
  110. local function CheckBox()
  111.     local Checker = Instance.new("ImageLabel")
  112.     Checker.Size = UDim2.new(1,-8,1,-8)
  113.     Checker.Position = UDim2.new(0,4,0,4)
  114.     Checker.ImageColor3 = libraryColours.Primary
  115.     Checker.BackgroundTransparency = 1
  116.     Checker.Image = "http://www.roblox.com/asset/?id=4941544626"
  117.     return Checker
  118. end
  119.  
  120. local wrap = function(func)
  121.     coroutine.wrap(func)()
  122. end
  123.  
  124. local CircleAnim = function(guiObject)
  125.     local ncircle = Instance.new("ImageLabel")
  126.     ncircle.BackgroundTransparency = 1
  127.     ncircle.Image = "http://www.roblox.com/asset/?id=87913710"
  128.     ncircle.Parent = guiObject
  129.     ncircle.ImageColor3 = libraryColours.Black
  130.     wrap(function()
  131.         local x, y = RelativeXY(guiObject)
  132.         for i = 1, 50, 1 do
  133.             ncircle.Size = UDim2.new(0, i, 0, i)
  134.             ncircle.Position = UDim2.new(0, x - i / 2, 0, y - i / 2)
  135.             ncircle.ImageTransparency = i / 50
  136.             RunService.Heartbeat:Wait()
  137.         end
  138.         ncircle:Destroy()
  139.     end)
  140.     return ncircle
  141. end
  142.  
  143. local function Circle()
  144.     local CircleImg = Instance.new("ImageLabel")
  145.     CircleImg.Image = "http://www.roblox.com/asset/?id=87913710"
  146.     CircleImg.Size = UDim2.new(0,12,0,12)
  147.     CircleImg.BackgroundTransparency = 1
  148.     return CircleImg
  149. end
  150.  
  151. local SSB = Enum.Font.SourceSansBold
  152. local SS = Enum.Font.SourceSans
  153. local GB = Enum.Font.GothamBlack
  154.  
  155. local Left = Enum.TextXAlignment.Left
  156. local Center = Enum.TextXAlignment.Center
  157. local Right = Enum.TextXAlignment.Right
  158.  
  159. local ContainerPadding = 7
  160.  
  161. function library:Init(parent)
  162.     local parent = parent or game.Players.LocalPlayer.PlayerGui
  163.    
  164.     local tabcount = 0
  165.    
  166.     local newgui = Gui(false)
  167.     newgui.Name = "SKYBLOCK"
  168.     newgui.Parent = parent
  169.    
  170.     local optionLibrary = {}
  171.    
  172.     function optionLibrary:AddTab(tabtitle)
  173.         local toggle = true
  174.        
  175.         local containerframe = Instance.new("Frame")
  176.         containerframe.Name = "ContainerFrame"
  177.         containerframe.Size = UDim2.new(0,170,1,0)
  178.         containerframe.Position = UDim2.new(0,5 + (175 * tabcount),0,5)
  179.         containerframe.BackgroundTransparency = 1
  180.         containerframe.Parent = newgui
  181.        
  182.         local tabtitle = tabtitle or ("Tab"..tostring(tabcount))
  183.        
  184.         tabcount = tabcount + 1
  185.        
  186.         local mainlabel = RoundBox()
  187.         mainlabel.ImageColor3 = libraryColours.Main
  188.         mainlabel.Size = UDim2.new(1,0,0,40)
  189.         mainlabel.Parent = containerframe
  190.        
  191.         local titlebar = Button(tabtitle)
  192.         titlebar.Size = UDim2.new(1,0,0,40)
  193.         titlebar.Font = Enum.Font.SourceSansBold
  194.         titlebar.TextSize = 18
  195.         titlebar.TextColor3 = libraryColours.White
  196.         titlebar.Parent = mainlabel
  197.        
  198.         local contentframe = RoundBox()
  199.         contentframe.Size = UDim2.new(1,0,0,0)
  200.         contentframe.Position = UDim2.new(0,0,0,40)
  201.         contentframe.ImageColor3 = libraryColours.Primary
  202.         contentframe.ClipsDescendants = true
  203.         contentframe.Parent = containerframe
  204.        
  205.         local togglebutton = Status()
  206.         togglebutton.Position = UDim2.new(1,-22,0.5,-7)
  207.         togglebutton.Rotation = 90
  208.         togglebutton.Parent = titlebar
  209.        
  210.         local contentlist = List()
  211.         contentlist.Parent = contentframe
  212.        
  213.         coroutine.wrap(function()
  214.             local lastmx
  215.             local lastmy
  216.            
  217.             titlebar.MouseButton1Down:Connect(function()
  218.                 lastmx = Mouse.X
  219.                 lastmy = Mouse.Y
  220.                 local move
  221.                 local kill
  222.                 move = Mouse.Move:Connect(function()
  223.                     local dx = Mouse.X - lastmx
  224.                     local dy = Mouse.Y - lastmy
  225.                     containerframe.Position = containerframe.Position + UDim2.new(0,dx,0,dy)
  226.                     lastmx = Mouse.X
  227.                     lastmy = Mouse.Y
  228.                 end)
  229.                 kill = InputService.InputEnded:Connect(function(input)
  230.                     if input.UserInputType == Enum.UserInputType.MouseButton1 then
  231.                         move:Disconnect()
  232.                         kill:Disconnect()
  233.                     end
  234.                 end)
  235.             end)
  236.         end)()
  237.        
  238.         togglebutton.MouseButton1Click:Connect(function()
  239.             toggle = not toggle
  240.             if not toggle then
  241.                 contentframe:TweenSize(UDim2.new(1,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  242.                 mainlabel:TweenSize(UDim2.new(1,0,0,40), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  243.                 TweenService:Create(togglebutton, TweenInfo.new(0.1), {Rotation = -90}):Play()
  244.             else
  245.                 mainlabel:TweenSize(UDim2.new(1,0,0,47+contentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  246.                 contentframe:TweenSize(UDim2.new(1,0,0,7+contentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  247.                 TweenService:Create(togglebutton, TweenInfo.new(0.1), {Rotation = 90}):Play()
  248.             end
  249.         end)
  250.        
  251.         contentlist:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  252.             if toggle then
  253.                 mainlabel:TweenSize(UDim2.new(1,0,0,47+contentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  254.                 contentframe:TweenSize(UDim2.new(1,0,0,7+contentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  255.             end
  256.         end)
  257.        
  258.         local sectioncount = 0
  259.        
  260.         local tabLibrary = {}
  261.        
  262.         function tabLibrary:AddSection(title)
  263.             local sectoggle = true
  264.             local title = title or ("Section"..tostring(sectioncount))
  265.            
  266.             sectioncount = sectioncount + 1
  267.            
  268.             local sectionframe = Frame()
  269.             sectionframe.BackgroundColor3 = libraryColours.Primary
  270.             sectionframe.Size = UDim2.new(1,0,0,28)
  271.             sectionframe.Parent = contentframe
  272.            
  273.             local sectiontitle = Label("  "..title)
  274.             sectiontitle.Size = UDim2.new(1,0,0,28)
  275.             sectiontitle.Font = Enum.Font.GothamBlack
  276.             sectiontitle.TextColor3 = libraryColours.OffWhite
  277.             sectiontitle.TextSize = 14
  278.             sectiontitle.TextXAlignment = Left
  279.             sectiontitle.Parent = sectionframe
  280.            
  281.             local sectioncontent = Frame()
  282.             sectioncontent.Size = UDim2.new(1,0,0,0)
  283.             sectioncontent.Position = UDim2.new(0,0,0,28)
  284.             sectioncontent.BackgroundColor3 = libraryColours.Secondary
  285.             sectioncontent.ClipsDescendants = true
  286.             sectioncontent.Parent = sectionframe
  287.            
  288.             local sectioncontentlist = List()
  289.             sectioncontentlist.Parent = sectioncontent
  290.            
  291.             local secstatus = Status()
  292.             secstatus.Position = UDim2.new(1,-21,0,7)
  293.             secstatus.Rotation = 90
  294.             secstatus.Parent = sectiontitle
  295.            
  296.             sectioncontentlist:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  297.                 if sectoggle then
  298.                     sectioncontent:TweenSize(UDim2.new(1,0,0,sectioncontentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  299.                     sectionframe:TweenSize(UDim2.new(1,0,0,28+sectioncontentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  300.                 end
  301.             end)
  302.            
  303.             secstatus.MouseButton1Click:Connect(function()
  304.                 sectoggle = not sectoggle
  305.                 if not sectoggle then
  306.                     sectioncontent:TweenSize(UDim2.new(1,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  307.                     sectionframe:TweenSize(UDim2.new(1,0,0,28), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  308.                     TweenService:Create(secstatus, TweenInfo.new(0.1), {Rotation = -90}):Play()
  309.                 else
  310.                     sectioncontent:TweenSize(UDim2.new(1,0,0,sectioncontentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  311.                     sectionframe:TweenSize(UDim2.new(1,0,0,28+sectioncontentlist.AbsoluteContentSize.Y), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  312.                     TweenService:Create(secstatus, TweenInfo.new(0.1), {Rotation = 90}):Play()
  313.                 end
  314.             end)
  315.            
  316.             local sectionLibrary = {}
  317.            
  318.             function sectionLibrary:AddButton(text, callback)
  319.                 local buttoncontainer = Frame()
  320.                 buttoncontainer.Size = UDim2.new(1,0,0,32)
  321.                 buttoncontainer.BackgroundColor3 = libraryColours.Secondary
  322.                 buttoncontainer.Parent = sectioncontent
  323.                
  324.                 local imagebutton = RoundButton()
  325.                 imagebutton.ImageColor3 = libraryColours.Accents
  326.                 imagebutton.Size = UDim2.new(1,-10,1,-10)
  327.                 imagebutton.Position = UDim2.new(0,5,0,5)
  328.                 imagebutton.ClipsDescendants = true
  329.                 imagebutton.Parent = buttoncontainer
  330.                
  331.                 local clickimage = Click()
  332.                 clickimage.Position = UDim2.new(0,4,0,4)
  333.                 clickimage.ImageColor3 = libraryColours.Black
  334.                 clickimage.Parent = imagebutton
  335.                
  336.                 local buttonlabel = Label(text or "Button")
  337.                 buttonlabel.Size = UDim2.new(1,0,1,0)
  338.                 buttonlabel.Font = Enum.Font.SourceSansBold
  339.                 buttonlabel.Text = text or "Button"
  340.                 buttonlabel.TextColor3 = libraryColours.Black
  341.                 buttonlabel.TextSize = 18
  342.                 buttonlabel.Parent = imagebutton
  343.                
  344.                 imagebutton.MouseButton1Click:Connect(function()
  345.                     callback()
  346.                     CircleAnim(imagebutton)
  347.                 end)
  348.             end
  349.            
  350.             function sectionLibrary:AddSlider(text, default, callback)
  351.                 local min = default.min or default.Min or 16
  352.                 local max = default.max or default.Max or 64
  353.                 local def = default.def or default.Def or math.floor((min + max) / 2)
  354.                 local defsca = (def - min)/(max - min)
  355.                
  356.                 local slidercontainer = Frame()
  357.                 slidercontainer.Size = UDim2.new(1,0,0,40)
  358.                 slidercontainer.BackgroundColor3 = libraryColours.Secondary
  359.                 slidercontainer.Parent = sectioncontent
  360.                
  361.                 local slidertitle = Label(text)
  362.                 slidertitle.Size = UDim2.new(1,-30,0,28)
  363.                 slidertitle.Font = Enum.Font.SourceSansBold
  364.                 slidertitle.TextColor3 = libraryColours.Text
  365.                 slidertitle.Text = ("  ".. text)
  366.                 slidertitle.TextXAlignment = Left
  367.                 slidertitle.TextSize = 16
  368.                 slidertitle.Parent = slidercontainer
  369.                
  370.                 local valuecontainer = RoundBox()
  371.                 valuecontainer.Size = UDim2.new(0,32,0,16)
  372.                 valuecontainer.Position = UDim2.new(1,-36,0,6)
  373.                 valuecontainer.ImageColor3 = libraryColours.Status
  374.                 valuecontainer.Parent = slidercontainer
  375.                
  376.                 local valuelabel = Label(def)
  377.                 valuelabel.Size = UDim2.new(1,0,1,0)
  378.                 valuelabel.Font = Enum.Font.SourceSansBold
  379.                 valuelabel.TextSize = 13
  380.                 valuelabel.TextColor3 = libraryColours.Text
  381.                 valuelabel.Parent = valuecontainer
  382.                
  383.                 local sliderframe = Frame()
  384.                 sliderframe.BackgroundTransparency = 1
  385.                 sliderframe.Position = UDim2.new(0,0,1,-12)
  386.                 sliderframe.Size = UDim2.new(1,0,0,12)
  387.                 sliderframe.Parent = slidercontainer
  388.                
  389.                 local sliderbutton = RoundButton()
  390.                 sliderbutton.Position = UDim2.new(0,5,0,1)
  391.                 sliderbutton.Size = UDim2.new(1,-10,0,4)
  392.                 sliderbutton.ImageColor3 = libraryColours.Status
  393.                 sliderbutton.Parent = sliderframe
  394.                
  395.                 local sliderfill = RoundBox()
  396.                 sliderfill.ImageColor3 = libraryColours.Accents
  397.                 sliderfill.Size = UDim2.new(defsca,0,1,0)
  398.                 sliderfill.Parent = sliderbutton
  399.                
  400.                 local slidercircle = Circle()
  401.                 slidercircle.Position = UDim2.new(1,-10,0.5,-10)
  402.                 slidercircle.Size = UDim2.new(0,20,0,20)
  403.                 slidercircle.ImageColor3 = libraryColours.Accents
  404.                 slidercircle.ImageTransparency = 1
  405.                 slidercircle.Parent = sliderfill
  406.                
  407.                 local circlefill = Circle()
  408.                 circlefill.ImageColor3 = libraryColours.White
  409.                 circlefill.Size = UDim2.new(0,12,0,12)
  410.                 circlefill.Position = UDim2.new(0.5,-6,0.5,-6)
  411.                 circlefill.ImageTransparency = 1
  412.                 circlefill.Parent = slidercircle
  413.                
  414.                 sliderbutton.MouseButton1Down:Connect(function()
  415.                     local x,y,xscale,yscale = RelativeXY(sliderbutton)
  416.                     local value = math.floor(min + ((max - min) * xscale))
  417.                     valuelabel.Text = value
  418.                     sliderfill.Size = UDim2.new(xscale,0,1,0)
  419.                     callback(value)
  420.                     local move
  421.                     local kill
  422.                     TweenService:Create(slidercircle, TweenInfo.new(0.5), {ImageTransparency = 0.5}):Play()
  423.                     TweenService:Create(circlefill, TweenInfo.new(0.5), {ImageTransparency = 0}):Play()
  424.                     move = Mouse.Move:Connect(function()
  425.                         local x,y,xscale,yscale = RelativeXY(sliderbutton)
  426.                         local value = math.floor(min + ((max - min) * xscale))
  427.                         valuelabel.Text = value
  428.                         sliderfill.Size = UDim2.new(xscale,0,1,0)
  429.                         callback(value)
  430.                     end)
  431.                     kill = InputService.InputEnded:Connect(function(input)
  432.                         if input.UserInputType == Enum.UserInputType.MouseButton1 then
  433.                             move:Disconnect()
  434.                             kill:Disconnect()
  435.                             TweenService:Create(slidercircle, TweenInfo.new(0.5), {ImageTransparency = 1}):Play()
  436.                             TweenService:Create(circlefill, TweenInfo.new(0.5), {ImageTransparency = 1}):Play()
  437.                         end
  438.                     end)
  439.                 end)
  440.             end
  441.            
  442.             function sectionLibrary:AddKeybind(text, default, callback)
  443.                 local def = default
  444.                 local changing = false
  445.                
  446.                 local keybindcontainer = Frame()
  447.                 keybindcontainer.BackgroundColor3 = libraryColours.Secondary
  448.                 keybindcontainer.Size = UDim2.new(1,0,0,28)
  449.                 keybindcontainer.Parent = sectioncontent
  450.                
  451.                 local keybindlabel = Button("  "..text)
  452.                 keybindlabel.TextColor3 = libraryColours.Text
  453.                 keybindlabel.TextSize = 16
  454.                 keybindlabel.Font = Enum.Font.SourceSansBold
  455.                 keybindlabel.TextXAlignment = Left
  456.                 keybindlabel.Size = UDim2.new(1,-30,0,28)
  457.                 keybindlabel.Parent = keybindcontainer
  458.                
  459.                 local valuecontainer = RoundBox()
  460.                 valuecontainer.Position = UDim2.new(1,-36,0,6)
  461.                 valuecontainer.Size = UDim2.new(0,32,0,16)
  462.                 valuecontainer.ImageColor3 = libraryColours.Status
  463.                 valuecontainer.Parent = keybindcontainer
  464.                
  465.                 local valuelabel = Label(string.char(def.Value):upper() or "None")
  466.                 valuelabel.Size = UDim2.new(1,0,1,0)
  467.                 valuelabel.Font = Enum.Font.SourceSansBold
  468.                 valuelabel.TextColor3 = libraryColours.Text
  469.                 valuelabel.TextSize = 13
  470.                 valuelabel.Parent = valuecontainer
  471.                
  472.                 InputService.InputBegan:Connect(function(input)
  473.                     if input.UserInputType == Enum.UserInputType.Keyboard then
  474.                         if input.KeyCode.Value == def.Value then
  475.                             if not changing then
  476.                                 callback()
  477.                             end
  478.                         end
  479.                     end
  480.                 end)
  481.                
  482.                 keybindlabel.MouseButton1Down:Connect(function()
  483.                     valuelabel.Text = "..."
  484.                     local detect
  485.                     detect = InputService.InputBegan:Connect(function(input)
  486.                         if input.UserInputType == Enum.UserInputType.Keyboard then
  487.                             local key = input.KeyCode
  488.                             local keyasstring = string.char(key.Value)
  489.                             local control = string.find(keyasstring, "%c")
  490.                             if not control then
  491.                                 valuelabel.Text = keyasstring:upper()
  492.                                 changing = true
  493.                                 def = key
  494.                                 wait()
  495.                                 changing = false
  496.                             else
  497.                                 valuelabel.Text = string.char(def.Value):upper()
  498.                             end
  499.                             detect:Disconnect()
  500.                         end
  501.                     end)
  502.                 end)
  503.             end
  504.            
  505.             function sectionLibrary:AddToggle(text, default, callback)
  506.                 local thistoggle = default
  507.                
  508.                 local togglecontainer = Frame()
  509.                 togglecontainer.Size = UDim2.new(1,0,0,28)
  510.                 togglecontainer.BackgroundColor3 = libraryColours.Secondary
  511.                 togglecontainer.Parent = sectioncontent
  512.                
  513.                 local toggletracker = RoundBox()
  514.                 toggletracker.Size = UDim2.new(0,18,0,18)
  515.                 toggletracker.Position = UDim2.new(1,-23,0,5)
  516.                 toggletracker.ImageColor3 = libraryColours.Status
  517.                 toggletracker.Parent = togglecontainer
  518.                
  519.                 local togglecolour = RoundBox()
  520.                 togglecolour.ImageColor3 = thistoggle and libraryColours.Accents or libraryColours.Secondary
  521.                 togglecolour.Size = thistoggle and UDim2.new(1,0,1,0) or UDim2.new(0,14,0,14)
  522.                 togglecolour.Position = thistoggle and UDim2.new(0,0,0,0) or UDim2.new(0,2,0,2)
  523.                 togglecolour.Parent = toggletracker
  524.                
  525.                 local togglechecker = CheckBox()
  526.                 togglechecker.ImageTransparency = thistoggle and 0 or 1
  527.                 togglechecker.Parent = togglecolour
  528.                
  529.                 local togglebutton = Button(text or "Toggle")
  530.                 togglebutton.Size = UDim2.new(1,-30,1,0)
  531.                 togglebutton.Font = Enum.Font.SourceSansBold
  532.                 togglebutton.Text = ("  "..text) or ("  Toggle")
  533.                 togglebutton.TextXAlignment = Left
  534.                 togglebutton.TextColor3 = libraryColours.Text
  535.                 togglebutton.TextSize = 16
  536.                 togglebutton.Parent = togglecontainer
  537.                
  538.                 togglebutton.MouseButton1Click:Connect(function()
  539.                     thistoggle = not thistoggle
  540.                     if not thistoggle then
  541.                         togglecolour:TweenSizeAndPosition(UDim2.new(0,14,0,14), UDim2.new(0,2,0,2), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  542.                         TweenService:Create(togglecolour, TweenInfo.new(0.1), {ImageColor3 = libraryColours.Secondary}):Play()
  543.                         TweenService:Create(togglechecker, TweenInfo.new(0.1), {ImageTransparency = 1}):Play()
  544.                     else
  545.                         togglecolour:TweenSizeAndPosition(UDim2.new(1,0,1,0), UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
  546.                         TweenService:Create(togglecolour, TweenInfo.new(0.1), {ImageColor3 = libraryColours.Accents}):Play()
  547.                         TweenService:Create(togglechecker, TweenInfo.new(0.1), {ImageTransparency = 0}):Play()
  548.                     end
  549.                     callback(thistoggle)
  550.                 end)
  551.             end
  552.            
  553.             return sectionLibrary
  554.         end
  555.        
  556.         return tabLibrary
  557.     end
  558.    
  559.     return optionLibrary
  560. end
  561.  
  562. return library
Add Comment
Please, Sign In to add comment