Advertisement
thonny_dev

Untitled

Nov 20th, 2024 (edited)
590
0
179 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 147.38 KB | None | 0 0
  1. --[[
  2.  
  3. ThonnyHub Interface Suite
  4.  
  5. by thonny_dev
  6.  
  7. ]]
  8.  
  9.  
  10.  
  11. local InterfaceBuild = 'A1'
  12. local Release = "Build 1.0.0"
  13. local ThonnyHubFolder = "ThonnyHub"
  14. local ConfigurationFolder = ThonnyHubFolder.."/Configurations"
  15. local ConfigurationExtension = ".rfld""UserInputService")
  16. local TweenService = game:GetService("TweenService")
  17. local HttpService = game:GetService("HttpService")
  18. local RunService = game:GetService("RunService")
  19. local Players = game:GetService("Players")
  20. local CoreGui = game:GetService("CoreGui")
  21.  
  22. -- Environment Check
  23. local useStudio
  24.  
  25. if RunService:IsStudio() then
  26.     useStudio = true
  27. end
  28.  
  29. -- Interface Management
  30.  
  31. local ThonnyHub = useStudio and script.Parent:FindFirstChild('ThonnyHub') or game:GetObjects("rbxassetid://104978590152599")[1]
  32. local buildAttempts = 0
  33. local correctBuild = false
  34. local warned
  35.  
  36. repeat
  37.     if ThonnyHub:FindFirstChild('Build') and ThonnyHub.Build.Value == InterfaceBuild then
  38.         correctBuild = true
  39.         break
  40.     end
  41.  
  42.     correctBuild = false
  43.  
  44.     if not warned then
  45.         warn('ThonnyHub | Build Mismatch')
  46.         print('ThonnyHub may encounter issues as you are running an incompatible version ('.. ((ThonnyHub:FindFirstChild('Build') and ThonnyHub.Build.Value) or 'No Build') ..').\n\nThis version of Thonny Hub is intended for build '..InterfaceBuild..'.')
  47.         warned = true
  48.     end
  49.  
  50.     toDestroy, ThonnyHub = ThonnyHub, useStudio and script.Parent:FindFirstChild('ThonnyHub') or game:GetObjects("rbxassetid://104978590152599")[1]
  51.     if toDestroy and not useStudio then toDestroy:Destroy() end
  52.  
  53.     buildAttempts = buildAttempts + 1
  54. until buildAttempts >= 2
  55.  
  56. ThonnyHub.Enabled = false
  57. if not useStudio and CoreGui:FindFirstChild("RobloxGui") then
  58.     ThonnyHub.Parent = CoreGui:FindFirstChild("RobloxGui")
  59. elseif not useStudio then
  60.     ThonnyHub.Parent = CoreGui
  61. end
  62.  
  63. if not useStudio then
  64.     for _, Interface in ipairs(CoreGui:GetChildren()) do
  65.         if Interface.Name == ThonnyHub.Name and Interface ~= ThonnyHub then
  66.             Interface.Enabled = false
  67.             Interface.Name = "ThonnyHub-Old"
  68.         end
  69.     end
  70. end
  71.  
  72.  
  73. local minSize = Vector2.new(1024, 768)
  74. local useMobileSizing
  75.  
  76. if ThonnyHub.AbsoluteSize.X < minSize.X and ThonnyHub.AbsoluteSize.Y < minSize.Y then
  77.     useMobileSizing = true
  78. end
  79.  
  80. if UserInputService.TouchEnabled then
  81.     useMobilePrompt = true
  82. end
  83.  
  84.  
  85.  
  86. -- Object Variables
  87.  
  88. local Main = ThonnyHub.Main
  89. local MPrompt = ThonnyHub:FindFirstChild('Prompt')
  90. local Topbar = Main.Topbar
  91. local Elements = Main.Elements
  92. local LoadingFrame = Main.LoadingFrame
  93. local TabList = Main.TabList
  94. local dragBar = ThonnyHub:FindFirstChild('Drag')
  95. local dragInteract = dragBar and dragBar.Interact or nil
  96. local dragBarCosmetic = dragBar and dragBar.Drag or nil
  97.  
  98. ThonnyHub.DisplayOrder = 100
  99. LoadingFrame.Version.Text = Release
  100.  
  101.  
  102.  
  103. -- Variables
  104.  
  105. local request = (syn and syn.request) or (http and http.request) or http_request
  106. local CFileName = nil
  107. local CEnabled = false
  108. local Minimised = false
  109. local Hidden = false
  110. local Debounce = false
  111. local searchOpen = false
  112. local Notifications = ThonnyHub.Notifications
  113.  
  114. local SelectedTheme = ThonnyHubLibrary.Theme.Default
  115.  
  116. local function ChangeTheme(Theme)
  117.     if typeof(Theme) == 'string' then
  118.         SelectedTheme = ThonnyHubLibrary.Theme[Theme]
  119.     elseif typeof(Theme) == 'table' then
  120.         SelectedTheme = Theme
  121.     end
  122.  
  123.     ThonnyHub.Main.BackgroundColor3 = SelectedTheme.Background
  124.     ThonnyHub.Main.Topbar.BackgroundColor3 = SelectedTheme.Topbar
  125.     ThonnyHub.Main.Topbar.CornerRepair.BackgroundColor3 = SelectedTheme.Topbar
  126.     ThonnyHub.Main.Shadow.Image.ImageColor3 = SelectedTheme.Shadow
  127.  
  128.     ThonnyHub.Main.Topbar.ChangeSize.ImageColor3 = SelectedTheme.TextColor
  129.     ThonnyHub.Main.Topbar.Hide.ImageColor3 = SelectedTheme.TextColor
  130.     ThonnyHub.Main.Topbar.Search.ImageColor3 = SelectedTheme.TextColor
  131.     ThonnyHub.Main.Topbar.Divider.BackgroundColor3 = SelectedTheme.ElementStroke
  132.  
  133.     Main.Search.BackgroundColor3 = SelectedTheme.TextColor
  134.     Main.Search.Shadow.ImageColor3 = SelectedTheme.TextColor
  135.     Main.Search.Search.ImageColor3 = SelectedTheme.TextColor
  136.     Main.Search.Input.PlaceholderColor3 = SelectedTheme.TextColor
  137.     Main.Search.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  138.  
  139.     if Main:FindFirstChild('Notice') then
  140.         Main.Notice.BackgroundColor3 = SelectedTheme.Background
  141.     end
  142.  
  143.     for _, text in ipairs(ThonnyHub:GetDescendants()) do
  144.         if text.Parent.Parent ~= Notifications then
  145.             if text:IsA('TextLabel') or text:IsA('TextBox') then text.TextColor3 = SelectedTheme.TextColor end
  146.         end
  147.     end
  148.  
  149.     for _, TabPage in ipairs(Elements:GetChildren()) do
  150.         for _, Element in ipairs(TabPage:GetChildren()) do
  151.             if Element.ClassName == "Frame" and Element.Name ~= "Placeholder" and Element.Name ~= "SectionSpacing" and Element.Name ~= "Divider" and Element.Name ~= "SectionTitle" and Element.Name ~= "SearchTitle-fsefsefesfsefesfesfThanks" then
  152.                 Element.BackgroundColor3 = SelectedTheme.ElementBackground
  153.                 Element.UIStroke.Color = SelectedTheme.ElementStroke
  154.             end
  155.         end
  156.     end
  157. end
  158.  
  159. local function getIcon(name : string)
  160.     -- full credit to latte softworks :)
  161.     local iconData = not useStudio and game:HttpGet('https://raw.githubusercontent.com/Thonny-Developer/thonny_hub/refs/heads/main/Icons.luau')
  162.     local icons = useStudio and require(script.Parent.icons) or loadstring(iconData)()
  163.  
  164.     name = string.match(string.lower(name), "^%s*(.*)%s*$") :: string
  165.     local sizedicons = icons['48px']
  166.  
  167.     local r = sizedicons[name]
  168.     if not r then
  169.         error("Lucide Icons: Failed to find icon by the name of \"" .. name .. "\.", 2)
  170.     end
  171.  
  172.     local rirs = r[2]
  173.     local riro = r[3]
  174.  
  175.     if type(r[1]) ~= "number" or type(rirs) ~= "table" or type(riro) ~= "table" then
  176.         error("Lucide Icons: Internal error: Invalid auto-generated asset entry")
  177.     end
  178.  
  179.     local irs = Vector2.new(rirs[1], rirs[2])
  180.     local iro = Vector2.new(riro[1], riro[2])
  181.  
  182.     local asset = {
  183.         id = r[1],
  184.         imageRectSize = irs,
  185.         imageRectOffset = iro,
  186.     }
  187.  
  188.     return asset
  189. end
  190.  
  191. local function makeDraggable(object, dragObject, enableTaptic, tapticOffset)
  192.     local dragging = false
  193.     local relative = nil
  194.  
  195.     local offset = Vector2.zero
  196.     local screenGui = object:FindFirstAncestorWhichIsA("ScreenGui")
  197.     if screenGui and screenGui.IgnoreGuiInset then
  198.         offset += game:GetService('GuiService'):GetGuiInset()
  199.     end
  200.  
  201.     local function connectFunctions()
  202.         if dragBar and enableTaptic then
  203.             dragBar.MouseEnter:Connect(function()
  204.                 if not dragging then
  205.                     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.5, Size = UDim2.new(0, 120, 0, 4)}):Play()
  206.                 end
  207.             end)
  208.  
  209.             dragBar.MouseLeave:Connect(function()
  210.                 if not dragging then
  211.                     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.7, Size = UDim2.new(0, 100, 0, 4)}):Play()
  212.                 end
  213.             end)
  214.         end
  215.     end
  216.  
  217.     connectFunctions()
  218.  
  219.     dragObject.InputBegan:Connect(function(input, processed)
  220.         if processed then return end
  221.  
  222.         local inputType = input.UserInputType.Name
  223.         if inputType == "MouseButton1" or inputType == "Touch" then
  224.             dragging = true
  225.  
  226.             relative = object.AbsolutePosition + object.AbsoluteSize * object.AnchorPoint - UserInputService:GetMouseLocation()
  227.             if enableTaptic then
  228.                 TweenService:Create(dragBarCosmetic, TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Size = UDim2.new(0, 110, 0, 4), BackgroundTransparency = 0}):Play()
  229.             end
  230.         end
  231.     end)
  232.  
  233.     local inputEnded = UserInputService.InputEnded:Connect(function(input)
  234.         if not dragging then return end
  235.  
  236.         local inputType = input.UserInputType.Name
  237.         if inputType == "MouseButton1" or inputType == "Touch" then
  238.             dragging = false
  239.  
  240.             connectFunctions()
  241.  
  242.             if enableTaptic then
  243.                 TweenService:Create(dragBarCosmetic, TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Size = UDim2.new(0, 100, 0, 4), BackgroundTransparency = 0.7}):Play()
  244.             end
  245.         end
  246.     end)
  247.  
  248.     local renderStepped = RunService.RenderStepped:Connect(function()
  249.         if dragging then
  250.             local position = UserInputService:GetMouseLocation() + relative + offset
  251.             if enableTaptic and tapticOffset then
  252.                 TweenService:Create(object, TweenInfo.new(0.4, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Position = UDim2.fromOffset(position.X, position.Y)}):Play()
  253.                 TweenService:Create(dragObject.Parent, TweenInfo.new(0.05, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Position = UDim2.fromOffset(position.X, position.Y + ((useMobileSizing and tapticOffset[2]) or tapticOffset[1]))}):Play()
  254.             else
  255.                 if dragBar and tapticOffset then
  256.                     dragBar.Position = UDim2.fromOffset(position.X, position.Y + ((useMobileSizing and tapticOffset[2]) or tapticOffset[1]))
  257.                 end
  258.                 object.Position = UDim2.fromOffset(position.X, position.Y)
  259.             end
  260.         end
  261.     end)
  262.  
  263.     object.Destroying:Connect(function()
  264.         if inputEnded then inputEnded:Disconnect() end
  265.         if renderStepped then renderStepped:Disconnect() end
  266.     end)
  267. end
  268.  
  269.  
  270. local function PackColor(Color)
  271.     return {R = Color.R * 255, G = Color.G * 255, B = Color.B * 255}
  272. end    
  273.  
  274. local function UnpackColor(Color)
  275.     return Color3.fromRGB(Color.R, Color.G, Color.B)
  276. end
  277.  
  278. local function LoadConfiguration(Configuration)
  279.     local Data = HttpService:JSONDecode(Configuration)
  280.     local changed
  281.  
  282.     -- Iterate through current UI elements' flags
  283.     for FlagName, Flag in pairs(ThonnyHubLibrary.Flags) do
  284.         local FlagValue = Data[FlagName]
  285.  
  286.         if FlagValue then
  287.             task.spawn(function()
  288.                 if Flag.Type == "ColorPicker" then
  289.                     changed = true
  290.                     Flag:Set(UnpackColor(FlagValue))
  291.                 else
  292.                     if (Flag.CurrentValue or Flag.CurrentKeybind or Flag.CurrentOption or Flag.Color) ~= FlagValue then
  293.                         changed = true
  294.                         Flag:Set(FlagValue)    
  295.                     end
  296.                 end
  297.             end)
  298.         else
  299.             warn("ThonnyHub | Unable to find '"..FlagName.. "' in the save file.")
  300.             print("The error above may not be an issue if new elements have been added or not been set values.")
  301.             --ThonnyHubLibrary:Notify({Title = "ThonnyHub Flags", Content = "ThonnyHub was unable to find '"..FlagName.. "' in the save file. Check sirius.menu/discord for help.", Image = 3944688398})
  302.         end
  303.     end
  304.  
  305.     return changed
  306. end
  307.  
  308. local function SaveConfiguration()
  309.     if not CEnabled then return end
  310.  
  311.     local Data = {}
  312.     for i, v in pairs(ThonnyHubLibrary.Flags) do
  313.         if v.Type == "ColorPicker" then
  314.             Data[i] = PackColor(v.Color)
  315.         else
  316.             if typeof(v.CurrentValue) == 'boolean' then
  317.                 if v.CurrentValue == false then
  318.                     Data[i] = false
  319.                 else
  320.                     Data[i] = v.CurrentValue or v.CurrentKeybind or v.CurrentOption or v.Color
  321.                 end
  322.             else
  323.                 Data[i] = v.CurrentValue or v.CurrentKeybind or v.CurrentOption or v.Color
  324.             end
  325.         end
  326.     end
  327.  
  328.     if useStudio then
  329.         if script.Parent:FindFirstChild('configuration') then script.Parent.configuration:Destroy() end
  330.  
  331.         local ScreenGui = Instance.new("ScreenGui")
  332.         ScreenGui.Parent = script.Parent
  333.         ScreenGui.Name = 'configuration'
  334.  
  335.         local TextBox = Instance.new("TextBox")
  336.         TextBox.Parent = ScreenGui
  337.         TextBox.Size = UDim2.new(0, 800, 0, 50)
  338.         TextBox.AnchorPoint = Vector2.new(0.5, 0)
  339.         TextBox.Position = UDim2.new(0.5, 0, 0, 30)
  340.         TextBox.Text = HttpService:JSONEncode(Data)
  341.         TextBox.ClearTextOnFocus = false
  342.     end
  343.  
  344.     if writefile then
  345.         writefile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension, tostring(HttpService:JSONEncode(Data)))
  346.     end
  347. end
  348.  
  349. function ThonnyHubLibrary:Notify(data) -- action e.g open messages
  350.     task.spawn(function()
  351.  
  352.         -- Notification Object Creation
  353.         local newNotification = Notifications.Template:Clone()
  354.         newNotification.Name = data.Title or 'Thonny Hub Notification'
  355.         newNotification.Parent = Notifications
  356.         newNotification.LayoutOrder = #Notifications:GetChildren()
  357.         newNotification.Visible = false
  358.  
  359.         -- Set Data
  360.         newNotification.Title.Text = data.Title or "Thonny Hub Notification"
  361.         newNotification.Description.Text = data.Content or "Unknown Content"
  362.  
  363.         if data.Image then
  364.             if typeof(data.Image) == 'string' then
  365.                 local asset = getIcon(data.Image)
  366.  
  367.                 newNotification.Icon.Image = 'rbxassetid://'..asset.id
  368.                 newNotification.Icon.ImageRectOffset = asset.imageRectOffset
  369.                 newNotification.Icon.ImageRectSize = asset.imageRectSize
  370.             else
  371.                 newNotification.Icon.Image = "rbxassetid://" .. (data.Image or 0)
  372.             end
  373.         else
  374.             newNotification.Icon.Image = "rbxassetid://0"
  375.         end
  376.  
  377.         -- Set initial transparency values
  378.  
  379.         newNotification.Title.TextColor3 = SelectedTheme.TextColor
  380.         newNotification.Description.TextColor3 = SelectedTheme.TextColor
  381.         newNotification.BackgroundColor3 = SelectedTheme.Background
  382.         newNotification.UIStroke.Color = SelectedTheme.TextColor
  383.         newNotification.Icon.ImageColor3 = SelectedTheme.TextColor
  384.  
  385.         newNotification.BackgroundTransparency = 1
  386.         newNotification.Title.TextTransparency = 1
  387.         newNotification.Description.TextTransparency = 1
  388.         newNotification.UIStroke.Transparency = 1
  389.         newNotification.Shadow.ImageTransparency = 1
  390.         newNotification.Size = UDim2.new(1, 0, 0, 800)
  391.         newNotification.Icon.ImageTransparency = 1
  392.         newNotification.Icon.BackgroundTransparency = 1
  393.  
  394.         task.wait()
  395.  
  396.         newNotification.Visible = true
  397.  
  398.         --if data.Actions then
  399.         --  warn('ThonnyHub | Not seeing your actions in notifications?')
  400.         --  print("Notification Actions are being sunset for now, keep up to date on when they're back in the discord. (sirius.menu/discord)")
  401.         --end
  402.  
  403.         -- Calculate textbounds and set initial values
  404.         local bounds = {newNotification.Title.TextBounds.Y, newNotification.Description.TextBounds.Y}
  405.         newNotification.Size = UDim2.new(1, -60, 0, -Notifications:FindFirstChild("UIListLayout").Padding.Offset)
  406.  
  407.         newNotification.Icon.Size = UDim2.new(0, 32, 0, 32)
  408.         newNotification.Icon.Position = UDim2.new(0, 20, 0.5, 0)
  409.  
  410.         TweenService:Create(newNotification, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, 0, 0, math.max(bounds[1] + bounds[2] + 31, 60))}):Play()
  411.  
  412.         task.wait(0.15)
  413.         TweenService:Create(newNotification, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.45}):Play()
  414.         TweenService:Create(newNotification.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  415.  
  416.         task.wait(0.05)
  417.  
  418.         TweenService:Create(newNotification.Icon, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  419.  
  420.         task.wait(0.05)
  421.         TweenService:Create(newNotification.Description, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.35}):Play()
  422.         TweenService:Create(newNotification.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 0.95}):Play()
  423.         TweenService:Create(newNotification.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.82}):Play()
  424.  
  425.         local waitDuration = math.min(math.max((#newNotification.Description.Text * 0.1) + 2.5, 3), 10)
  426.         task.wait(data.Duration or waitDuration)
  427.  
  428.         newNotification.Icon.Visible = false
  429.         TweenService:Create(newNotification, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  430.         TweenService:Create(newNotification.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  431.         TweenService:Create(newNotification.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  432.         TweenService:Create(newNotification.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  433.         TweenService:Create(newNotification.Description, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  434.  
  435.         TweenService:Create(newNotification, TweenInfo.new(1, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -90, 0, 0)}):Play()
  436.  
  437.         task.wait(1)
  438.  
  439.         TweenService:Create(newNotification, TweenInfo.new(1, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -90, 0, -Notifications:FindFirstChild("UIListLayout").Padding.Offset)}):Play()
  440.  
  441.         newNotification.Visible = false
  442.         newNotification:Destroy()
  443.     end)
  444. end
  445.  
  446. local function openSearch()
  447.     searchOpen = true
  448.  
  449.     Main.Search.BackgroundTransparency = 1
  450.     Main.Search.Shadow.ImageTransparency = 1
  451.     Main.Search.Input.TextTransparency = 1
  452.     Main.Search.Search.ImageTransparency = 1
  453.     Main.Search.UIStroke.Transparency = 1
  454.     Main.Search.Size = UDim2.new(1, 0, 0, 80)
  455.     Main.Search.Position = UDim2.new(0.5, 0, 0, 70)
  456.  
  457.     Main.Search.Input.Interactable = true
  458.  
  459.     Main.Search.Visible = true
  460.  
  461.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  462.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  463.             tabbtn.Interact.Visible = false
  464.             TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  465.             TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  466.             TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  467.             TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  468.         end
  469.     end
  470.  
  471.     Main.Search.Input:CaptureFocus()
  472.     TweenService:Create(Main.Search.Shadow, TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0.95}):Play()
  473.     TweenService:Create(Main.Search, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.5, 0, 0, 57), BackgroundTransparency = 0.9}):Play()
  474.     TweenService:Create(Main.Search.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.8}):Play()
  475.     TweenService:Create(Main.Search.Input, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  476.     TweenService:Create(Main.Search.Search, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.5}):Play()
  477.     TweenService:Create(Main.Search, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -35, 0, 35)}):Play()
  478. end
  479.  
  480. local function closeSearch()
  481.     searchOpen = false
  482.  
  483.     TweenService:Create(Main.Search, TweenInfo.new(0.35, Enum.EasingStyle.Quint), {BackgroundTransparency = 1, Size = UDim2.new(1, -55, 0, 30)}):Play()
  484.     TweenService:Create(Main.Search.Search, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  485.     TweenService:Create(Main.Search.Shadow, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  486.     TweenService:Create(Main.Search.UIStroke, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  487.     TweenService:Create(Main.Search.Input, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  488.  
  489.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  490.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  491.             tabbtn.Interact.Visible = true
  492.             if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  493.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  494.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  495.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  496.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  497.             else
  498.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  499.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  500.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  501.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  502.             end
  503.         end
  504.     end
  505.  
  506.     Main.Search.Input.Text = ''
  507.     Main.Search.Input.Interactable = false
  508. end
  509.  
  510. local function Hide(notify: boolean?)
  511.     if MPrompt then
  512.         MPrompt.Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  513.         MPrompt.Position = UDim2.new(0.5, 0, 0, -50)
  514.         MPrompt.Size = UDim2.new(0, 40, 0, 10)
  515.         MPrompt.BackgroundTransparency = 1
  516.         MPrompt.Title.TextTransparency = 1
  517.         MPrompt.Visible = true
  518.     end
  519.  
  520.     task.spawn(closeSearch)
  521.  
  522.     Debounce = true
  523.     if notify then
  524.         if useMobilePrompt then
  525.             ThonnyHubLibrary:Notify({Title = "Interface Hiden", Content = "The interface has been hidden, you can show the interface by clicking 'Show Thonny Hub'", Duration = 7, Image = 4400697855})
  526.         else
  527.             ThonnyHubLibrary:Notify({Title = "Interface Hiden", Content = "The interface has been hidden, you can show the interface by pressing [K]", Duration = 7, Image = 4400697855})
  528.         end
  529.     end
  530.  
  531.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 470, 0, 0)}):Play()
  532.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 470, 0, 45)}):Play()
  533.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  534.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  535.     TweenService:Create(Main.Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  536.     TweenService:Create(Main.Topbar.CornerRepair, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  537.     TweenService:Create(Main.Topbar.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  538.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  539.     TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  540.     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  541.  
  542.     if useMobilePrompt and MPrompt then
  543.         TweenService:Create(MPrompt, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 120, 0, 30), Position = UDim2.new(0.5, 0, 0, 20), BackgroundTransparency = 0.3}):Play()
  544.         TweenService:Create(MPrompt.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0.3}):Play()
  545.     end
  546.  
  547.     for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  548.         if TopbarButton.ClassName == "ImageButton" then
  549.             TweenService:Create(TopbarButton, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  550.         end
  551.     end
  552.  
  553.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  554.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  555.             TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  556.             TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  557.             TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  558.             TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  559.         end
  560.     end
  561.  
  562.     for _, tab in ipairs(Elements:GetChildren()) do
  563.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  564.             for _, element in ipairs(tab:GetChildren()) do
  565.                 if element.ClassName == "Frame" then
  566.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  567.                         if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  568.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  569.                         elseif element.Name == 'Divider' then
  570.                             TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  571.                         else
  572.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  573.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  574.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  575.                         end
  576.                         for _, child in ipairs(element:GetChildren()) do
  577.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  578.                                 child.Visible = false
  579.                             end
  580.                         end
  581.                     end
  582.                 end
  583.             end
  584.         end
  585.     end
  586.  
  587.     task.wait(0.5)
  588.     Main.Visible = false
  589.     Debounce = false
  590. end
  591.  
  592. local function Maximise()
  593.     Debounce = true
  594.     Topbar.ChangeSize.Image = "rbxassetid://"..10137941941
  595.  
  596.     TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  597.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  598.     TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  599.     TweenService:Create(Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  600.     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.7}):Play()
  601.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = useMobileSizing and UDim2.new(0, 500, 0, 275) or UDim2.new(0, 500, 0, 475)}):Play()
  602.     TweenService:Create(Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 45)}):Play()
  603.     TabList.Visible = true
  604.     task.wait(0.2)
  605.  
  606.     Elements.Visible = true
  607.  
  608.     for _, tab in ipairs(Elements:GetChildren()) do
  609.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  610.             for _, element in ipairs(tab:GetChildren()) do
  611.                 if element.ClassName == "Frame" then
  612.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  613.                         if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  614.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.4}):Play()
  615.                         elseif element.Name == 'Divider' then
  616.                             TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.85}):Play()
  617.                         else
  618.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  619.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  620.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  621.                         end
  622.                         for _, child in ipairs(element:GetChildren()) do
  623.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  624.                                 child.Visible = true
  625.                             end
  626.                         end
  627.                     end
  628.                 end
  629.             end
  630.         end
  631.     end
  632.  
  633.     task.wait(0.1)
  634.  
  635.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  636.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  637.             if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  638.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  639.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  640.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  641.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  642.             else
  643.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  644.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  645.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  646.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  647.             end
  648.  
  649.         end
  650.     end
  651.  
  652.     task.wait(0.5)
  653.     Debounce = false
  654. end
  655.  
  656.  
  657. local function Unhide()
  658.     Debounce = true
  659.     Main.Position = UDim2.new(0.5, 0, 0.5, 0)
  660.     Main.Visible = true
  661.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = useMobileSizing and UDim2.new(0, 500, 0, 275) or UDim2.new(0, 500, 0, 475)}):Play()
  662.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 45)}):Play()
  663.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  664.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  665.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  666.     TweenService:Create(Main.Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  667.     TweenService:Create(Main.Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  668.     TweenService:Create(Main.Topbar.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  669.  
  670.     if MPrompt then
  671.         TweenService:Create(MPrompt, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 40, 0, 10), Position = UDim2.new(0.5, 0, 0, -50), BackgroundTransparency = 1}):Play()
  672.         TweenService:Create(MPrompt.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  673.  
  674.         task.spawn(function()
  675.             task.wait(0.5)
  676.             MPrompt.Visible = false
  677.         end)
  678.     end
  679.  
  680.     if Minimised then
  681.         task.spawn(Maximise)
  682.     end
  683.  
  684.     for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  685.         if TopbarButton.ClassName == "ImageButton" then
  686.             if TopbarButton.Name == 'Icon' then
  687.                 TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  688.             else
  689.                 TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  690.             end
  691.  
  692.         end
  693.     end
  694.  
  695.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  696.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  697.             if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  698.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  699.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  700.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  701.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  702.             else
  703.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  704.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  705.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  706.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  707.             end
  708.         end
  709.     end
  710.  
  711.     for _, tab in ipairs(Elements:GetChildren()) do
  712.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  713.             for _, element in ipairs(tab:GetChildren()) do
  714.                 if element.ClassName == "Frame" then
  715.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  716.                         if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  717.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.4}):Play()
  718.                         elseif element.Name == 'Divider' then
  719.                             TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.85}):Play()
  720.                         else
  721.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  722.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  723.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  724.                         end
  725.                         for _, child in ipairs(element:GetChildren()) do
  726.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  727.                                 child.Visible = true
  728.                             end
  729.                         end
  730.                     end
  731.                 end
  732.             end
  733.         end
  734.     end
  735.  
  736.     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.5}):Play()
  737.  
  738.     task.wait(0.5)
  739.     Minimised = false
  740.     Debounce = false
  741. end
  742.  
  743. local function Minimise()
  744.     Debounce = true
  745.     Topbar.ChangeSize.Image = "rbxassetid://"..11036884234
  746.  
  747.     Topbar.UIStroke.Color = SelectedTheme.ElementStroke
  748.  
  749.     task.spawn(closeSearch)
  750.  
  751.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  752.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  753.             TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  754.             TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  755.             TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  756.             TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  757.         end
  758.     end
  759.  
  760.     for _, tab in ipairs(Elements:GetChildren()) do
  761.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  762.             for _, element in ipairs(tab:GetChildren()) do
  763.                 if element.ClassName == "Frame" then
  764.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  765.                         if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  766.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  767.                         elseif element.Name == 'Divider' then
  768.                             TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  769.                         else
  770.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  771.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  772.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  773.                         end
  774.                         for _, child in ipairs(element:GetChildren()) do
  775.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  776.                                 child.Visible = false
  777.                             end
  778.                         end
  779.                     end
  780.                 end
  781.             end
  782.         end
  783.     end
  784.  
  785.     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  786.     TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  787.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  788.     TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  789.     TweenService:Create(Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  790.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 495, 0, 45)}):Play()
  791.     TweenService:Create(Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 495, 0, 45)}):Play()
  792.  
  793.     task.wait(0.3)
  794.  
  795.     Elements.Visible = false
  796.     TabList.Visible = false
  797.  
  798.     task.wait(0.2)
  799.     Debounce = false
  800. end
  801.  
  802. function ThonnyHubLibrary:CreateWindow(Settings)
  803.     if not correctBuild and not Settings.DisableBuildWarnings then
  804.         task.delay(3,
  805.             function()
  806.                 ThonnyHubLibrary:Notify(
  807.                     {
  808.                         Title = 'Outdated script',
  809.                         Content = 'Your Thonny Hub script runs on versions ('.. ((ThonnyHub:FindFirstChild('Build') and ThonnyHub.Build.Value) or 'without version') ..').\n\nThis version of Thonny Hub is designed to build a versioning interface '..InterfaceBuild..'.\n\nTry re-entering the game and then running the script',
  810.                         Image = 4335487866,
  811.                         Duration = 15
  812.                     })     
  813.             end)
  814.     end
  815.  
  816.     local Passthrough = false
  817.     Topbar.Title.Text = Settings.Name
  818.  
  819.     Main.Size = UDim2.new(0, 420, 0, 100)
  820.     Main.Visible = true
  821.     Main.BackgroundTransparency = 1
  822.     if Main:FindFirstChild('Notice') then Main.Notice.Visible = false end
  823.     Main.Shadow.Image.ImageTransparency = 1
  824.  
  825.     LoadingFrame.Title.TextTransparency = 1
  826.     LoadingFrame.Subtitle.TextTransparency = 1
  827.  
  828.     LoadingFrame.Version.TextTransparency = 1
  829.     LoadingFrame.Title.Text = Settings.LoadingTitle or "Loading Thonny Hub"
  830.     LoadingFrame.Subtitle.Text = Settings.LoadingSubtitle or "Interface package"
  831.     LoadingFrame.Version.Text = Release
  832.  
  833.     if Settings.Icon and Settings.Icon ~= 0 and Topbar:FindFirstChild('Icon') then
  834.         Topbar.Icon.Visible = true
  835.         Topbar.Title.Position = UDim2.new(0, 47, 0.5, 0)
  836.  
  837.         if Settings.Icon then
  838.             if typeof(Settings.Icon) == 'string' then
  839.                 local asset = getIcon(Settings.Icon)
  840.  
  841.                 Topbar.Icon.Image = 'rbxassetid://'..asset.id
  842.                 Topbar.Icon.ImageRectOffset = asset.imageRectOffset
  843.                 Topbar.Icon.ImageRectSize = asset.imageRectSize
  844.             else
  845.                 Topbar.Icon.Image = "rbxassetid://" .. (Settings.Icon or 0)
  846.             end
  847.         else
  848.             Topbar.Icon.Image = "rbxassetid://" .. 0
  849.         end
  850.     end
  851.  
  852.     if dragBar then
  853.         dragBar.Visible = false
  854.         dragBarCosmetic.BackgroundTransparency = 1
  855.         dragBar.Visible = true
  856.     end
  857.  
  858.     if Settings.Theme then
  859.         local success, result = pcall(ChangeTheme, Settings.Theme)
  860.         if not success then
  861.             local success, result2 = pcall(ChangeTheme, 'Default')
  862.             if not success then
  863.                 warn('CRITICAL ERROR - NO DEFAULT THEME')
  864.                 print(result2)
  865.             end
  866.             warn('problem with displaying theme. there is no theme in the file')
  867.             print(result)
  868.         end
  869.     end
  870.  
  871.     Topbar.Visible = false
  872.     Elements.Visible = false
  873.     LoadingFrame.Visible = true
  874.  
  875.     if not Settings.DisableThonnyHubPrompts then
  876.         task.spawn(function()
  877.             while true do
  878.                 task.wait(math.random(180, 600))
  879.                 ThonnyHubLibrary:Notify({
  880.                     Title = "Thonny Hub",
  881.                     Content = "Like the script? Visit our server: https://discord.gg/7k6NJcDEKS",
  882.                     Duration = 7,
  883.                     Image = 4370033185,
  884.                 })
  885.             end
  886.         end)
  887.     end
  888.  
  889.     pcall(function()
  890.         if not Settings.ConfigurationSaving.FileName then
  891.             Settings.ConfigurationSaving.FileName = tostring(game.PlaceId)
  892.         end
  893.  
  894.         if Settings.ConfigurationSaving.Enabled == nil then
  895.             Settings.ConfigurationSaving.Enabled = false
  896.         end
  897.  
  898.         CFileName = Settings.ConfigurationSaving.FileName
  899.         ConfigurationFolder = Settings.ConfigurationSaving.FolderName or ConfigurationFolder
  900.         CEnabled = Settings.ConfigurationSaving.Enabled
  901.  
  902.         if Settings.ConfigurationSaving.Enabled then
  903.             if not isfolder(ConfigurationFolder) then
  904.                 makefolder(ConfigurationFolder)
  905.             end
  906.         end
  907.     end)
  908.  
  909.  
  910.     makeDraggable(Main, Topbar, false, {255, 150})
  911.     if dragBar then dragBar.Position = useMobileSizing and UDim2.new(0.5, 0, 0.5, 150) or UDim2.new(0.5, 0, 0.5, 255) makeDraggable(Main, dragInteract, true, {255, 150}) end
  912.  
  913.     for _, TabButton in ipairs(TabList:GetChildren()) do
  914.         if TabButton.ClassName == "Frame" and TabButton.Name ~= "Placeholder" then
  915.             TabButton.BackgroundTransparency = 1
  916.             TabButton.Title.TextTransparency = 1
  917.             TabButton.Image.ImageTransparency = 1
  918.             TabButton.UIStroke.Transparency = 1
  919.         end
  920.     end
  921.  
  922.     if Settings.Discord and not useStudio then
  923.         if not isfolder(ThonnyHubFolder.."/Discord Invites") then
  924.             makefolder(ThonnyHubFolder.."/Discord Invites")
  925.         end
  926.  
  927.         if not isfile(ThonnyHubFolder.."/Discord Invites".."/"..Settings.Discord.Invite..ConfigurationExtension) then
  928.             if request then
  929.                 request({
  930.                     Url = 'http://127.0.0.1:6463/rpc?v=1',
  931.                     Method = 'POST',
  932.                     Headers = {
  933.                         ['Content-Type'] = 'application/json',
  934.                         Origin = 'https://discord.com'
  935.                     },
  936.                     Body = HttpService:JSONEncode({
  937.                         cmd = 'INVITE_BROWSER',
  938.                         nonce = HttpService:GenerateGUID(false),
  939.                         args = {code = Settings.Discord.Invite}
  940.                     })
  941.                 })
  942.             end
  943.  
  944.             if Settings.Discord.RememberJoins then
  945.                 writefile(ThonnyHubFolder.."/Discord Invites".."/"..Settings.Discord.Invite..ConfigurationExtension,"Thonny Hub Remember Joins is True for this invitation, this invitation will not ask you to join again")
  946.             end
  947.         end
  948.     end
  949.  
  950.     if (Settings.KeySystem) then
  951.         if not Settings.KeySettings then
  952.             Passthrough = true
  953.             return
  954.         end
  955.  
  956.         if isfolder and not isfolder(ThonnyHubFolder.."/Key System") then
  957.             makefolder(ThonnyHubFolder.."/Key System")
  958.         end
  959.  
  960.         if typeof(Settings.KeySettings.Key) == "string" then Settings.KeySettings.Key = {Settings.KeySettings.Key} end
  961.  
  962.         if Settings.KeySettings.GrabKeyFromSite then
  963.             for i, Key in ipairs(Settings.KeySettings.Key) do
  964.                 local Success, Response = pcall(function()
  965.                     Settings.KeySettings.Key[i] = tostring(game:HttpGet(Key):gsub("[\n\r]", " "))
  966.                     Settings.KeySettings.Key[i] = string.gsub(Settings.KeySettings.Key[i], " ", "")
  967.                 end)
  968.                 if not Success then
  969.                    
  970.                     print("ThonnyHub | "..Key.." Error " ..tostring(Response))
  971.                      
  972.                 end
  973.             end
  974.         end
  975.  
  976.         if not Settings.KeySettings.FileName then
  977.             Settings.KeySettings.FileName = "No file name specified"
  978.         end
  979.  
  980.         if isfile and isfile(ThonnyHubFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension) then
  981.             for _, MKey in ipairs(Settings.KeySettings.Key) do
  982.                 if string.find(readfile(ThonnyHubFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension), MKey) then
  983.                     Passthrough = true
  984.                 end
  985.             end
  986.         end
  987.  
  988.         if not Passthrough then
  989.             local AttemptsRemaining = math.random(2, 5)
  990.             ThonnyHub.Enabled = false
  991.             local KeyUI = useStudio and script.Parent:FindFirstChild('Key') or game:GetObjects("rbxassetid://70391968119365")[1]
  992.  
  993.             KeyUI.Enabled = true
  994.  
  995.             if gethui then
  996.                 KeyUI.Parent = gethui()
  997.             elseif syn and syn.protect_gui then
  998.                 syn.protect_gui(KeyUI)
  999.                 KeyUI.Parent = CoreGui
  1000.             elseif not useStudio and CoreGui:FindFirstChild("RobloxGui") then
  1001.                 KeyUI.Parent = CoreGui:FindFirstChild("RobloxGui")
  1002.             elseif not useStudio then
  1003.                 KeyUI.Parent = CoreGui
  1004.             end
  1005.  
  1006.             if gethui then
  1007.                 for _, Interface in ipairs(gethui():GetChildren()) do
  1008.                     if Interface.Name == KeyUI.Name and Interface ~= KeyUI then
  1009.                         Interface.Enabled = false
  1010.                         Interface.Name = "KeyUI-Old"
  1011.                     end
  1012.                 end
  1013.             elseif not useStudio then
  1014.                 for _, Interface in ipairs(CoreGui:GetChildren()) do
  1015.                     if Interface.Name == KeyUI.Name and Interface ~= KeyUI then
  1016.                         Interface.Enabled = false
  1017.                         Interface.Name = "KeyUI-Old"
  1018.                     end
  1019.                 end
  1020.             end
  1021.  
  1022.             local KeyMain = KeyUI.Main
  1023.             KeyMain.Title.Text = Settings.KeySettings.Title or Settings.Name
  1024.             KeyMain.Subtitle.Text = Settings.KeySettings.Subtitle or "Key System"
  1025.             KeyMain.NoteMessage.Text = Settings.KeySettings.Note or "No instructions"
  1026.  
  1027.             KeyMain.Size = UDim2.new(0, 467, 0, 175)
  1028.             KeyMain.BackgroundTransparency = 1
  1029.             KeyMain.Shadow.Image.ImageTransparency = 1
  1030.             KeyMain.Title.TextTransparency = 1
  1031.             KeyMain.Subtitle.TextTransparency = 1
  1032.             KeyMain.KeyNote.TextTransparency = 1
  1033.             KeyMain.Input.BackgroundTransparency = 1
  1034.             KeyMain.Input.UIStroke.Transparency = 1
  1035.             KeyMain.Input.InputBox.TextTransparency = 1
  1036.             KeyMain.NoteTitle.TextTransparency = 1
  1037.             KeyMain.NoteMessage.TextTransparency = 1
  1038.             KeyMain.Hide.ImageTransparency = 1
  1039.  
  1040.             TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1041.             TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 187)}):Play()
  1042.             TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 0.5}):Play()
  1043.             task.wait(0.05)
  1044.             TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1045.             TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1046.             task.wait(0.05)
  1047.             TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1048.             TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1049.             TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1050.             TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1051.             task.wait(0.05)
  1052.             TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1053.             TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1054.             task.wait(0.15)
  1055.             TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 0.3}):Play()
  1056.  
  1057.  
  1058.             KeyUI.Main.Input.InputBox.FocusLost:Connect(function()
  1059.                 if #KeyUI.Main.Input.InputBox.Text == 0 then return end
  1060.                 local KeyFound = false
  1061.                 local FoundKey = ''
  1062.                 for _, MKey in ipairs(Settings.KeySettings.Key) do
  1063.                     --if string.find(KeyMain.Input.InputBox.Text, MKey) then
  1064.                     --  KeyFound = true
  1065.                     --  FoundKey = MKey
  1066.                     --end
  1067.  
  1068.  
  1069.                     -- stricter key check
  1070.                     if KeyMain.Input.InputBox.Text == MKey then
  1071.                         KeyFound = true
  1072.                         FoundKey = MKey
  1073.                     end
  1074.                 end
  1075.                 if KeyFound then
  1076.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1077.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1078.                     TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1079.                     TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1080.                     TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1081.                     TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1082.                     TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1083.                     TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1084.                     TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1085.                     TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1086.                     TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1087.                     TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1088.                     task.wait(0.51)
  1089.                     Passthrough = true
  1090.                     KeyMain.Visible = false
  1091.                     if Settings.KeySettings.SaveKey then
  1092.                         if writefile then
  1093.                             writefile(ThonnyHubFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension, FoundKey)
  1094.                             ThonnyHubLibrary:Notify({Title = "Thonny Hub", Content = "The key for the script has been saved successfully..", Image = 3605522284})
  1095.                         end
  1096.                     end
  1097.                 else
  1098.                     if AttemptsRemaining == 0 then
  1099.                         TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1100.                         TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1101.                         TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1102.                         TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1103.                         TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1104.                         TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1105.                         TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1106.                         TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1107.                         TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1108.                         TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1109.                         TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1110.                         TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1111.                         task.wait(0.45)
  1112.                         game.Players.LocalPlayer:Kick("Attempt limit exceeded")
  1113.                         game:Shutdown()
  1114.                     end
  1115.                     KeyMain.Input.InputBox.Text = ""
  1116.                     AttemptsRemaining = AttemptsRemaining - 1
  1117.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1118.                     TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Elastic), {Position = UDim2.new(0.495,0,0.5,0)}):Play()
  1119.                     task.wait(0.1)
  1120.                     TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Elastic), {Position = UDim2.new(0.505,0,0.5,0)}):Play()
  1121.                     task.wait(0.1)
  1122.                     TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.5,0,0.5,0)}):Play()
  1123.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 187)}):Play()
  1124.                 end
  1125.             end)
  1126.  
  1127.             KeyMain.Hide.MouseButton1Click:Connect(function()
  1128.                 TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1129.                 TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1130.                 TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1131.                 TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1132.                 TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1133.                 TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1134.                 TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1135.                 TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1136.                 TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1137.                 TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1138.                 TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1139.                 TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1140.                 task.wait(0.51)
  1141.                 ThonnyHubLibrary:Destroy()
  1142.                 KeyUI:Destroy()
  1143.             end)
  1144.         else
  1145.             Passthrough = true
  1146.         end
  1147.     end
  1148.     if Settings.KeySystem then
  1149.         repeat task.wait() until Passthrough
  1150.     end
  1151.  
  1152.     Notifications.Template.Visible = false
  1153.     Notifications.Visible = true
  1154.     ThonnyHub.Enabled = true
  1155.  
  1156.     task.wait(0.5)
  1157.     TweenService:Create(Main, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1158.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  1159.     task.wait(0.1)
  1160.     TweenService:Create(LoadingFrame.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1161.     task.wait(0.05)
  1162.     TweenService:Create(LoadingFrame.Subtitle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1163.     task.wait(0.05)
  1164.     TweenService:Create(LoadingFrame.Version, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1165.  
  1166.  
  1167.     Elements.Template.LayoutOrder = 100000
  1168.     Elements.Template.Visible = false
  1169.  
  1170.     Elements.UIPageLayout.FillDirection = Enum.FillDirection.Horizontal
  1171.     TabList.Template.Visible = false
  1172.  
  1173.     -- Tab
  1174.     local FirstTab = false
  1175.     local Window = {}
  1176.     function Window:CreateTab(Name, Image)
  1177.         local SDone = false
  1178.         local TabButton = TabList.Template:Clone()
  1179.         TabButton.Name = Name
  1180.         TabButton.Title.Text = Name
  1181.         TabButton.Parent = TabList
  1182.         TabButton.Title.TextWrapped = false
  1183.         TabButton.Size = UDim2.new(0, TabButton.Title.TextBounds.X + 30, 0, 30)
  1184.  
  1185.         if Image then
  1186.             if typeof(Image) == 'string' then
  1187.                 local asset = getIcon(Image)
  1188.  
  1189.                 TabButton.Image.Image = 'rbxassetid://'..asset.id
  1190.                 TabButton.Image.ImageRectOffset = asset.imageRectOffset
  1191.                 TabButton.Image.ImageRectSize = asset.imageRectSize
  1192.             else
  1193.                 TabButton.Image.Image = "rbxassetid://"..Image
  1194.             end
  1195.  
  1196.             TabButton.Title.AnchorPoint = Vector2.new(0, 0.5)
  1197.             TabButton.Title.Position = UDim2.new(0, 37, 0.5, 0)
  1198.             TabButton.Image.Visible = true
  1199.             TabButton.Title.TextXAlignment = Enum.TextXAlignment.Left
  1200.             TabButton.Size = UDim2.new(0, TabButton.Title.TextBounds.X + 52, 0, 30)
  1201.         end
  1202.  
  1203.  
  1204.  
  1205.         TabButton.BackgroundTransparency = 1
  1206.         TabButton.Title.TextTransparency = 1
  1207.         TabButton.Image.ImageTransparency = 1
  1208.         TabButton.UIStroke.Transparency = 1
  1209.  
  1210.         TabButton.Visible = true
  1211.  
  1212.         -- Create Elements Page
  1213.         local TabPage = Elements.Template:Clone()
  1214.         TabPage.Name = Name
  1215.         TabPage.Visible = true
  1216.  
  1217.         TabPage.LayoutOrder = #Elements:GetChildren()
  1218.  
  1219.         for _, TemplateElement in ipairs(TabPage:GetChildren()) do
  1220.             if TemplateElement.ClassName == "Frame" and TemplateElement.Name ~= "Placeholder" then
  1221.                 TemplateElement:Destroy()
  1222.             end
  1223.         end
  1224.  
  1225.         TabPage.Parent = Elements
  1226.         if not FirstTab then
  1227.             Elements.UIPageLayout.Animated = false
  1228.             Elements.UIPageLayout:JumpTo(TabPage)
  1229.             Elements.UIPageLayout.Animated = true
  1230.         end
  1231.  
  1232.         TabButton.UIStroke.Color = SelectedTheme.TabStroke
  1233.  
  1234.         if Elements.UIPageLayout.CurrentPage == TabPage then
  1235.             TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  1236.             TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  1237.             TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  1238.         else
  1239.             TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  1240.             TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  1241.             TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  1242.         end
  1243.  
  1244.  
  1245.         -- Animate
  1246.         task.wait(0.1)
  1247.         if FirstTab then
  1248.             TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  1249.             TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  1250.             TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  1251.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  1252.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  1253.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  1254.             TweenService:Create(TabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  1255.         else
  1256.             FirstTab = Name
  1257.             TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  1258.             TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  1259.             TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  1260.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  1261.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1262.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1263.         end
  1264.  
  1265.  
  1266.         TabButton.Interact.MouseButton1Click:Connect(function()
  1267.             if Minimised then return end
  1268.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1269.             TweenService:Create(TabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1270.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1271.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  1272.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.TabBackgroundSelected}):Play()
  1273.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextColor3 = SelectedTheme.SelectedTabTextColor}):Play()
  1274.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageColor3 = SelectedTheme.SelectedTabTextColor}):Play()
  1275.  
  1276.             for _, OtherTabButton in ipairs(TabList:GetChildren()) do
  1277.                 if OtherTabButton.Name ~= "Template" and OtherTabButton.ClassName == "Frame" and OtherTabButton ~= TabButton and OtherTabButton.Name ~= "Placeholder" then
  1278.                     TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.TabBackground}):Play()
  1279.                     TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextColor3 = SelectedTheme.TabTextColor}):Play()
  1280.                     TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageColor3 = SelectedTheme.TabTextColor}):Play()
  1281.                     TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  1282.                     TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  1283.                     TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  1284.                     TweenService:Create(OtherTabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  1285.                 end
  1286.             end
  1287.             if Elements.UIPageLayout.CurrentPage ~= TabPage then
  1288.                 Elements.UIPageLayout:JumpTo(TabPage)
  1289.             end
  1290.  
  1291.         end)
  1292.  
  1293.         local Tab = {}
  1294.  
  1295.         -- Button
  1296.         function Tab:CreateButton(ButtonSettings)
  1297.             local ButtonValue = {}
  1298.  
  1299.             local Button = Elements.Template.Button:Clone()
  1300.             Button.Name = ButtonSettings.Name
  1301.             Button.Title.Text = ButtonSettings.Name
  1302.             Button.Visible = true
  1303.             Button.Parent = TabPage
  1304.  
  1305.             Button.BackgroundTransparency = 1
  1306.             Button.UIStroke.Transparency = 1
  1307.             Button.Title.TextTransparency = 1
  1308.  
  1309.             TweenService:Create(Button, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1310.             TweenService:Create(Button.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1311.             TweenService:Create(Button.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play() 
  1312.  
  1313.  
  1314.             Button.Interact.MouseButton1Click:Connect(function()
  1315.                 local Success, Response = pcall(ButtonSettings.Callback)
  1316.                 if not Success then
  1317.                     TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1318.                     TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1319.                     TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1320.                     Button.Title.Text = "Conditions Not Met"
  1321.                     print("ThonnyHub | "..ButtonSettings.Name.." Callback Error " ..tostring(Response))
  1322.                      
  1323.                     task.wait(0.5)
  1324.                     Button.Title.Text = ButtonSettings.Name
  1325.                     TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1326.                     TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.9}):Play()
  1327.                     TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1328.                 else
  1329.                     local Success, Response = pcall(function()
  1330.                         SaveConfiguration()
  1331.                         TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1332.                         TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1333.                         TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1334.                         task.wait(0.2)
  1335.                         TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1336.                         TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.9}):Play()
  1337.                         TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1338.                     end)
  1339.                 end
  1340.             end)
  1341.  
  1342.             Button.MouseEnter:Connect(function()
  1343.                 TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1344.                 TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.7}):Play()
  1345.             end)
  1346.  
  1347.             Button.MouseLeave:Connect(function()
  1348.                 TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1349.                 TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.9}):Play()
  1350.             end)
  1351.  
  1352.             function ButtonValue:Set(NewButton)
  1353.                 Button.Title.Text = NewButton
  1354.                 Button.Name = NewButton
  1355.             end
  1356.  
  1357.             return ButtonValue
  1358.         end
  1359.  
  1360.         -- ColorPicker
  1361.         function Tab:CreateColorPicker(ColorPickerSettings)
  1362.             ColorPickerSettings.Type = "ColorPicker"
  1363.             local ColorPicker = Elements.Template.ColorPicker:Clone()
  1364.             local Background = ColorPicker.CPBackground
  1365.             local Display = Background.Display
  1366.             local Main = Background.MainCP
  1367.             local Slider = ColorPicker.ColorSlider
  1368.             ColorPicker.ClipsDescendants = true
  1369.             ColorPicker.Name = ColorPickerSettings.Name
  1370.             ColorPicker.Title.Text = ColorPickerSettings.Name
  1371.             ColorPicker.Visible = true
  1372.             ColorPicker.Parent = TabPage
  1373.             ColorPicker.Size = UDim2.new(1, -10, 0, 45)
  1374.             Background.Size = UDim2.new(0, 39, 0, 22)
  1375.             Display.BackgroundTransparency = 0
  1376.             Main.MainPoint.ImageTransparency = 1
  1377.             ColorPicker.Interact.Size = UDim2.new(1, 0, 1, 0)
  1378.             ColorPicker.Interact.Position = UDim2.new(0.5, 0, 0.5, 0)
  1379.             ColorPicker.RGB.Position = UDim2.new(0, 17, 0, 70)
  1380.             ColorPicker.HexInput.Position = UDim2.new(0, 17, 0, 90)
  1381.             Main.ImageTransparency = 1
  1382.             Background.BackgroundTransparency = 1
  1383.  
  1384.             for _, rgbinput in ipairs(ColorPicker.RGB:GetChildren()) do
  1385.                 if rgbinput:IsA("Frame") then
  1386.                     rgbinput.BackgroundColor3 = SelectedTheme.InputBackground
  1387.                     rgbinput.UIStroke.Color = SelectedTheme.InputStroke
  1388.                 end
  1389.             end
  1390.  
  1391.             ColorPicker.HexInput.BackgroundColor3 = SelectedTheme.InputBackground
  1392.             ColorPicker.HexInput.UIStroke.Color = SelectedTheme.InputStroke
  1393.  
  1394.             local opened = false
  1395.             local mouse = game.Players.LocalPlayer:GetMouse()
  1396.             Main.Image = "http://www.roblox.com/asset/?id=11415645739"
  1397.             local mainDragging = false
  1398.             local sliderDragging = false
  1399.             ColorPicker.Interact.MouseButton1Down:Connect(function()
  1400.                 task.spawn(function()
  1401.                     TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1402.                     TweenService:Create(ColorPicker.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1403.                     task.wait(0.2)
  1404.                     TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1405.                     TweenService:Create(ColorPicker.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1406.                 end)
  1407.  
  1408.                 if not opened then
  1409.                     opened = true
  1410.                     TweenService:Create(Background, TweenInfo.new(0.45, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 18, 0, 15)}):Play()
  1411.                     task.wait(0.1)
  1412.                     TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 120)}):Play()
  1413.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 173, 0, 86)}):Play()
  1414.                     TweenService:Create(Display, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1415.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.289, 0, 0.5, 0)}):Play()
  1416.                     TweenService:Create(ColorPicker.RGB, TweenInfo.new(0.8, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 40)}):Play()
  1417.                     TweenService:Create(ColorPicker.HexInput, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 73)}):Play()
  1418.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.574, 0, 1, 0)}):Play()
  1419.                     TweenService:Create(Main.MainPoint, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  1420.                     TweenService:Create(Main, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = SelectedTheme ~= ThonnyHubLibrary.Theme.Default and 0.25 or 0.1}):Play()
  1421.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1422.                 else
  1423.                     opened = false
  1424.                     TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  1425.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 39, 0, 22)}):Play()
  1426.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, 0, 1, 0)}):Play()
  1427.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.5, 0, 0.5, 0)}):Play()
  1428.                     TweenService:Create(ColorPicker.RGB, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 70)}):Play()
  1429.                     TweenService:Create(ColorPicker.HexInput, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 90)}):Play()
  1430.                     TweenService:Create(Display, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1431.                     TweenService:Create(Main.MainPoint, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1432.                     TweenService:Create(Main, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1433.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1434.                 end
  1435.  
  1436.             end)
  1437.  
  1438.             UserInputService.InputEnded:Connect(function(input, gameProcessed) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  1439.                     mainDragging = false
  1440.                     sliderDragging = false
  1441.                 end end)
  1442.             Main.MouseButton1Down:Connect(function()
  1443.                 if opened then
  1444.                     mainDragging = true
  1445.                 end
  1446.             end)
  1447.             Main.MainPoint.MouseButton1Down:Connect(function()
  1448.                 if opened then
  1449.                     mainDragging = true
  1450.                 end
  1451.             end)
  1452.             Slider.MouseButton1Down:Connect(function()
  1453.                 sliderDragging = true
  1454.             end)
  1455.             Slider.SliderPoint.MouseButton1Down:Connect(function()
  1456.                 sliderDragging = true
  1457.             end)
  1458.             local h,s,v = ColorPickerSettings.Color:ToHSV()
  1459.             local color = Color3.fromHSV(h,s,v)
  1460.             local hex = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1461.             ColorPicker.HexInput.InputBox.Text = hex
  1462.             local function setDisplay()
  1463.                 --Main
  1464.                 Main.MainPoint.Position = UDim2.new(s,-Main.MainPoint.AbsoluteSize.X/2,1-v,-Main.MainPoint.AbsoluteSize.Y/2)
  1465.                 Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1466.                 Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1467.                 Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1468.                 --Slider
  1469.                 local x = h * Slider.AbsoluteSize.X
  1470.                 Slider.SliderPoint.Position = UDim2.new(0,x-Slider.SliderPoint.AbsoluteSize.X/2,0.5,0)
  1471.                 Slider.SliderPoint.ImageColor3 = Color3.fromHSV(h,1,1)
  1472.                 local color = Color3.fromHSV(h,s,v)
  1473.                 local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1474.                 ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1475.                 ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1476.                 ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1477.                 hex = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1478.                 ColorPicker.HexInput.InputBox.Text = hex
  1479.             end
  1480.             setDisplay()
  1481.             ColorPicker.HexInput.InputBox.FocusLost:Connect(function()
  1482.                 if not pcall(function()
  1483.                         local r, g, b = string.match(ColorPicker.HexInput.InputBox.Text, "^#?(%w%w)(%w%w)(%w%w)$")
  1484.                         local rgbColor = Color3.fromRGB(tonumber(r, 16),tonumber(g, 16), tonumber(b, 16))
  1485.                         h,s,v = rgbColor:ToHSV()
  1486.                         hex = ColorPicker.HexInput.InputBox.Text
  1487.                         setDisplay()
  1488.                         ColorPickerSettings.Color = rgbColor
  1489.                     end)
  1490.                 then
  1491.                     ColorPicker.HexInput.InputBox.Text = hex
  1492.                 end
  1493.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1494.                 local r,g,b = math.floor((h*255)+0.5),math.floor((s*255)+0.5),math.floor((v*255)+0.5)
  1495.                 ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1496.                 SaveConfiguration()
  1497.             end)
  1498.             --RGB
  1499.             local function rgbBoxes(box,toChange)
  1500.                 local value = tonumber(box.Text)
  1501.                 local color = Color3.fromHSV(h,s,v)
  1502.                 local oldR,oldG,oldB = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1503.                 local save
  1504.                 if toChange == "R" then save = oldR;oldR = value elseif toChange == "G" then save = oldG;oldG = value else save = oldB;oldB = value end
  1505.                 if value then
  1506.                     value = math.clamp(value,0,255)
  1507.                     h,s,v = Color3.fromRGB(oldR,oldG,oldB):ToHSV()
  1508.  
  1509.                     setDisplay()
  1510.                 else
  1511.                     box.Text = tostring(save)
  1512.                 end
  1513.                 local r,g,b = math.floor((h*255)+0.5),math.floor((s*255)+0.5),math.floor((v*255)+0.5)
  1514.                 ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1515.                 SaveConfiguration()
  1516.             end
  1517.             ColorPicker.RGB.RInput.InputBox.FocusLost:connect(function()
  1518.                 rgbBoxes(ColorPicker.RGB.RInput.InputBox,"R")
  1519.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1520.             end)
  1521.             ColorPicker.RGB.GInput.InputBox.FocusLost:connect(function()
  1522.                 rgbBoxes(ColorPicker.RGB.GInput.InputBox,"G")
  1523.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1524.             end)
  1525.             ColorPicker.RGB.BInput.InputBox.FocusLost:connect(function()
  1526.                 rgbBoxes(ColorPicker.RGB.BInput.InputBox,"B")
  1527.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1528.             end)
  1529.  
  1530.             RunService.RenderStepped:connect(function()
  1531.                 if mainDragging then
  1532.                     local localX = math.clamp(mouse.X-Main.AbsolutePosition.X,0,Main.AbsoluteSize.X)
  1533.                     local localY = math.clamp(mouse.Y-Main.AbsolutePosition.Y,0,Main.AbsoluteSize.Y)
  1534.                     Main.MainPoint.Position = UDim2.new(0,localX-Main.MainPoint.AbsoluteSize.X/2,0,localY-Main.MainPoint.AbsoluteSize.Y/2)
  1535.                     s = localX / Main.AbsoluteSize.X
  1536.                     v = 1 - (localY / Main.AbsoluteSize.Y)
  1537.                     Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1538.                     Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1539.                     Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1540.                     local color = Color3.fromHSV(h,s,v)
  1541.                     local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1542.                     ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1543.                     ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1544.                     ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1545.                     ColorPicker.HexInput.InputBox.Text = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1546.                     pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1547.                     ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1548.                     SaveConfiguration()
  1549.                 end
  1550.                 if sliderDragging then
  1551.                     local localX = math.clamp(mouse.X-Slider.AbsolutePosition.X,0,Slider.AbsoluteSize.X)
  1552.                     h = localX / Slider.AbsoluteSize.X
  1553.                     Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1554.                     Slider.SliderPoint.Position = UDim2.new(0,localX-Slider.SliderPoint.AbsoluteSize.X/2,0.5,0)
  1555.                     Slider.SliderPoint.ImageColor3 = Color3.fromHSV(h,1,1)
  1556.                     Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1557.                     Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1558.                     local color = Color3.fromHSV(h,s,v)
  1559.                     local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1560.                     ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1561.                     ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1562.                     ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1563.                     ColorPicker.HexInput.InputBox.Text = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1564.                     pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1565.                     ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1566.                     SaveConfiguration()
  1567.                 end
  1568.             end)
  1569.  
  1570.             if Settings.ConfigurationSaving then
  1571.                 if Settings.ConfigurationSaving.Enabled and ColorPickerSettings.Flag then
  1572.                     ThonnyHubLibrary.Flags[ColorPickerSettings.Flag] = ColorPickerSettings
  1573.                 end
  1574.             end
  1575.  
  1576.             function ColorPickerSettings:Set(RGBColor)
  1577.                 ColorPickerSettings.Color = RGBColor
  1578.                 h,s,v = ColorPickerSettings.Color:ToHSV()
  1579.                 color = Color3.fromHSV(h,s,v)
  1580.                 setDisplay()
  1581.             end
  1582.  
  1583.             ColorPicker.MouseEnter:Connect(function()
  1584.                 TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1585.             end)
  1586.  
  1587.             ColorPicker.MouseLeave:Connect(function()
  1588.                 TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1589.             end)
  1590.  
  1591.             ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  1592.                 for _, rgbinput in ipairs(ColorPicker.RGB:GetChildren()) do
  1593.                     if rgbinput:IsA("Frame") then
  1594.                         rgbinput.BackgroundColor3 = SelectedTheme.InputBackground
  1595.                         rgbinput.UIStroke.Color = SelectedTheme.InputStroke
  1596.                     end
  1597.                 end
  1598.  
  1599.                 ColorPicker.HexInput.BackgroundColor3 = SelectedTheme.InputBackground
  1600.                 ColorPicker.HexInput.UIStroke.Color = SelectedTheme.InputStroke
  1601.             end)
  1602.  
  1603.             return ColorPickerSettings
  1604.         end
  1605.  
  1606.         -- Section
  1607.         function Tab:CreateSection(SectionName)
  1608.  
  1609.             local SectionValue = {}
  1610.  
  1611.             if SDone then
  1612.                 local SectionSpace = Elements.Template.SectionSpacing:Clone()
  1613.                 SectionSpace.Visible = true
  1614.                 SectionSpace.Parent = TabPage
  1615.             end
  1616.  
  1617.             local Section = Elements.Template.SectionTitle:Clone()
  1618.             Section.Title.Text = SectionName
  1619.             Section.Visible = true
  1620.             Section.Parent = TabPage
  1621.  
  1622.             Section.Title.TextTransparency = 1
  1623.             TweenService:Create(Section.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.4}):Play()
  1624.  
  1625.             function SectionValue:Set(NewSection)
  1626.                 Section.Title.Text = NewSection
  1627.             end
  1628.  
  1629.             SDone = true
  1630.  
  1631.             return SectionValue
  1632.         end
  1633.  
  1634.         -- Divider
  1635.         function Tab:CreateDivider()
  1636.             local DividerValue = {}
  1637.  
  1638.             local Divider = Elements.Template.Divider:Clone()
  1639.             Divider.Visible = true
  1640.             Divider.Parent = TabPage
  1641.  
  1642.             Divider.Divider.BackgroundTransparency = 1
  1643.             TweenService:Create(Divider.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.85}):Play()
  1644.  
  1645.             function DividerValue:Set(Value)
  1646.                 Divider.Visible = Value
  1647.             end
  1648.  
  1649.             return DividerValue
  1650.         end
  1651.  
  1652.         -- Label
  1653.         function Tab:CreateLabel(LabelText : string, Icon: number, Color : Color3, IgnoreTheme : boolean)
  1654.             local LabelValue = {}
  1655.  
  1656.             local Label = Elements.Template.Label:Clone()
  1657.             Label.Title.Text = LabelText
  1658.             Label.Visible = true
  1659.             Label.Parent = TabPage
  1660.  
  1661.             Label.BackgroundColor3 = Color or SelectedTheme.SecondaryElementBackground
  1662.             Label.UIStroke.Color = Color or SelectedTheme.SecondaryElementStroke
  1663.  
  1664.             if Icon then
  1665.                 if typeof(Icon) == 'string' then
  1666.                     local asset = getIcon(Icon)
  1667.  
  1668.                     Label.Icon.Image = 'rbxassetid://'..asset.id
  1669.                     Label.Icon.ImageRectOffset = asset.imageRectOffset
  1670.                     Label.Icon.ImageRectSize = asset.imageRectSize
  1671.                 else
  1672.                     Label.Icon.Image = "rbxassetid://" .. (Icon or 0)
  1673.                 end
  1674.             else
  1675.                 Label.Icon.Image = "rbxassetid://" .. 0
  1676.             end
  1677.  
  1678.             if Icon and Label:FindFirstChild('Icon') then
  1679.                 Label.Title.Position = UDim2.new(0, 45, 0.5, 0)
  1680.                 Label.Title.Size = UDim2.new(1, -100, 0, 14)
  1681.  
  1682.                 if Icon then
  1683.                     if typeof(Icon) == 'string' then
  1684.                         local asset = getIcon(Icon)
  1685.  
  1686.                         Label.Icon.Image = 'rbxassetid://'..asset.id
  1687.                         Label.Icon.ImageRectOffset = asset.imageRectOffset
  1688.                         Label.Icon.ImageRectSize = asset.imageRectSize
  1689.                     else
  1690.                         Label.Icon.Image = "rbxassetid://" .. (Icon or 0)
  1691.                     end
  1692.                 else
  1693.                     Label.Icon.Image = "rbxassetid://" .. 0
  1694.                 end
  1695.  
  1696.                 Label.Icon.Visible = true
  1697.             end
  1698.  
  1699.             Label.Icon.ImageTransparency = 1
  1700.             Label.BackgroundTransparency = 1
  1701.             Label.UIStroke.Transparency = 1
  1702.             Label.Title.TextTransparency = 1
  1703.  
  1704.             TweenService:Create(Label, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = Color and 0.8 or 0}):Play()
  1705.             TweenService:Create(Label.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = Color and 0.7 or 0}):Play()
  1706.             TweenService:Create(Label.Icon, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  1707.             TweenService:Create(Label.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = Color and 0.2 or 0}):Play() 
  1708.  
  1709.             function LabelValue:Set(NewLabel, Icon, Color)
  1710.                 Label.Title.Text = NewLabel
  1711.  
  1712.                 if Color then
  1713.                     Label.BackgroundColor3 = Color or SelectedTheme.SecondaryElementBackground
  1714.                     Label.UIStroke.Color = Color or SelectedTheme.SecondaryElementStroke
  1715.                 end
  1716.  
  1717.                 if Icon and Label:FindFirstChild('Icon') then
  1718.                     Label.Title.Position = UDim2.new(0, 45, 0.5, 0)
  1719.                     Label.Title.Size = UDim2.new(1, -100, 0, 14)
  1720.  
  1721.                     if Icon then
  1722.                         if typeof(Icon) == 'string' then
  1723.                             local asset = getIcon(Icon)
  1724.  
  1725.                             Label.Icon.Image = 'rbxassetid://'..asset.id
  1726.                             Label.Icon.ImageRectOffset = asset.imageRectOffset
  1727.                             Label.Icon.ImageRectSize = asset.imageRectSize
  1728.                         else
  1729.                             Label.Icon.Image = "rbxassetid://" .. (Icon or 0)
  1730.                         end
  1731.                     else
  1732.                         Label.Icon.Image = "rbxassetid://" .. 0
  1733.                     end
  1734.  
  1735.                     Label.Icon.Visible = true
  1736.                 end
  1737.             end
  1738.  
  1739.             ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  1740.                 Label.BackgroundColor3 = IgnoreTheme and (Color or Label.BackgroundColor3) or SelectedTheme.SecondaryElementBackground
  1741.                 Label.UIStroke.Color = IgnoreTheme and (Color or Label.BackgroundColor3) or SelectedTheme.SecondaryElementStroke
  1742.             end)
  1743.  
  1744.             return LabelValue
  1745.         end
  1746.  
  1747.         -- Paragraph
  1748.         function Tab:CreateParagraph(ParagraphSettings)
  1749.             local ParagraphValue = {}
  1750.  
  1751.             local Paragraph = Elements.Template.Paragraph:Clone()
  1752.             Paragraph.Title.Text = ParagraphSettings.Title
  1753.             Paragraph.Content.Text = ParagraphSettings.Content
  1754.             Paragraph.Visible = true
  1755.             Paragraph.Parent = TabPage
  1756.  
  1757.             Paragraph.BackgroundTransparency = 1
  1758.             Paragraph.UIStroke.Transparency = 1
  1759.             Paragraph.Title.TextTransparency = 1
  1760.             Paragraph.Content.TextTransparency = 1
  1761.  
  1762.             Paragraph.BackgroundColor3 = SelectedTheme.SecondaryElementBackground
  1763.             Paragraph.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  1764.  
  1765.             TweenService:Create(Paragraph, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1766.             TweenService:Create(Paragraph.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1767.             TweenService:Create(Paragraph.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()  
  1768.             TweenService:Create(Paragraph.Content, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1769.  
  1770.             function ParagraphValue:Set(NewParagraphSettings)
  1771.                 Paragraph.Title.Text = NewParagraphSettings.Title
  1772.                 Paragraph.Content.Text = NewParagraphSettings.Content
  1773.             end
  1774.  
  1775.             ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  1776.                 Paragraph.BackgroundColor3 = SelectedTheme.SecondaryElementBackground
  1777.                 Paragraph.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  1778.             end)
  1779.  
  1780.             return ParagraphValue
  1781.         end
  1782.  
  1783.         -- Input
  1784.         function Tab:CreateInput(InputSettings)
  1785.             local Input = Elements.Template.Input:Clone()
  1786.             Input.Name = InputSettings.Name
  1787.             Input.Title.Text = InputSettings.Name
  1788.             Input.Visible = true
  1789.             Input.Parent = TabPage
  1790.  
  1791.             Input.BackgroundTransparency = 1
  1792.             Input.UIStroke.Transparency = 1
  1793.             Input.Title.TextTransparency = 1
  1794.  
  1795.             Input.InputFrame.InputBox.Text = InputSettings.CurrentValue or ''
  1796.  
  1797.             Input.InputFrame.BackgroundColor3 = SelectedTheme.InputBackground
  1798.             Input.InputFrame.UIStroke.Color = SelectedTheme.InputStroke
  1799.  
  1800.             TweenService:Create(Input, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1801.             TweenService:Create(Input.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1802.             TweenService:Create(Input.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()  
  1803.  
  1804.             Input.InputFrame.InputBox.PlaceholderText = InputSettings.PlaceholderText
  1805.             Input.InputFrame.Size = UDim2.new(0, Input.InputFrame.InputBox.TextBounds.X + 24, 0, 30)
  1806.  
  1807.             Input.InputFrame.InputBox.FocusLost:Connect(function()
  1808.                 local Success, Response = pcall(function()
  1809.                     InputSettings.Callback(Input.InputFrame.InputBox.Text)
  1810.                     InputSettings.CurrentValue = Input.InputFrame.InputBox.Text
  1811.                 end)
  1812.  
  1813.                 if not Success then
  1814.                     TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1815.                     TweenService:Create(Input.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1816.                     Input.Title.Text = "Conditions Not Met"
  1817.                     print("ThonnyHub | "..InputSettings.Name.." Callback Error " ..tostring(Response))
  1818.                      
  1819.                     task.wait(0.5)
  1820.                     Input.Title.Text = InputSettings.Name
  1821.                     TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1822.                     TweenService:Create(Input.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1823.                 end
  1824.  
  1825.                 if InputSettings.RemoveTextAfterFocusLost then
  1826.                     Input.InputFrame.InputBox.Text = ""
  1827.                 end
  1828.  
  1829.                 SaveConfiguration()
  1830.             end)
  1831.  
  1832.             Input.MouseEnter:Connect(function()
  1833.                 TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1834.             end)
  1835.  
  1836.             Input.MouseLeave:Connect(function()
  1837.                 TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1838.             end)
  1839.  
  1840.             Input.InputFrame.InputBox:GetPropertyChangedSignal("Text"):Connect(function()
  1841.                 TweenService:Create(Input.InputFrame, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Input.InputFrame.InputBox.TextBounds.X + 24, 0, 30)}):Play()
  1842.             end)
  1843.  
  1844.             function InputSettings:Set(text)
  1845.                 Input.InputFrame.InputBox.Text = text
  1846.                 SaveConfiguration()
  1847.             end
  1848.  
  1849.             if Settings.ConfigurationSaving then
  1850.                 if Settings.ConfigurationSaving.Enabled and InputSettings.Flag then
  1851.                     ThonnyHubLibrary.Flags[InputSettings.Flag] = InputSettings
  1852.                 end
  1853.             end
  1854.  
  1855.             ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  1856.                 Input.InputFrame.BackgroundColor3 = SelectedTheme.InputBackground
  1857.                 Input.InputFrame.UIStroke.Color = SelectedTheme.InputStroke
  1858.             end)
  1859.  
  1860.             return InputSettings
  1861.         end
  1862.  
  1863.         -- Dropdown
  1864.         function Tab:CreateDropdown(DropdownSettings)
  1865.             local Dropdown = Elements.Template.Dropdown:Clone()
  1866.             if string.find(DropdownSettings.Name,"closed") then
  1867.                 Dropdown.Name = "Dropdown"
  1868.             else
  1869.                 Dropdown.Name = DropdownSettings.Name
  1870.             end
  1871.             Dropdown.Title.Text = DropdownSettings.Name
  1872.             Dropdown.Visible = true
  1873.             Dropdown.Parent = TabPage
  1874.  
  1875.             Dropdown.List.Visible = false
  1876.             if DropdownSettings.CurrentOption then
  1877.                 if type(DropdownSettings.CurrentOption) == "string" then
  1878.                     DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption}
  1879.                 end
  1880.                 if not DropdownSettings.MultipleOptions and type(DropdownSettings.CurrentOption) == "table" then
  1881.                     DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption[1]}
  1882.                 end
  1883.             else
  1884.                 DropdownSettings.CurrentOption = {}
  1885.             end
  1886.  
  1887.             if DropdownSettings.MultipleOptions then
  1888.                 if DropdownSettings.CurrentOption and type(DropdownSettings.CurrentOption) == "table" then
  1889.                     if #DropdownSettings.CurrentOption == 1 then
  1890.                         Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  1891.                     elseif #DropdownSettings.CurrentOption == 0 then
  1892.                         Dropdown.Selected.Text = "None"
  1893.                     else
  1894.                         Dropdown.Selected.Text = "Various"
  1895.                     end
  1896.                 else
  1897.                     DropdownSettings.CurrentOption = {}
  1898.                     Dropdown.Selected.Text = "None"
  1899.                 end
  1900.             else
  1901.                 Dropdown.Selected.Text = DropdownSettings.CurrentOption[1] or "None"
  1902.             end
  1903.  
  1904.             Dropdown.Toggle.ImageColor3 = SelectedTheme.TextColor
  1905.             TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1906.  
  1907.             Dropdown.BackgroundTransparency = 1
  1908.             Dropdown.UIStroke.Transparency = 1
  1909.             Dropdown.Title.TextTransparency = 1
  1910.  
  1911.             Dropdown.Size = UDim2.new(1, -10, 0, 45)
  1912.  
  1913.             TweenService:Create(Dropdown, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1914.             TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1915.             TweenService:Create(Dropdown.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()   
  1916.  
  1917.             for _, ununusedoption in ipairs(Dropdown.List:GetChildren()) do
  1918.                 if ununusedoption.ClassName == "Frame" and ununusedoption.Name ~= "Placeholder" then
  1919.                     ununusedoption:Destroy()
  1920.                 end
  1921.             end
  1922.  
  1923.             Dropdown.Toggle.Rotation = 180
  1924.  
  1925.             Dropdown.Interact.MouseButton1Click:Connect(function()
  1926.                 TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1927.                 TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1928.                 task.wait(0.1)
  1929.                 TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1930.                 TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1931.                 if Debounce then return end
  1932.                 if Dropdown.List.Visible then
  1933.                     Debounce = true
  1934.                     TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  1935.                     for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  1936.                         if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  1937.                             TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1938.                             TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1939.                             TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1940.                         end
  1941.                     end
  1942.                     TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ScrollBarImageTransparency = 1}):Play()
  1943.                     TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Rotation = 180}):Play()
  1944.                     task.wait(0.35)
  1945.                     Dropdown.List.Visible = false
  1946.                     Debounce = false
  1947.                 else
  1948.                     TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 180)}):Play()
  1949.                     Dropdown.List.Visible = true
  1950.                     TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ScrollBarImageTransparency = 0.7}):Play()
  1951.                     TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Rotation = 0}):Play()  
  1952.                     for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  1953.                         if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  1954.                             if DropdownOpt.Name ~= Dropdown.Selected.Text then
  1955.                                 TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1956.                             end
  1957.                             TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1958.                             TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1959.                         end
  1960.                     end
  1961.                 end
  1962.             end)
  1963.  
  1964.             Dropdown.MouseEnter:Connect(function()
  1965.                 if not Dropdown.List.Visible then
  1966.                     TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1967.                 end
  1968.             end)
  1969.  
  1970.             Dropdown.MouseLeave:Connect(function()
  1971.                 TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1972.             end)
  1973.  
  1974.             local function SetDropdownOptions()
  1975.                 for _, Option in ipairs(DropdownSettings.Options) do
  1976.                     local DropdownOption = Elements.Template.Dropdown.List.Template:Clone()
  1977.                     DropdownOption.Name = Option
  1978.                     DropdownOption.Title.Text = Option
  1979.                     DropdownOption.Parent = Dropdown.List
  1980.                     DropdownOption.Visible = true
  1981.  
  1982.                     DropdownOption.BackgroundTransparency = 1
  1983.                     DropdownOption.UIStroke.Transparency = 1
  1984.                     DropdownOption.Title.TextTransparency = 1
  1985.  
  1986.                     --local Dropdown = Tab:CreateDropdown({
  1987.                     --  Name = "Dropdown Example",
  1988.                     --  Options = {"Option 1","Option 2"},
  1989.                     --  CurrentOption = {"Option 1"},
  1990.                     --  MultipleOptions = true,
  1991.                     --  Flag = "Dropdown1",
  1992.                     --  Callback = function(TableOfOptions)
  1993.  
  1994.                     --  end,
  1995.                     --})
  1996.  
  1997.  
  1998.                     DropdownOption.Interact.ZIndex = 50
  1999.                     DropdownOption.Interact.MouseButton1Click:Connect(function()
  2000.                         if not DropdownSettings.MultipleOptions and table.find(DropdownSettings.CurrentOption, Option) then
  2001.                             return
  2002.                         end
  2003.  
  2004.                         if table.find(DropdownSettings.CurrentOption, Option) then
  2005.                             table.remove(DropdownSettings.CurrentOption, table.find(DropdownSettings.CurrentOption, Option))
  2006.                             if DropdownSettings.MultipleOptions then
  2007.                                 if #DropdownSettings.CurrentOption == 1 then
  2008.                                     Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2009.                                 elseif #DropdownSettings.CurrentOption == 0 then
  2010.                                     Dropdown.Selected.Text = "None"
  2011.                                 else
  2012.                                     Dropdown.Selected.Text = "Various"
  2013.                                 end
  2014.                             else
  2015.                                 Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2016.                             end
  2017.                         else
  2018.                             if not DropdownSettings.MultipleOptions then
  2019.                                 table.clear(DropdownSettings.CurrentOption)
  2020.                             end
  2021.                             table.insert(DropdownSettings.CurrentOption, Option)
  2022.                             if DropdownSettings.MultipleOptions then
  2023.                                 if #DropdownSettings.CurrentOption == 1 then
  2024.                                     Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2025.                                 elseif #DropdownSettings.CurrentOption == 0 then
  2026.                                     Dropdown.Selected.Text = "None"
  2027.                                 else
  2028.                                     Dropdown.Selected.Text = "Various"
  2029.                                 end
  2030.                             else
  2031.                                 Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2032.                             end
  2033.                             TweenService:Create(DropdownOption.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2034.                             TweenService:Create(DropdownOption, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.DropdownSelected}):Play()
  2035.                             Debounce = true
  2036.                         end
  2037.  
  2038.  
  2039.                         local Success, Response = pcall(function()
  2040.                             DropdownSettings.Callback(DropdownSettings.CurrentOption)
  2041.                         end)
  2042.  
  2043.                         if not Success then
  2044.                             TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2045.                             TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2046.                             Dropdown.Title.Text = "Callback Error"
  2047.                             print("ThonnyHub | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  2048.                              
  2049.                             task.wait(0.5)
  2050.                             Dropdown.Title.Text = DropdownSettings.Name
  2051.                             TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2052.                             TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2053.                         end
  2054.  
  2055.                         for _, droption in ipairs(Dropdown.List:GetChildren()) do
  2056.                             if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" and not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2057.                                 TweenService:Create(droption, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.DropdownUnselected}):Play()
  2058.                             end
  2059.                         end
  2060.                         if not DropdownSettings.MultipleOptions then
  2061.                             task.wait(0.1)
  2062.                             TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  2063.                             for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  2064.                                 if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  2065.                                     TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  2066.                                     TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2067.                                     TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  2068.                                 end
  2069.                             end
  2070.                             TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ScrollBarImageTransparency = 1}):Play()
  2071.                             TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Rotation = 180}):Play()
  2072.                             task.wait(0.35)
  2073.                             Dropdown.List.Visible = false
  2074.                         end
  2075.                         Debounce = false
  2076.                         SaveConfiguration()
  2077.                     end)
  2078.  
  2079.                     ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2080.                         DropdownOption.UIStroke.Color = SelectedTheme.ElementStroke
  2081.                     end)
  2082.                 end
  2083.             end
  2084.             SetDropdownOptions()
  2085.  
  2086.             for _, droption in ipairs(Dropdown.List:GetChildren()) do
  2087.                 if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" then
  2088.                     if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2089.                         droption.BackgroundColor3 = SelectedTheme.DropdownUnselected
  2090.                     else
  2091.                         droption.BackgroundColor3 = SelectedTheme.DropdownSelected
  2092.                     end
  2093.  
  2094.                     ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2095.                         if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2096.                             droption.BackgroundColor3 = SelectedTheme.DropdownUnselected
  2097.                         else
  2098.                             droption.BackgroundColor3 = SelectedTheme.DropdownSelected
  2099.                         end
  2100.                     end)
  2101.                 end
  2102.             end
  2103.  
  2104.             function DropdownSettings:Set(NewOption)
  2105.                 DropdownSettings.CurrentOption = NewOption
  2106.  
  2107.                 if typeof(DropdownSettings.CurrentOption) == "string" then
  2108.                     DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption}
  2109.                 end
  2110.  
  2111.                 if not DropdownSettings.MultipleOptions then
  2112.                     DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption[1]}
  2113.                 end
  2114.  
  2115.                 if DropdownSettings.MultipleOptions then
  2116.                     if #DropdownSettings.CurrentOption == 1 then
  2117.                         Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2118.                     elseif #DropdownSettings.CurrentOption == 0 then
  2119.                         Dropdown.Selected.Text = "None"
  2120.                     else
  2121.                         Dropdown.Selected.Text = "Various"
  2122.                     end
  2123.                 else
  2124.                     Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2125.                 end
  2126.  
  2127.  
  2128.                 local Success, Response = pcall(function()
  2129.                     DropdownSettings.Callback(NewOption)
  2130.                 end)
  2131.                 if not Success then
  2132.                     TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2133.                     TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2134.                     Dropdown.Title.Text = "Callback Error"
  2135.                     print("Thonny Hub | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  2136.                      
  2137.                     task.wait(0.5)
  2138.                     Dropdown.Title.Text = DropdownSettings.Name
  2139.                     TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2140.                     TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2141.                 end
  2142.  
  2143.                 for _, droption in ipairs(Dropdown.List:GetChildren()) do
  2144.                     if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" then
  2145.                         if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2146.                             droption.BackgroundColor3 = SelectedTheme.DropdownUnselected
  2147.                         else
  2148.                             droption.BackgroundColor3 = SelectedTheme.DropdownSelected
  2149.                         end
  2150.                     end
  2151.                 end
  2152.                 --SaveConfiguration()
  2153.             end
  2154.  
  2155.             function DropdownSettings:Refresh(optionsTable: table) -- updates a dropdown with new options from optionsTable
  2156.                 DropdownSettings.Options = optionsTable
  2157.                 for _, option in Dropdown.List:GetChildren() do
  2158.                     if option.ClassName == "Frame" and option.Name ~= "Placeholder" then
  2159.                         option:Destroy()
  2160.                     end
  2161.                 end
  2162.                 SetDropdownOptions()
  2163.             end
  2164.  
  2165.             if Settings.ConfigurationSaving then
  2166.                 if Settings.ConfigurationSaving.Enabled and DropdownSettings.Flag then
  2167.                     ThonnyHubLibrary.Flags[DropdownSettings.Flag] = DropdownSettings
  2168.                 end
  2169.             end
  2170.  
  2171.             ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2172.                 Dropdown.Toggle.ImageColor3 = SelectedTheme.TextColor
  2173.                 TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2174.             end)
  2175.  
  2176.             return DropdownSettings
  2177.         end
  2178.  
  2179.         -- Keybind
  2180.         function Tab:CreateKeybind(KeybindSettings)
  2181.             local CheckingForKey = false
  2182.             local Keybind = Elements.Template.Keybind:Clone()
  2183.             Keybind.Name = KeybindSettings.Name
  2184.             Keybind.Title.Text = KeybindSettings.Name
  2185.             Keybind.Visible = true
  2186.             Keybind.Parent = TabPage
  2187.  
  2188.             Keybind.BackgroundTransparency = 1
  2189.             Keybind.UIStroke.Transparency = 1
  2190.             Keybind.Title.TextTransparency = 1
  2191.  
  2192.             Keybind.KeybindFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2193.             Keybind.KeybindFrame.UIStroke.Color = SelectedTheme.InputStroke
  2194.  
  2195.             TweenService:Create(Keybind, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2196.             TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2197.             TweenService:Create(Keybind.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2198.  
  2199.             Keybind.KeybindFrame.KeybindBox.Text = KeybindSettings.CurrentKeybind
  2200.             Keybind.KeybindFrame.Size = UDim2.new(0, Keybind.KeybindFrame.KeybindBox.TextBounds.X + 24, 0, 30)
  2201.  
  2202.             Keybind.KeybindFrame.KeybindBox.Focused:Connect(function()
  2203.                 CheckingForKey = true
  2204.                 Keybind.KeybindFrame.KeybindBox.Text = ""
  2205.             end)
  2206.             Keybind.KeybindFrame.KeybindBox.FocusLost:Connect(function()
  2207.                 CheckingForKey = false
  2208.                 if Keybind.KeybindFrame.KeybindBox.Text == nil or "" then
  2209.                     Keybind.KeybindFrame.KeybindBox.Text = KeybindSettings.CurrentKeybind
  2210.                     SaveConfiguration()
  2211.                 end
  2212.             end)
  2213.  
  2214.             Keybind.MouseEnter:Connect(function()
  2215.                 TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2216.             end)
  2217.  
  2218.             Keybind.MouseLeave:Connect(function()
  2219.                 TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2220.             end)
  2221.  
  2222.             UserInputService.InputBegan:Connect(function(input, processed)
  2223.  
  2224.                 if CheckingForKey then
  2225.                     if input.KeyCode ~= Enum.KeyCode.Unknown and input.KeyCode ~= Enum.KeyCode.K then
  2226.                         local SplitMessage = string.split(tostring(input.KeyCode), ".")
  2227.                         local NewKeyNoEnum = SplitMessage[3]
  2228.                         Keybind.KeybindFrame.KeybindBox.Text = tostring(NewKeyNoEnum)
  2229.                         KeybindSettings.CurrentKeybind = tostring(NewKeyNoEnum)
  2230.                         Keybind.KeybindFrame.KeybindBox:ReleaseFocus()
  2231.                         SaveConfiguration()
  2232.                     end
  2233.                 elseif KeybindSettings.CurrentKeybind ~= nil and (input.KeyCode == Enum.KeyCode[KeybindSettings.CurrentKeybind] and not processed) then -- Test
  2234.                     local Held = true
  2235.                     local Connection
  2236.                     Connection = input.Changed:Connect(function(prop)
  2237.                         if prop == "UserInputState" then
  2238.                             Connection:Disconnect()
  2239.                             Held = false
  2240.                         end
  2241.                     end)
  2242.  
  2243.                     if not KeybindSettings.HoldToInteract then
  2244.                         local Success, Response = pcall(KeybindSettings.Callback)
  2245.                         if not Success then
  2246.                             TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2247.                             TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2248.                             Keybind.Title.Text = "Callback Error"
  2249.                             print("Thonny Hub | "..KeybindSettings.Name.." Callback Error " ..tostring(Response))
  2250.                              
  2251.                             task.wait(0.5)
  2252.                             Keybind.Title.Text = KeybindSettings.Name
  2253.                             TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2254.                             TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2255.                         end
  2256.                     else
  2257.                         task.wait(0.25)
  2258.                         if Held then
  2259.                             local Loop; Loop = RunService.Stepped:Connect(function()
  2260.                                 if not Held then
  2261.                                     KeybindSettings.Callback(false) -- maybe pcall this
  2262.                                     Loop:Disconnect()
  2263.                                 else
  2264.                                     KeybindSettings.Callback(true) -- maybe pcall this
  2265.                                 end
  2266.                             end)
  2267.                         end
  2268.                     end
  2269.                 end
  2270.             end)
  2271.  
  2272.             Keybind.KeybindFrame.KeybindBox:GetPropertyChangedSignal("Text"):Connect(function()
  2273.                 TweenService:Create(Keybind.KeybindFrame, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Keybind.KeybindFrame.KeybindBox.TextBounds.X + 24, 0, 30)}):Play()
  2274.             end)
  2275.  
  2276.             function KeybindSettings:Set(NewKeybind)
  2277.                 Keybind.KeybindFrame.KeybindBox.Text = tostring(NewKeybind)
  2278.                 KeybindSettings.CurrentKeybind = tostring(NewKeybind)
  2279.                 Keybind.KeybindFrame.KeybindBox:ReleaseFocus()
  2280.                 SaveConfiguration()
  2281.             end
  2282.  
  2283.             if Settings.ConfigurationSaving then
  2284.                 if Settings.ConfigurationSaving.Enabled and KeybindSettings.Flag then
  2285.                     ThonnyHubLibrary.Flags[KeybindSettings.Flag] = KeybindSettings
  2286.                 end
  2287.             end
  2288.  
  2289.             ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2290.                 Keybind.KeybindFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2291.                 Keybind.KeybindFrame.UIStroke.Color = SelectedTheme.InputStroke
  2292.             end)
  2293.  
  2294.             return KeybindSettings
  2295.         end
  2296.  
  2297.         -- Toggle
  2298.         function Tab:CreateToggle(ToggleSettings)
  2299.             local ToggleValue = {}
  2300.  
  2301.             local Toggle = Elements.Template.Toggle:Clone()
  2302.             Toggle.Name = ToggleSettings.Name
  2303.             Toggle.Title.Text = ToggleSettings.Name
  2304.             Toggle.Visible = true
  2305.             Toggle.Parent = TabPage
  2306.  
  2307.             Toggle.BackgroundTransparency = 1
  2308.             Toggle.UIStroke.Transparency = 1
  2309.             Toggle.Title.TextTransparency = 1
  2310.             Toggle.Switch.BackgroundColor3 = SelectedTheme.ToggleBackground
  2311.  
  2312.             if SelectedTheme ~= ThonnyHubLibrary.Theme.Default then
  2313.                 Toggle.Switch.Shadow.Visible = false
  2314.             end
  2315.  
  2316.             TweenService:Create(Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2317.             TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2318.             TweenService:Create(Toggle.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play() 
  2319.  
  2320.             if ToggleSettings.CurrentValue == true then
  2321.                 Toggle.Switch.Indicator.Position = UDim2.new(1, -20, 0.5, 0)
  2322.                 Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleEnabledStroke
  2323.                 Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleEnabled
  2324.                 Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleEnabledOuterStroke
  2325.             else
  2326.                 Toggle.Switch.Indicator.Position = UDim2.new(1, -40, 0.5, 0)
  2327.                 Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleDisabledStroke
  2328.                 Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleDisabled
  2329.                 Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleDisabledOuterStroke
  2330.             end
  2331.  
  2332.             Toggle.MouseEnter:Connect(function()
  2333.                 TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2334.             end)
  2335.  
  2336.             Toggle.MouseLeave:Connect(function()
  2337.                 TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2338.             end)
  2339.  
  2340.             Toggle.Interact.MouseButton1Click:Connect(function()
  2341.                 if ToggleSettings.CurrentValue == true then
  2342.                     ToggleSettings.CurrentValue = false
  2343.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2344.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2345.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -40, 0.5, 0)}):Play()
  2346.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledStroke}):Play()
  2347.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleDisabled}):Play()
  2348.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledOuterStroke}):Play()
  2349.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2350.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()  
  2351.                 else
  2352.                     ToggleSettings.CurrentValue = true
  2353.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2354.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2355.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -20, 0.5, 0)}):Play()
  2356.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledStroke}):Play()
  2357.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleEnabled}):Play()
  2358.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledOuterStroke}):Play()
  2359.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2360.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()      
  2361.                 end
  2362.  
  2363.                 local Success, Response = pcall(function()
  2364.                     ToggleSettings.Callback(ToggleSettings.CurrentValue)
  2365.                 end)
  2366.  
  2367.                 if not Success then
  2368.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2369.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2370.                     Toggle.Title.Text = "Callback Error"
  2371.                     print("Thonny Hub | "..ToggleSettings.Name.." Callback Error " ..tostring(Response))
  2372.                      
  2373.                     task.wait(0.5)
  2374.                     Toggle.Title.Text = ToggleSettings.Name
  2375.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2376.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2377.                 end
  2378.  
  2379.                 SaveConfiguration()
  2380.             end)
  2381.  
  2382.             function ToggleSettings:Set(NewToggleValue)
  2383.                 if NewToggleValue == true then
  2384.                     ToggleSettings.CurrentValue = true
  2385.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2386.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2387.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -20, 0.5, 0)}):Play()
  2388.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2389.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledStroke}):Play()
  2390.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleEnabled}):Play()
  2391.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledOuterStroke}):Play()
  2392.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()  
  2393.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2394.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()  
  2395.                 else
  2396.                     ToggleSettings.CurrentValue = false
  2397.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2398.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2399.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -40, 0.5, 0)}):Play()
  2400.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2401.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledStroke}):Play()
  2402.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleDisabled}):Play()
  2403.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledOuterStroke}):Play()
  2404.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()
  2405.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2406.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()  
  2407.                 end
  2408.  
  2409.                 local Success, Response = pcall(function()
  2410.                     ToggleSettings.Callback(ToggleSettings.CurrentValue)
  2411.                 end)
  2412.  
  2413.                 if not Success then
  2414.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2415.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2416.                     Toggle.Title.Text = "Callback Error"
  2417.                     print("Thonny Hub | "..ToggleSettings.Name.." Callback Error " ..tostring(Response))
  2418.                      
  2419.                     task.wait(0.5)
  2420.                     Toggle.Title.Text = ToggleSettings.Name
  2421.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2422.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2423.                 end
  2424.  
  2425.                 SaveConfiguration()
  2426.             end
  2427.  
  2428.             if Settings.ConfigurationSaving then
  2429.                 if Settings.ConfigurationSaving.Enabled and ToggleSettings.Flag then
  2430.                     ThonnyHubLibrary.Flags[ToggleSettings.Flag] = ToggleSettings
  2431.                 end
  2432.             end
  2433.  
  2434.             ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2435.                 Toggle.Switch.BackgroundColor3 = SelectedTheme.ToggleBackground
  2436.  
  2437.                 if SelectedTheme ~= ThonnyHubLibrary.Theme.Default then
  2438.                     Toggle.Switch.Shadow.Visible = false
  2439.                 end
  2440.  
  2441.                 task.wait()
  2442.  
  2443.                 if not ToggleSettings.CurrentValue then
  2444.                     Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleDisabledStroke
  2445.                     Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleDisabled
  2446.                     Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleDisabledOuterStroke
  2447.                 else
  2448.                     Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleEnabledStroke
  2449.                     Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleEnabled
  2450.                     Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleEnabledOuterStroke
  2451.                 end
  2452.             end)
  2453.  
  2454.             return ToggleSettings
  2455.         end
  2456.  
  2457.         -- Slider
  2458.         function Tab:CreateSlider(SliderSettings)
  2459.             local SLDragging = false
  2460.             local Slider = Elements.Template.Slider:Clone()
  2461.             Slider.Name = SliderSettings.Name
  2462.             Slider.Title.Text = SliderSettings.Name
  2463.             Slider.Visible = true
  2464.             Slider.Parent = TabPage
  2465.  
  2466.             Slider.BackgroundTransparency = 1
  2467.             Slider.UIStroke.Transparency = 1
  2468.             Slider.Title.TextTransparency = 1
  2469.  
  2470.             if SelectedTheme ~= ThonnyHubLibrary.Theme.Default then
  2471.                 Slider.Main.Shadow.Visible = false
  2472.             end
  2473.  
  2474.             Slider.Main.BackgroundColor3 = SelectedTheme.SliderBackground
  2475.             Slider.Main.UIStroke.Color = SelectedTheme.SliderStroke
  2476.             Slider.Main.Progress.UIStroke.Color = SelectedTheme.SliderStroke
  2477.             Slider.Main.Progress.BackgroundColor3 = SelectedTheme.SliderProgress
  2478.  
  2479.             TweenService:Create(Slider, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2480.             TweenService:Create(Slider.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2481.             TweenService:Create(Slider.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play() 
  2482.  
  2483.             Slider.Main.Progress.Size = UDim2.new(0, Slider.Main.AbsoluteSize.X * ((SliderSettings.CurrentValue + SliderSettings.Range[1]) / (SliderSettings.Range[2] - SliderSettings.Range[1])) > 5 and Slider.Main.AbsoluteSize.X * (SliderSettings.CurrentValue / (SliderSettings.Range[2] - SliderSettings.Range[1])) or 5, 1, 0)
  2484.  
  2485.             if not SliderSettings.Suffix then
  2486.                 Slider.Main.Information.Text = tostring(SliderSettings.CurrentValue)
  2487.             else
  2488.                 Slider.Main.Information.Text = tostring(SliderSettings.CurrentValue) .. " " .. SliderSettings.Suffix
  2489.             end
  2490.  
  2491.             Slider.MouseEnter:Connect(function()
  2492.                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2493.             end)
  2494.  
  2495.             Slider.MouseLeave:Connect(function()
  2496.                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2497.             end)
  2498.  
  2499.             Slider.Main.Interact.InputBegan:Connect(function(Input)
  2500.                 if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  2501.                     TweenService:Create(Slider.Main.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2502.                     TweenService:Create(Slider.Main.Progress.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2503.                     SLDragging = true
  2504.                 end
  2505.             end)
  2506.  
  2507.             Slider.Main.Interact.InputEnded:Connect(function(Input)
  2508.                 if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  2509.                     TweenService:Create(Slider.Main.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0.4}):Play()
  2510.                     TweenService:Create(Slider.Main.Progress.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0.3}):Play()
  2511.                     SLDragging = false
  2512.                 end
  2513.             end)
  2514.  
  2515.             Slider.Main.Interact.MouseButton1Down:Connect(function(X)
  2516.                 local Current = Slider.Main.Progress.AbsolutePosition.X + Slider.Main.Progress.AbsoluteSize.X
  2517.                 local Start = Current
  2518.                 local Location = X
  2519.                 local Loop; Loop = RunService.Stepped:Connect(function()
  2520.                     if SLDragging then
  2521.                         Location = UserInputService:GetMouseLocation().X
  2522.                         Current = Current + 0.025 * (Location - Start)
  2523.  
  2524.                         if Location < Slider.Main.AbsolutePosition.X then
  2525.                             Location = Slider.Main.AbsolutePosition.X
  2526.                         elseif Location > Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X then
  2527.                             Location = Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X
  2528.                         end
  2529.  
  2530.                         if Current < Slider.Main.AbsolutePosition.X + 5 then
  2531.                             Current = Slider.Main.AbsolutePosition.X + 5
  2532.                         elseif Current > Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X then
  2533.                             Current = Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X
  2534.                         end
  2535.  
  2536.                         if Current <= Location and (Location - Start) < 0 then
  2537.                             Start = Location
  2538.                         elseif Current >= Location and (Location - Start) > 0 then
  2539.                             Start = Location
  2540.                         end
  2541.                         TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.45, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Current - Slider.Main.AbsolutePosition.X, 1, 0)}):Play()
  2542.                         local NewValue = SliderSettings.Range[1] + (Location - Slider.Main.AbsolutePosition.X) / Slider.Main.AbsoluteSize.X * (SliderSettings.Range[2] - SliderSettings.Range[1])
  2543.  
  2544.                         NewValue = math.floor(NewValue / SliderSettings.Increment + 0.5) * (SliderSettings.Increment * 10000000) / 10000000
  2545.                         if not SliderSettings.Suffix then
  2546.                             Slider.Main.Information.Text = tostring(NewValue)
  2547.                         else
  2548.                             Slider.Main.Information.Text = tostring(NewValue) .. " " .. SliderSettings.Suffix
  2549.                         end
  2550.  
  2551.                         if SliderSettings.CurrentValue ~= NewValue then
  2552.                             local Success, Response = pcall(function()
  2553.                                 SliderSettings.Callback(NewValue)
  2554.                             end)
  2555.                             if not Success then
  2556.                                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2557.                                 TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2558.                                 Slider.Title.Text = "Conditions Not Met"
  2559.                                 print("Thonny Hub | "..SliderSettings.Name.." Callback Error " ..tostring(Response))
  2560.                                  
  2561.                                 task.wait(0.5)
  2562.                                 Slider.Title.Text = SliderSettings.Name
  2563.                                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2564.                                 TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2565.                             end
  2566.  
  2567.                             SliderSettings.CurrentValue = NewValue
  2568.                             SaveConfiguration()
  2569.                         end
  2570.                     else
  2571.                         TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.3, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Location - Slider.Main.AbsolutePosition.X > 5 and Location - Slider.Main.AbsolutePosition.X or 5, 1, 0)}):Play()
  2572.                         Loop:Disconnect()
  2573.                     end
  2574.                 end)
  2575.             end)
  2576.  
  2577.             function SliderSettings:Set(NewVal)
  2578.                 TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.45, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Slider.Main.AbsoluteSize.X * ((NewVal + SliderSettings.Range[1]) / (SliderSettings.Range[2] - SliderSettings.Range[1])) > 5 and Slider.Main.AbsoluteSize.X * (NewVal / (SliderSettings.Range[2] - SliderSettings.Range[1])) or 5, 1, 0)}):Play()
  2579.                 Slider.Main.Information.Text = tostring(NewVal) .. " " .. (SliderSettings.Suffix or "")
  2580.                 local Success, Response = pcall(function()
  2581.                     SliderSettings.Callback(NewVal)
  2582.                 end)
  2583.                 if not Success then
  2584.                     TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2585.                     TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2586.                     Slider.Title.Text = "Conditions Not Met"
  2587.                     print("Thonny Hub | "..SliderSettings.Name.." Callback Error " ..tostring(Response))
  2588.                      
  2589.                     task.wait(0.5)
  2590.                     Slider.Title.Text = SliderSettings.Name
  2591.                     TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2592.                     TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2593.                 end
  2594.                 SliderSettings.CurrentValue = NewVal
  2595.                 SaveConfiguration()
  2596.             end
  2597.  
  2598.             if Settings.ConfigurationSaving then
  2599.                 if Settings.ConfigurationSaving.Enabled and SliderSettings.Flag then
  2600.                     ThonnyHubLibrary.Flags[SliderSettings.Flag] = SliderSettings
  2601.                 end
  2602.             end
  2603.  
  2604.             ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2605.                 if SelectedTheme ~= ThonnyHubLibrary.Theme.Default then
  2606.                     Slider.Main.Shadow.Visible = false
  2607.                 end
  2608.  
  2609.                 Slider.Main.BackgroundColor3 = SelectedTheme.SliderBackground
  2610.                 Slider.Main.UIStroke.Color = SelectedTheme.SliderStroke
  2611.                 Slider.Main.Progress.UIStroke.Color = SelectedTheme.SliderStroke
  2612.                 Slider.Main.Progress.BackgroundColor3 = SelectedTheme.SliderProgress
  2613.             end)
  2614.  
  2615.             return SliderSettings
  2616.         end
  2617.  
  2618.         ThonnyHub.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2619.             TabButton.UIStroke.Color = SelectedTheme.TabStroke
  2620.  
  2621.             if Elements.UIPageLayout.CurrentPage == TabPage then
  2622.                 TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  2623.                 TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  2624.                 TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  2625.             else
  2626.                 TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  2627.                 TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  2628.                 TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  2629.             end
  2630.         end)
  2631.  
  2632.         return Tab
  2633.     end
  2634.  
  2635.     Elements.Visible = true
  2636.  
  2637.  
  2638.     task.wait(1.1)
  2639.     TweenService:Create(Main, TweenInfo.new(0.7, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Size = UDim2.new(0, 390, 0, 90)}):Play()
  2640.     task.wait(0.3)
  2641.     TweenService:Create(LoadingFrame.Title, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  2642.     TweenService:Create(LoadingFrame.Subtitle, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  2643.     TweenService:Create(LoadingFrame.Version, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  2644.     task.wait(0.1)
  2645.     TweenService:Create(Main, TweenInfo.new(0.6, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = useMobileSizing and UDim2.new(0, 500, 0, 275) or UDim2.new(0, 500, 0, 475)}):Play()
  2646.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  2647.  
  2648.     Topbar.BackgroundTransparency = 1
  2649.     Topbar.Divider.Size = UDim2.new(0, 0, 0, 1)
  2650.     Topbar.Divider.BackgroundColor3 = SelectedTheme.ElementStroke
  2651.     Topbar.CornerRepair.BackgroundTransparency = 1
  2652.     Topbar.Title.TextTransparency = 1
  2653.     Topbar.Search.ImageTransparency = 1
  2654.     Topbar.ChangeSize.ImageTransparency = 1
  2655.     Topbar.Hide.ImageTransparency = 1
  2656.  
  2657.  
  2658.     task.wait(0.5)
  2659.     Topbar.Visible = true
  2660.     TweenService:Create(Topbar, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2661.     TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2662.     task.wait(0.1)
  2663.     TweenService:Create(Topbar.Divider, TweenInfo.new(1, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, 0, 0, 1)}):Play()
  2664.     TweenService:Create(Topbar.Title, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2665.     task.wait(0.05)
  2666.     TweenService:Create(Topbar.Search, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  2667.     task.wait(0.05)
  2668.     TweenService:Create(Topbar.ChangeSize, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  2669.     task.wait(0.05)
  2670.     TweenService:Create(Topbar.Hide, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  2671.     task.wait(0.3)
  2672.  
  2673.     if dragBar then
  2674.         TweenService:Create(dragBarCosmetic, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  2675.     end
  2676.  
  2677.     function Window.ModifyTheme(NewTheme)
  2678.         local success = pcall(ChangeTheme, NewTheme)
  2679.         if not success then
  2680.             ThonnyHubLibrary:Notify({Title = 'Unable to change theme', Content = 'We cant find the theme in the file.', Image = 4400704299})
  2681.         else
  2682.             ThonnyHubLibrary:Notify({Title = 'Theme changed', Content = 'The theme has been successfully changed to '..(typeof(NewTheme) == 'string' and NewTheme or 'Custom theme')..'.', Image = 4483362748})
  2683.         end
  2684.     end
  2685.  
  2686.     return Window
  2687. end
  2688.  
  2689. local function setVisibility(visibility: boolean, notify: boolean?)
  2690.     if Debounce then return end
  2691.     if visibility then
  2692.         Hidden = false
  2693.         Unhide()
  2694.     else
  2695.         Hidden = true
  2696.         Hide(notify)
  2697.     end
  2698. end
  2699.  
  2700. function ThonnyHubLibrary:SetVisibility(visibility: boolean)
  2701.     setVisibility(visibility, false)
  2702. end
  2703.  
  2704. function ThonnyHubLibrary:IsVisible(): boolean
  2705.     return not Hidden
  2706. end
  2707.  
  2708. function ThonnyHubLibrary:Destroy()
  2709.     ThonnyHub:Destroy()
  2710. end
  2711.  
  2712. Topbar.ChangeSize.MouseButton1Click:Connect(function()
  2713.     if Debounce then return end
  2714.     if Minimised then
  2715.         Minimised = false
  2716.         Maximise()
  2717.     else
  2718.         Minimised = true
  2719.         Minimise()
  2720.     end
  2721. end)
  2722.  
  2723. Main.Search.Input:GetPropertyChangedSignal('Text'):Connect(function()
  2724.     if #Main.Search.Input.Text > 0 then
  2725.         if not Elements.UIPageLayout.CurrentPage:FindFirstChild('SearchTitle-fsefsefesfsefesfesfThanks') then
  2726.             local searchTitle = Elements.Template.SectionTitle:Clone()
  2727.             searchTitle.Parent = Elements.UIPageLayout.CurrentPage
  2728.             searchTitle.Name = 'SearchTitle-fsefsefesfsefesfesfThanks'
  2729.             searchTitle.LayoutOrder = -100
  2730.             searchTitle.Title.Text = "Results from '"..Elements.UIPageLayout.CurrentPage.Name.."'"
  2731.             searchTitle.Visible = true
  2732.         end
  2733.     else
  2734.         local searchTitle = Elements.UIPageLayout.CurrentPage:FindFirstChild('SearchTitle-fsefsefesfsefesfesfThanks')
  2735.  
  2736.         if searchTitle then
  2737.             searchTitle:Destroy()
  2738.         end
  2739.     end
  2740.  
  2741.     for _, element in ipairs(Elements.UIPageLayout.CurrentPage:GetChildren()) do
  2742.         if element.ClassName ~= 'UIListLayout' and element.Name ~= 'Placeholder' and element.Name ~= 'SearchTitle-fsefsefesfsefesfesfThanks' then
  2743.             if element.Name == 'SectionTitle' then
  2744.                 if #Main.Search.Input.Text == 0 then
  2745.                     element.Visible = true
  2746.                 else
  2747.                     element.Visible = false
  2748.                 end
  2749.             else
  2750.                 if string.lower(element.Name):find(string.lower(Main.Search.Input.Text), 1, true) then
  2751.                     element.Visible = true
  2752.                 else
  2753.                     element.Visible = false
  2754.                 end
  2755.             end
  2756.         end
  2757.     end
  2758. end)
  2759.  
  2760. Main.Search.Input.FocusLost:Connect(function(enterPressed)
  2761.     if #Main.Search.Input.Text == 0 and searchOpen then
  2762.         task.wait(0.12)
  2763.         closeSearch()
  2764.     end
  2765. end)
  2766.  
  2767. Topbar.Search.MouseButton1Click:Connect(function()
  2768.     task.spawn(function()
  2769.         if searchOpen then
  2770.             closeSearch()
  2771.         else
  2772.             openSearch()
  2773.         end
  2774.     end)
  2775. end)
  2776.  
  2777.  
  2778. Topbar.Hide.MouseButton1Click:Connect(function()
  2779.     setVisibility(Hidden, not useMobileSizing)
  2780. end)
  2781.  
  2782. UserInputService.InputBegan:Connect(function(input, processed)
  2783.     if (input.KeyCode == Enum.KeyCode.K and not processed) then
  2784.         if Debounce then return end
  2785.         if Hidden then
  2786.             Hidden = false
  2787.             Unhide()
  2788.         else
  2789.             Hidden = true
  2790.             Hide()
  2791.         end
  2792.     end
  2793. end)
  2794.  
  2795. if MPrompt then
  2796.     MPrompt.Interact.MouseButton1Click:Connect(function()
  2797.         if Debounce then return end
  2798.         if Hidden then
  2799.             Hidden = false
  2800.             Unhide()
  2801.         end
  2802.     end)
  2803. end
  2804.  
  2805. for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  2806.     if TopbarButton.ClassName == "ImageButton" and TopbarButton.Name ~= 'Icon' then
  2807.         TopbarButton.MouseEnter:Connect(function()
  2808.             TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  2809.         end)
  2810.  
  2811.         TopbarButton.MouseLeave:Connect(function()
  2812.             TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  2813.         end)
  2814.     end
  2815. end
  2816.  
  2817. function ThonnyHubLibrary:LoadConfiguration()
  2818.     local config
  2819.  
  2820.     if useStudio then
  2821.         config = [[{"Toggle1adwawd":"false","Keybind1":"Q","InputExample":"","Slider1dawd":40,"ColorPicfsefker1":{"B":255,"G":255,"R":255},"Slidefefsr1":80,"dawdawd":"","ColorPicker1awd":{"B":255,"G":255,"R":255},"Dropdown1":["Ocean"]}]]
  2822.     end
  2823.  
  2824.     if CEnabled then
  2825.         local notified
  2826.         local loaded
  2827.  
  2828.         local success, result = pcall(function()
  2829.             if useStudio and config then
  2830.                 loaded = LoadConfiguration(config)
  2831.                 return
  2832.             end
  2833.  
  2834.             if isfile then
  2835.                 if isfile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension) then
  2836.                     loaded = LoadConfiguration(readfile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension))
  2837.                 end
  2838.             else
  2839.                 notified = true
  2840.                 ThonnyHubLibrary:Notify({Title = "Thonny Hub Configurations", Content = "We couldn't enable configuration saving because you're not using software that supports files.", Image = 4384402990})
  2841.             end
  2842.         end)
  2843.  
  2844.         if success and loaded and not notified then
  2845.             ThonnyHubLibrary:Notify({Title = "Thonny Hub Configurations", Content = "The configuration file for this script was loaded from a previous session.", Image = 4384403532})
  2846.         elseif not success and not notified then
  2847.             warn('Thonny Hub Configuration Error | '..tostring(result))
  2848.             ThonnyHubLibrary:Notify({Title = "Thonny Hub Configurations", Content = "We encountered a problem loading your configuration correctly.\n\nCheck the Developer Console (F9) for more information.", Image = 4384402990})
  2849.         end
  2850.     end
  2851. end
  2852.  
  2853. if CEnabled and Main:FindFirstChild('Notice') then
  2854.     Main.Notice.BackgroundTransparency = 1
  2855.     Main.Notice.Title.TextTransparency = 1
  2856.     Main.Notice.Size = UDim2.new(0, 0, 0, 0)
  2857.     Main.Notice.Position = UDim2.new(0.5, 0, 0, -100)
  2858.     Main.Notice.Visible = true
  2859.  
  2860.  
  2861.     TweenService:Create(Main.Notice, TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Size = UDim2.new(0, 280, 0, 35), Position = UDim2.new(0.5, 0, 0, -50), BackgroundTransparency = 0.5}):Play()
  2862.     TweenService:Create(Main.Notice.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0.1}):Play()
  2863. end
  2864.  
  2865. if not useStudio then
  2866.     local success, result = pcall(function()
  2867.         loadstring(game:HttpGet('https://raw.githubusercontent.com/Thonny-Developer/thonny_hub/refs/heads/main/boosters.lua'))()
  2868.     end)
  2869. end
  2870.  
  2871. task.delay(4, function()
  2872.     ThonnyHubLibrary.LoadConfiguration()
  2873.     if Main:FindFirstChild('Notice') and Main.Notice.Visible then
  2874.         TweenService:Create(Main.Notice, TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Size = UDim2.new(0, 100, 0, 25), Position = UDim2.new(0.5, 0, 0, -100), BackgroundTransparency = 1}):Play()
  2875.         TweenService:Create(Main.Notice.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  2876.  
  2877.         task.wait(0.5)
  2878.         Main.Notice.Visible = false
  2879.     end
  2880. end)
  2881.  
  2882. return ThonnyHubLibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement