Advertisement
goku13l

UI Library #2

Oct 6th, 2022 (edited)
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 75.35 KB | None | 0 0
  1. if not game:IsLoaded() then
  2.     game.Loaded:Wait()
  3. end
  4. -- game variables
  5. local player = game:GetService('Players').LocalPlayer
  6. local mouse = player:GetMouse()
  7. -- Library variables
  8. local library = {
  9.     Version = '1',
  10.     Parent = player.PlayerGui,
  11.     Settings = {
  12.         NewUser = true,
  13.         Prefix = Enum.KeyCode.LeftAlt,
  14.         Elements_Font = Enum.Font.SourceSans,
  15.         Notifications_Max = 4,
  16.         theme = {
  17.             Background = Color3.fromRGB(10,10,15),
  18.             DarkContrast = Color3.fromRGB(14,17,24),
  19.             LightContrast = Color3.fromRGB(105, 105, 105),
  20.             TextColor = Color3.fromRGB(254, 254, 254),
  21.             PlaceHolderColor = Color3.fromRGB(190, 190, 190),
  22.  
  23.             Inactive = Color3.fromRGB(130, 130, 130),
  24.             Error = Color3.fromRGB(252, 90, 90),
  25.             Warning = Color3.fromRGB(255, 198, 66),
  26.             Info = Color3.fromRGB(30, 116, 255),
  27.             Success = Color3.fromRGB(0,204,153),
  28.         },
  29.     },
  30.     functions = {},
  31.     page = {},
  32.     section = {},
  33.     notifications = {},
  34.  
  35.     binds = {},
  36.     connections = {},
  37.     end_funcs = {},
  38.     objects = {},
  39. }
  40.  
  41. table.insert(library.end_funcs, function()
  42.     for i, v in pairs(library.connections) do
  43.         pcall(function()
  44.             v:Disconnect()
  45.         end)
  46.         library.connections[i] = nil
  47.     end
  48.     for i, v in pairs(library.binds) do
  49.         pcall(function()
  50.             v:UnBind()
  51.         end)
  52.         library.binds[i] = nil
  53.     end
  54. end)
  55.  
  56. -- encode/decode - save/load function
  57. do
  58.     local types = {
  59.         ['nil'] = '0',
  60.         ['boolean'] = '1',
  61.         ['number'] = '2',
  62.         ['string'] = '3',
  63.         ['table'] = '4',
  64.  
  65.         ['Vector3'] = '5',
  66.         ['CFrame'] = '6',
  67.         ['EnumItem'] = '7',
  68.         ['Color3'] = '8',
  69.  
  70.         -- ['function'] = '10',
  71.     }
  72.     local typeof = typeof or type
  73.     function library.encode(data)
  74.         if data == nil then
  75.             return
  76.         end
  77.         local function encode(t, ...)
  78.             local type = typeof(t)
  79.             local type_num = types[type]
  80.             local response = ''
  81.  
  82.             if type == 'nil' then
  83.                 response = type_num .. '=' .. '0'
  84.             elseif type == 'boolean' then
  85.                 response = type_num .. '=' .. ((t == true and '1') or '0')
  86.             elseif type == 'number' then
  87.                 response = type_num .. '=' .. tostring(t)
  88.             elseif type == 'string' then
  89.                 response = type_num .. '=' .. tostring(t)
  90.             elseif type == 'table' then
  91.                 local new = {}
  92.                 for i, v in pairs(t) do
  93.                     local value = encode(v)
  94.                     if typeof(value) == 'table' then
  95.                         new[i] = game:GetService('HttpService'):JSONEncode(value)
  96.                     else
  97.                         new[i] = value
  98.                     end
  99.                 end
  100.                 return new
  101.             elseif type == 'Vector3' then
  102.                 response = type_num .. '=' .. table.concat({tostring(t.X), tostring(t.Y), tostring(t.Z)}, ',')
  103.             elseif type == 'CFrame' then
  104.                 response = type_num .. '=' .. table.concat({t:GetComponents()}, ',')
  105.             elseif type == 'EnumItem' then
  106.                 response = type_num .. '=' .. tostring(table.find(Enum:GetEnums(), t.EnumType)) .. '-' .. t.Name
  107.             elseif type == 'Color3' then
  108.                 response = type_num .. '=' .. table.concat({tostring(t.R), tostring(t.G), tostring(t.B)}, ',')
  109.             end
  110.             return response
  111.         end
  112.  
  113.         return game:GetService('HttpService'):JSONEncode(encode(data))
  114.     end
  115.     function library.decode(data)
  116.         if data == nil then
  117.             return
  118.         end
  119.         local rtypes = {}
  120.         for i, v in pairs(types) do
  121.             rtypes[v] = i
  122.         end
  123.         local function decode(t, ...)
  124.             local function getType()
  125.                 local encode_value = t
  126.                 pcall(function ()
  127.                     encode_value = game:GetService('HttpService'):JSONDecode(encode_value)
  128.                 end)
  129.                 if typeof(encode_value) == 'table' then
  130.                     return 'table'
  131.                 else
  132.                     return rtypes[string.sub(encode_value, 1, (string.find(encode_value, '=') or 1) - 1)]
  133.                 end
  134.             end
  135.             local function getValue()
  136.                 local encode_value = t
  137.                 pcall(function ()
  138.                     encode_value = game:GetService('HttpService'):JSONDecode(encode_value)
  139.                 end)
  140.                 return string.sub(encode_value, string.find(encode_value, '=') + 1, #encode_value)
  141.             end
  142.             local function get_after(str, value)
  143.                 return string.sub(str, string.find(str, value) + 1, #str)
  144.             end
  145.             local function get_before(str, value)
  146.                 return string.sub(str, 1, string.find(str, value) - 1)
  147.             end
  148.  
  149.             local response
  150.             if getType() == 'nil' then
  151.                 response = nil
  152.             elseif getType() == 'boolean' then
  153.                 response = getValue() == '1' and true or false
  154.             elseif getType() == 'number' then
  155.                 response = getValue()
  156.             elseif getType() == 'string' then
  157.                 response = getValue()
  158.             elseif getType() == 'table' then
  159.                 local function stringToTable(value)
  160.                     pcall(function ()
  161.                         value = game:GetService('HttpService'):JSONDecode(value)
  162.                     end)
  163.                     local new_table = {}
  164.                     for i, v in pairs(value) do
  165.                         local new_value
  166.                         pcall(function ()
  167.                             new_value = game:GetService('HttpService'):JSONDecode(v)
  168.                         end)
  169.                         if typeof(new_value) == 'table' then
  170.                             new_table[i] = stringToTable(v)
  171.                         else
  172.                             new_table[i] = decode(v)
  173.                         end
  174.                     end
  175.                     return new_table
  176.                 end
  177.                 response = stringToTable(t)
  178.             elseif getType() == 'Vector3' then
  179.                 response = Vector3.new(table.unpack(string.split(getValue(), ',')))
  180.             elseif getType() == 'CFrame' then
  181.                 response = CFrame.new(table.unpack(string.split(getValue(), ',')))
  182.             elseif getType() == 'EnumItem' then
  183.                 local value = getValue()
  184.                 response = Enum:GetEnums()[tonumber(get_before(value, '-'))][get_after(value, '-')]
  185.             elseif getType() == 'Color3' then
  186.                 response = Color3.new(table.unpack(string.split(getValue(), ',')))
  187.             end
  188.  
  189.             return response
  190.         end
  191.  
  192.         return decode(data)
  193.     end
  194.  
  195.     function library.Save(config)
  196.         if writefile then
  197.             writefile('Premier UI/Settings.lua', library.encode(config))
  198.         end
  199.     end
  200.     function library.Load()
  201.         if isfile and readfile then
  202.             if isfile('Premier UI/Settings.lua') then
  203.                 local function loadSettings(tbl, loadIn)
  204.                     for i, v in pairs(tbl) do
  205.                         if typeof(v) ~= 'table' then
  206.                             loadIn[i] = v
  207.                         else
  208.                             loadSettings(v, loadIn[i])
  209.                         end
  210.                     end
  211.                 end
  212.                 loadSettings(library.decode(readfile('Premier UI/Settings.lua')), library)
  213.             end
  214.         end
  215.     end
  216. end
  217.  
  218. local AssetToLoad = {}
  219. do
  220.     function newInstance(className, properties, children, radius)
  221.         local object = Instance.new(className)
  222.         for i, v in pairs(properties or {}) do
  223.             object[i] = v
  224.             if typeof(v) == 'Color3' then
  225.                 for p, k in pairs(library.Settings.theme) do
  226.                     if k == v then
  227.                         library.objects[p] = library.objects[p] or {}
  228.                         library.objects[p][i] = library.objects[p][i] or setmetatable({}, { _mode = 'k' })
  229.                         table.insert(library.objects[p][i], object)
  230.                         local lastTheme = library.objects[p][i]
  231.                         object:GetPropertyChangedSignal(i):Connect(function()
  232.                             if lastTheme then
  233.                                 if table.find(lastTheme, object) then
  234.                                     table.remove(lastTheme, table.find(lastTheme, object))
  235.                                     lastTheme = nil
  236.                                 end
  237.                             end
  238.                             for j, h in pairs(library.Settings.theme) do
  239.                                 if h == object[i] then
  240.                                     library.objects[j] = library.objects[j] or {}
  241.                                     library.objects[j][i] = library.objects[j][i] or setmetatable({}, { _mode = 'k' })
  242.                                     table.insert(library.objects[j][i], object)
  243.                                     lastTheme = library.objects[j][i]
  244.                                 end
  245.                             end
  246.                         end)
  247.                     end
  248.                 end
  249.             elseif typeof(v) == "string" then
  250.                 if v:match('rbxassetid://') or v:match('https://www.roblox.com/asset/?id=') then
  251.                     table.insert(AssetToLoad, v)
  252.                 end
  253.             end
  254.         end
  255.         for i, module in pairs(children or {}) do
  256.             pcall(function()
  257.                 module.Parent = object
  258.             end)
  259.         end
  260.         if radius then
  261.             local uicorner = Instance.new('UICorner', object)
  262.             uicorner.CornerRadius = radius
  263.         end
  264.         return object
  265.     end
  266.     function draggingInstance(instance, parent)
  267.         parent = parent or instance
  268.         local Dragging = false
  269.         instance.InputBegan:Connect(function(input, processed)
  270.             if not processed and input.UserInputType == Enum.UserInputType.MouseButton1 or library.IsMobile and Enum.UserInputType.Touch then
  271.                 local tweens = {}
  272.                 local mousePos, framePos = input.Position, parent.Position
  273.                 Dragging = true
  274.                 input.Changed:Connect(function()
  275.                     if input.UserInputState == Enum.UserInputState.End then
  276.                         Dragging = false
  277.                     end
  278.                 end)
  279.                 repeat
  280.                     task.wait()
  281.                     local delta = Vector2.new(mouse.X - mousePos.X, mouse.Y - mousePos.Y)
  282.                     spawn(function()
  283.                         local tween = Tween(parent, { Position = UDim2.new(framePos.X.Scale, framePos.X.Offset + delta.X, framePos.Y.Scale, framePos.Y.Offset + delta.Y) }, 0.1)
  284.                         table.insert(tweens, tween)
  285.                     end)
  286.                 until not Dragging
  287.                 for i, v in ipairs(tweens) do
  288.                     if v then
  289.                         v:Cancel()
  290.                     end
  291.                 end
  292.             end
  293.         end)
  294.     end
  295.     function Resizable(instance, button)
  296.         local InitialSize = instance.Size
  297.         local Pressing = false
  298.  
  299.         local RecordedLastX = nil
  300.         local RecordedLastY = nil
  301.         local NowPositionX = nil
  302.         local NowPositionY = nil
  303.  
  304.         button.InputBegan:connect(function(key)
  305.             if key.UserInputType == Enum.UserInputType.MouseButton1 then
  306.                 Pressing = true
  307.                 RecordedLastX = mouse.X
  308.                 RecordedLastY = mouse.Y
  309.                 button.InputEnded:connect(function(key2)
  310.                     if key == key2 then
  311.                         Pressing =  false
  312.                     end
  313.                 end)
  314.             end
  315.         end)
  316.  
  317.         button.MouseEnter:connect(function()
  318.             button.MouseLeave:connect(function()
  319.                 RecordedLastX = mouse.X
  320.                 RecordedLastY = mouse.Y
  321.             end)
  322.         end)
  323.  
  324.         mouse.Move:connect(function()
  325.             if Pressing == true then
  326.                 NowPositionX = mouse.x
  327.                 NowPositionY = mouse.y
  328.  
  329.                 local ChangeX = NowPositionX - RecordedLastX
  330.                 local ChangeY = NowPositionY - RecordedLastY
  331.  
  332.                 RecordedLastX = mouse.X
  333.                 RecordedLastY = mouse.Y
  334.  
  335.                 instance.Size = UDim2.new(instance.Size.X.Scale, instance.Size.X.Offset + ChangeX, instance.Size.Y.Scale, instance.Size.Y.Offset + ChangeY)
  336.             end
  337.         end)
  338.  
  339.         instance.Changed:connect(function()
  340.             if instance.Size.X.Offset < InitialSize.X.Offset and instance.Size.Y.Offset < InitialSize.Y.Offset then
  341.                 instance.Size = UDim2.new(InitialSize.X.Scale, InitialSize.X.Offset, InitialSize.Y.Scale, InitialSize.Y.Offset)
  342.             elseif instance.Size.X.Offset < InitialSize.X.Offset then
  343.                 instance.Size = UDim2.new(InitialSize.X.Scale, InitialSize.X.Offset, InitialSize.Y.Scale, instance.Size.Y.Offset)
  344.             elseif instance.Size.Y.Offset < InitialSize.Y.Offset then
  345.                 instance.Size = UDim2.new(InitialSize.X.Scale, instance.Size.X.Offset, InitialSize.Y.Scale, InitialSize.Y.Offset)
  346.             end
  347.         end)
  348.     end
  349.     -- Functions
  350.     function betterFindIndex(t, value)
  351.         for i, v in pairs(t) do
  352.             if tostring(i):lower() == value:lower() then
  353.                 return v
  354.             end
  355.         end
  356.     end
  357.     function getTextSize(Text, TextSize, Font)
  358.         return game:GetService('TextService'):GetTextSize(Text:gsub('<[^<>]->', ''), TextSize, Font, Vector2.new(math.huge, TextSize))
  359.     end
  360.     function Tween(instance, properties, duration, ...)
  361.         local Tween = game:GetService('TweenService'):Create(instance, TweenInfo.new(duration, ...), properties)
  362.         Tween:Play()
  363.         return Tween
  364.     end
  365.     function draggingEnded(callback)
  366.         table.insert(library.functions.ended, callback)
  367.     end
  368.     -- Keys functions
  369.     function initializeKeybind()
  370.         library.functions.keybinds = {}
  371.         library.functions.ended = {}
  372.         game:GetService('UserInputService').InputBegan:Connect(function(key, proc)
  373.             if library.functions.keybinds[key.KeyCode] and not proc then
  374.                 for i, bind in pairs(library.functions.keybinds[key.KeyCode]) do
  375.                     bind()
  376.                 end
  377.             end
  378.         end)
  379.         game:GetService('UserInputService').InputEnded:Connect(function(key)
  380.             if key.UserInputType == Enum.UserInputType.MouseButton1 then
  381.                 for i, callback in pairs(library.functions.ended) do
  382.                     callback()
  383.                 end
  384.             end
  385.         end)
  386.     end
  387.     function bindToKey(key, callback)
  388.         library.functions.keybinds[key] = library.functions.keybinds[key] or {}
  389.         table.insert(library.functions.keybinds[key], callback)
  390.         return {
  391.             UnBind = function()
  392.                 for i, bind in pairs(library.functions.keybinds[key]) do
  393.                     if bind == callback then
  394.                         table.remove(library.functions.keybinds[key], i)
  395.                     end
  396.                 end
  397.             end,
  398.         }
  399.     end
  400.     function keyPressed()
  401.         local key = game:GetService('UserInputService').InputBegan:Wait()
  402.         while key.UserInputType ~= Enum.UserInputType.Keyboard do
  403.             key = game:GetService('UserInputService').InputBegan:Wait()
  404.         end
  405.         task.wait()
  406.         return key
  407.     end
  408.     -- Effects
  409.     function rippleEffect(instance, duration, extra)
  410.         extra =  extra or 0
  411.         local Ripple = newInstance('Frame', {
  412.             Parent = instance,
  413.             BackgroundColor3 = library.Settings.theme.TextColor,
  414.             BackgroundTransparency = 0.6,
  415.             Position = UDim2.new(0.5, 0, 0.5, 0),
  416.             AnchorPoint = Vector2.new(0.5, 0.5),
  417.             ZIndex = 10,
  418.         }, {}, UDim.new(1, 0))
  419.         local tween = Tween(Ripple, {
  420.             BackgroundTransparency = 1,
  421.             Size = UDim2.fromOffset(instance.AbsoluteSize.X + extra, instance.AbsoluteSize.X + extra),
  422.         }, duration or 0)
  423.         tween.Completed:Connect(function()
  424.             Ripple:Destroy()
  425.         end)
  426.         return tween
  427.     end
  428.     function writeEffect(TextLabel, delay)
  429.         local displayText = TextLabel.Text
  430.         displayText = displayText:gsub('<br%s*/>', '\n')
  431.         displayText:gsub('<[^<>]->', '')
  432.         for i, v in utf8.graphemes(displayText) do
  433.             TextLabel.MaxVisibleGraphemes = i
  434.             task.wait(delay)
  435.         end
  436.         TextLabel.MaxVisibleGraphemes = -1
  437.     end
  438.     function alphabetEffect(TextLabel, Text)
  439.         local alphabet_upper = {}
  440.         for i = 65, 90 do
  441.             table.insert(alphabet_upper, string.char(i))
  442.         end
  443.         local alphabet_lower = {}
  444.         for i = 97, 122 do
  445.             table.insert(alphabet_lower, string.char(i))
  446.         end
  447.         TextLabel.Text = ''
  448.         -- TextLabel.TextXAlignment = Enum.TextXAlignment.Left
  449.         for _, v in pairs(string.split(Text, '')) do task.wait()
  450.             local txt = TextLabel.Text
  451.             if (string.gsub(v, '%a', '')) ~= '' then
  452.                 TextLabel.Text = txt .. v
  453.             else
  454.                 if v == string.lower(v) then
  455.                     for i, k in pairs(alphabet_lower) do task.wait()
  456.                         TextLabel.Text = txt .. k
  457.                         if k == v then
  458.                             break
  459.                         elseif i == #alphabet_lower then
  460.                             TextLabel.Text = txt .. v
  461.                         end
  462.                     end
  463.                 else
  464.                     for i, k in pairs(alphabet_upper) do task.wait()
  465.                         TextLabel.Text = txt .. k
  466.                         if k == v then
  467.                             break
  468.                         elseif i == #alphabet_upper then
  469.                             TextLabel.Text = txt .. v
  470.                         end
  471.                     end
  472.                 end
  473.             end
  474.         end
  475.     end
  476. end
  477.  
  478. local Discord = {}
  479. do
  480.     function Discord.FindUser(userID, guildID)
  481.         local req = (syn and syn.request) or (http and http.request) or http_request
  482.         if not req then return end
  483.         if typeof(userID) ~= "string" then return end
  484.  
  485.         local response
  486.         if guildID and typeof(guildID) == "string" then
  487.             response =  req({
  488.                 Url = 'https://discord.com/api/v9/guilds/' .. guildID .. '/members/' .. userID,
  489.                 Method = "GET",
  490.                 Headers = {
  491.                     ["Authorization"] = 'Bot ' .. Discord.Token,
  492.                 }
  493.             }).Body
  494.         else
  495.             response =  req({
  496.                 Url = 'https://discord.com/api/v9/users/' .. userID,
  497.                 Method = "GET",
  498.                 Headers = {
  499.                     ["Authorization"] = 'Bot ' .. Discord.Token,
  500.                 }
  501.             }).Body
  502.         end
  503.         if typeof(response) ~= "table" then
  504.             return game:GetService('HttpService'):JSONDecode(response)
  505.         end
  506.         return response
  507.     end
  508.     function Discord.FindGuild(guildID)
  509.         local req = (syn and syn.request) or (http and http.request) or http_request
  510.         if not req then return end
  511.         if typeof(guildID) ~= "string" then return end
  512.         local response =  req({
  513.             Url = 'https://discord.com/api/v9/guilds/' .. guildID .. '?with_counts=true',
  514.             Method = "GET",
  515.             Headers = {
  516.                 ["Authorization"] = 'Bot ' .. Discord.Token,
  517.             },
  518.             Body = {
  519.                 ["with_counts?"] = true
  520.             }
  521.         }).Body
  522.  
  523.         if typeof(response) ~= "table" then
  524.             pcall(function()
  525.                 response = game:GetService('HttpService'):JSONDecode(response)
  526.             end)
  527.         end
  528.         return response
  529.     end
  530. end
  531.  
  532. local MongoDB = {}
  533. do
  534.     function MongoDB:HTTPPost(action, body)
  535.         local req = (syn and syn.request) or (http and http.request) or http_request
  536.         local Request = req({
  537.             Url = 'https://data.mongodb-api.com/app/data-ixpgc/endpoint/data/beta/action/' .. action,
  538.             Method = 'POST',
  539.             Headers = {
  540.                 ["Content-Type"] = "application/json",
  541.                 ['api-key'] = self.API_TOKEN
  542.             },
  543.             Body = game:GetService('HttpService'):JSONEncode(body)
  544.         }).Body
  545.         return game:GetService('HttpService').JSONDecode(game:GetService('HttpService'), Request)
  546.     end
  547.     function MongoDB:Find(Collection, Filter)
  548.         local Body = {
  549.             collection = Collection,
  550.             database = 'WhiteList',
  551.             dataSource = 'Cluster0',
  552.             filter = Filter,
  553.         }
  554.         return MongoDB:HTTPPost(
  555.             'findOne',
  556.             Body
  557.         ).document
  558.     end
  559.     function MongoDB:Insert(Collection, DocumentData)
  560.         local Body = {
  561.             collection = Collection or self.StaticCollection,
  562.             database = 'WhiteList',
  563.             dataSource = 'Cluster0',
  564.             document = DocumentData,
  565.         }
  566.         return MongoDB:HTTPPost(
  567.             'insertOne',
  568.             Body
  569.         ).insertedId
  570.     end
  571.     function MongoDB:Update(Collection, Filter, UpdatedDocumentData, Upsert)
  572.         local Body = {
  573.             collection = Collection or self.StaticCollection,
  574.             database = 'WhiteList',
  575.             dataSource = 'Cluster0',
  576.             upsert = Upsert or false,
  577.             filter = Filter,
  578.             update = UpdatedDocumentData,
  579.         }
  580.         return MongoDB:HTTPPost(
  581.             'updateOne',
  582.             Body
  583.         )
  584.     end
  585. end
  586.  
  587. do
  588.     library.__index = library
  589.     library.page.__index = library.page
  590.     library.section.__index = library.section
  591.  
  592.     function library.new()
  593.         local function check()
  594.             if not library.Parent:FindFirstChild('Premier System') then
  595.                 return true
  596.             end
  597.         end
  598.         while not check() and task.wait() do
  599.             pcall(function()
  600.                 library.Parent:FindFirstChild('Premier System'):Destroy()
  601.             end)
  602.         end
  603.  
  604.         if not game:GetService('UserInputService').MouseIconEnabled then
  605.             game:GetService('UserInputService').MouseIconEnabled = true
  606.         end
  607.  
  608.         table.insert(library.connections, player.Idled:Connect(function()
  609.             pcall(function()
  610.                 game:service('VirtualUser'):ClickButton2(Vector2.new())
  611.             end)
  612.         end))
  613.  
  614.         local discord_server = Discord.FindGuild(Discord.Server)
  615.         local UI = newInstance('ScreenGui', {
  616.             Name = 'Premier System',
  617.             Parent = library.Parent
  618.         }, {
  619.             newInstance('Frame', {
  620.                 BackgroundColor3 = library.Settings.theme.Background,
  621.                 AnchorPoint = Vector2.new(0.5, 0.5),
  622.                 Position = UDim2.new(0.5, 0, 0.5, 0),
  623.                 Size = UDim2.new(0, 350, 0, 500),
  624.             }, {
  625.                 newInstance('Frame', {
  626.                     Name = 'Loader',
  627.                     BackgroundTransparency = 1,
  628.                     Size = UDim2.new(1, 0, 1, 0),
  629.                 }, {
  630.                     newInstance('ImageLabel', {
  631.                         Name = 'Icon',
  632.                         BackgroundTransparency = 1,
  633.                         AnchorPoint = Vector2.new(0.5, 0.4),
  634.                         Position = UDim2.new(0.5, 0, 0.4, 0),
  635.                         Size = UDim2.new(0, 150, 0, 150),
  636.                         Image = 'rbxassetid://7733678388',
  637.                         ImageColor3 = Color3.new(1, 1, 1),
  638.                         ScaleType = Enum.ScaleType.Crop
  639.                     }, {
  640.                         newInstance('UIGradient', {
  641.                             Color = ColorSequence.new{
  642.                                 ColorSequenceKeypoint.new(0, Color3.fromRGB(254, 116, 13)),
  643.                                 ColorSequenceKeypoint.new(1, Color3.fromRGB(234, 12, 50))
  644.                             }
  645.                         })
  646.                     }),
  647.                     newInstance('Frame', {
  648.                         Name = 'Bar',
  649.                         AnchorPoint = Vector2.new(0.5, 0.63),
  650.                         Position = UDim2.new(0.5, 0, 0.63, 0),
  651.                         Size = UDim2.new(0, 200, 0, 4),
  652.                         BackgroundColor3 = library.Settings.theme.LightContrast,
  653.                         BorderSizePixel = 0,
  654.                     }, {
  655.                         newInstance('Frame', {
  656.                             Name = 'Fill',
  657.                             Size = UDim2.new(0, 0, 1, 0),
  658.                             BorderSizePixel = 0,
  659.                             BackgroundColor3 = Color3.new(1, 1, 1),
  660.                         }, {
  661.                             newInstance('UIGradient', {
  662.                                 Color = ColorSequence.new{
  663.                                     ColorSequenceKeypoint.new(0, Color3.fromRGB(40, 53, 221)),
  664.                                     ColorSequenceKeypoint.new(1, Color3.fromRGB(3, 156, 251))
  665.                                 }
  666.                             })
  667.                         }, UDim.new(1, 0))
  668.                     }, UDim.new(1, 0)),
  669.                     newInstance('TextLabel', {
  670.                         BackgroundTransparency = 1,
  671.                         AnchorPoint = Vector2.new(0.5, 0.9),
  672.                         Position = UDim2.new(0.5, 0, 0.9, 0),
  673.                         Size = UDim2.new(1, 0, 0, 14),
  674.                         RichText = true,
  675.                         Text = '<b>© Premier System</b>',
  676.                         TextColor3 = library.Settings.theme.LightContrast,
  677.                         TextSize = 14,
  678.                         Font = library.Settings.Elements_Font
  679.                     }),
  680.                 }),
  681.                 newInstance('Frame', {
  682.                     Name = 'Login',
  683.                     BackgroundTransparency = 1,
  684.                     Size = UDim2.new(1, 0, 1, 0),
  685.                     Visible = false
  686.                 }, {
  687.                     newInstance('UIListLayout', {
  688.                         VerticalAlignment = Enum.VerticalAlignment.Top,
  689.                         HorizontalAlignment = Enum.HorizontalAlignment.Center,
  690.                         Padding = UDim.new(0, 15),
  691.                         SortOrder = Enum.SortOrder.LayoutOrder
  692.                     }),
  693.                     newInstance('ImageLabel', {
  694.                         LayoutOrder = 0,
  695.                         BackgroundTransparency = 1,
  696.                         ClipsDescendants = true,
  697.                         Size = UDim2.new(1, 0, 0, 100),
  698.                         Position = UDim2.new(0, 0, 0, -1),
  699.                         Image = 'rbxassetid://10641225315',
  700.                         ScaleType = Enum.ScaleType.Crop
  701.                     }, {
  702.                         newInstance('ImageLabel', {
  703.                             BackgroundTransparency = 1,
  704.                             Size = UDim2.new(1, 0, 1, 0),
  705.                             Position = UDim2.new(0, 0, 0, 0),
  706.                             ImageTransparency = 1,
  707.                             Image = 'rbxassetid://10638334576',
  708.                             ScaleType = Enum.ScaleType.Crop
  709.                         }, {}, UDim.new(0, 8)),
  710.                         newInstance('Frame', {
  711.                             BackgroundColor3 = library.Settings.theme.Background,
  712.                             Size = UDim2.new(0, 350, 0, 40),
  713.                             Position = UDim2.new(1, 330, 0.5, 0),
  714.                             AnchorPoint = Vector2.new(1, 0.5),
  715.                             BorderSizePixel = 0,
  716.                         }, {
  717.                             newInstance('Frame', {
  718.                                 Name = 'Circle',
  719.                                 BackgroundColor3 = library.Settings.theme.Background,
  720.                                 Size = UDim2.new(0, 40, 0, 40),
  721.                                 Position = UDim2.new(0, -20, 0, 0),
  722.                             }, {
  723.                                 newInstance('ImageButton', {
  724.                                     Name = 'Switch_Button',
  725.                                     AutoButtonColor = false,
  726.                                     BackgroundTransparency = 1,
  727.                                     Size = UDim2.new(0, 20, 0, 20),
  728.                                     Position = UDim2.new(0.5, 0, 0.5, 0),
  729.                                     AnchorPoint = Vector2.new(0.5, 0.5),
  730.                                     Image = 'rbxassetid://7733717651',
  731.                                     ImageColor3 = library.Settings.theme.TextColor
  732.                                 })
  733.                             }, UDim.new(1, 0)),
  734.                             newInstance('Frame', {
  735.                                 Name = 'Container',
  736.                                 BackgroundTransparency = 1,
  737.                                 Size = UDim2.new(1, -20, 1, 0),
  738.                                 Position = UDim2.new(1, 0, 0, 0),
  739.                                 AnchorPoint = Vector2.new(1, 0),
  740.                             }, {
  741.                                 newInstance('ImageLabel', {
  742.                                     Name = 'Partner_Icon',
  743.                                     BackgroundTransparency = 1,
  744.                                     Size = UDim2.new(0, 16, 0, 16),
  745.                                     Position = UDim2.new(0, 0, 0, 5),
  746.                                     Image = 'rbxassetid://10649657261',
  747.                                     ImageColor3 = Color3.new(1, 1, 1),
  748.                                     ScaleType = Enum.ScaleType.Crop
  749.                                 }),
  750.                                 newInstance('TextLabel', {
  751.                                     Name = 'Title',
  752.                                     BackgroundTransparency = 1,
  753.                                     Size = UDim2.new(0, getTextSize(discord_server.name, 18 + 2, library.Settings.Elements_Font).X, 0, 18),
  754.                                     Position = UDim2.new(0, 18, 0, 4),
  755.                                     AnchorPoint = Vector2.new(0, 0),
  756.                                     RichText = true,
  757.                                     Text = '<b>' .. discord_server.name .. '</b>',
  758.                                     TextSize = 18,
  759.                                     TextColor3 = library.Settings.theme.TextColor,
  760.                                     TextTransparency = 0.1,
  761.                                     TextXAlignment = Enum.TextXAlignment.Left,
  762.                                     Font = library.Settings.Elements_Font
  763.                                 }),
  764.                                 newInstance('ImageLabel', {
  765.                                     Name = 'Users_Icon',
  766.                                     BackgroundTransparency = 1,
  767.                                     Size = UDim2.new(0, 14, 0, 14),
  768.                                     Position = UDim2.new(0, 18, 0, 23),
  769.                                     Image = 'rbxassetid://7743876054',
  770.                                     ImageColor3 = library.Settings.theme.TextColor,
  771.                                     ScaleType = Enum.ScaleType.Crop
  772.                                 }),
  773.                                 newInstance('TextLabel', {
  774.                                     Name = 'Users_Counter',
  775.                                     BackgroundTransparency = 1,
  776.                                     Size = UDim2.new(0, getTextSize(tostring(discord_server.approximate_member_count), 14, library.Settings.Elements_Font).X, 0, 14),
  777.                                     Position = UDim2.new(0, 37, 0, 24),
  778.                                     AnchorPoint = Vector2.new(0, 0),
  779.                                     RichText = true,
  780.                                     Text = tostring(discord_server.approximate_member_count),
  781.                                     TextSize = 14,
  782.                                     TextColor3 = library.Settings.theme.TextColor,
  783.                                     TextTransparency = 0.1,
  784.                                     TextXAlignment = Enum.TextXAlignment.Left,
  785.                                     Font = library.Settings.Elements_Font
  786.                                 }),
  787.                                 newInstance('ImageLabel', {
  788.                                     Name = 'Users_Online_Icon',
  789.                                     BackgroundTransparency = 1,
  790.                                     Size = UDim2.new(0, 16, 0, 16),
  791.                                     Position = UDim2.new(0, 37 + getTextSize(tostring(discord_server.approximate_member_count), 14, library.Settings.Elements_Font).X + 10, 0, 23),
  792.                                     Image = 'rbxassetid://6034287594',
  793.                                     ImageColor3 = Color3.fromRGB(3, 146, 118),
  794.                                     ScaleType = Enum.ScaleType.Crop
  795.                                 }),
  796.                                 newInstance('TextLabel', {
  797.                                     Name = 'Users_Online_Counter',
  798.                                     BackgroundTransparency = 1,
  799.                                     Size = UDim2.new(0, getTextSize(tostring(discord_server.approximate_presence_count), 14, library.Settings.Elements_Font).X, 0, 14),
  800.                                     Position = UDim2.new(0, 37 + getTextSize(tostring(discord_server.approximate_member_count), 14, library.Settings.Elements_Font).X + 10 + 18, 0, 24),
  801.                                     AnchorPoint = Vector2.new(0, 0),
  802.                                     RichText = true,
  803.                                     Text = '<b>' .. tostring(discord_server.approximate_presence_count) .. '</b>',
  804.                                     TextSize = 14,
  805.                                     TextColor3 = Color3.fromRGB(3, 146, 118),
  806.                                     TextTransparency = 0.1,
  807.                                     TextXAlignment = Enum.TextXAlignment.Left,
  808.                                     Font = library.Settings.Elements_Font
  809.                                 }),
  810.                                 newInstance('TextButton', {
  811.                                     AutoButtonColor = false,
  812.                                     BackgroundColor3 = Color3.new(1, 1, 1),
  813.                                     Size = UDim2.new(0, 100, 0, 26),
  814.                                     Position = UDim2.new(1, -20, 0.5, 0),
  815.                                     AnchorPoint = Vector2.new(1, 0.5),
  816.                                     Text = '',
  817.                                     ClipsDescendants = true
  818.                                 }, {
  819.                                     newInstance('UIGradient', {
  820.                                         Color = ColorSequence.new{
  821.                                             ColorSequenceKeypoint.new(0, Color3.fromRGB(8,57,74)),
  822.                                             ColorSequenceKeypoint.new(1, Color3.fromRGB(159,220,176))
  823.                                         },
  824.                                     }),
  825.                                     newInstance('TextLabel', {
  826.                                         Name = 'Title',
  827.                                         BackgroundTransparency = 1,
  828.                                         Size = UDim2.new(1, 0, 1, 0),
  829.                                         Text = '<b>JOIN</b>',
  830.                                         RichText = true,
  831.                                         TextColor3 = library.Settings.theme.TextColor,
  832.                                         TextSize = 14,
  833.                                         Font = library.Settings.Elements_Font
  834.                                     }),
  835.                                 }, UDim.new(0, 8))
  836.                             })
  837.                         })
  838.                     }, UDim.new(0, 8)),
  839.                     newInstance('Frame', {
  840.                         Name = '',
  841.                         LayoutOrder = 1,
  842.                         BackgroundTransparency = 1,
  843.                         Size = UDim2.new(0, 0, 0, 0),
  844.                     }),
  845.                     newInstance('TextBox', {
  846.                         Name = 'Discord_ID',
  847.                         LayoutOrder = 2,
  848.                         BackgroundTransparency = 1,
  849.                         MaxVisibleGraphemes = 18,
  850.                         Size = UDim2.new(0, 210, 0, 14),
  851.                         ClearTextOnFocus = false,
  852.                         Text = '',
  853.                         TextSize = 14,
  854.                         TextColor3 = library.Settings.theme.TextColor,
  855.                         TextXAlignment = Enum.TextXAlignment.Left,
  856.                         TextTruncate = Enum.TextTruncate.AtEnd,
  857.                         Font = library.Settings.Elements_Font
  858.                     }, {
  859.                         newInstance('TextLabel', {
  860.                             Name = 'Title',
  861.                             BackgroundTransparency = 1,
  862.                             Size = UDim2.new(1, 0, 1, 0),
  863.                             TextColor3 = library.Settings.theme.LightContrast,
  864.                             RichText = true,
  865.                             Text = '<b>DISCORD ID</b>',
  866.                             TextSize = 14,
  867.                             Font = library.Settings.Elements_Font,
  868.                             TextXAlignment = Enum.TextXAlignment.Left
  869.                         }),
  870.                         newInstance('Frame', {
  871.                             Name = 'Bar',
  872.                             BackgroundColor3 = library.Settings.theme.LightContrast,
  873.                             AnchorPoint = Vector2.new(0, 1),
  874.                             Position = UDim2.new(0, 0, 1, 3),
  875.                             Size = UDim2.new(1, 0, 0, 2),
  876.                         }, {}, UDim.new(1, 0)),
  877.                     }),
  878.                     newInstance('ImageButton', {
  879.                         Name = 'CheckBox_Frame',
  880.                         LayoutOrder = 3,
  881.                         AutoButtonColor = false,
  882.                         BackgroundTransparency = 1,
  883.                         Size = UDim2.new(0, 210, 0, 20),
  884.                     }, {
  885.                         newInstance('Frame', {
  886.                             Name = 'CheckBox',
  887.                             BackgroundColor3 = library.Settings.theme.DarkContrast,
  888.                             Rotation = 45,
  889.                             Size = UDim2.new(0, 20, 0, 20),
  890.                             Position = UDim2.new(0, 0, 0.5, 0),
  891.                             AnchorPoint = Vector2.new(0, 0.5),
  892.                         }, {
  893.                             newInstance('Frame', {
  894.                                 Name = 'Check',
  895.                                 BackgroundColor3 = Color3.new(1, 1, 1),
  896.                                 BackgroundTransparency = 1,
  897.                                 Size = UDim2.new(1, 0, 1, 0),
  898.                             }, {
  899.                                 newInstance('UIGradient', {
  900.                                     Color = ColorSequence.new{
  901.                                         ColorSequenceKeypoint.new(0, Color3.fromRGB(66, 3, 240)),
  902.                                         ColorSequenceKeypoint.new(1, Color3.fromRGB(138, 42, 227))
  903.                                     },
  904.                                     Rotation = -45
  905.                                 })
  906.                             }, UDim.new(0, 8))
  907.                         }, UDim.new(0, 8)),
  908.                         newInstance('TextLabel', {
  909.                             BackgroundTransparency = 1,
  910.                             Size = UDim2.new(0, getTextSize('Remember me', 14, library.Settings.Elements_Font).X + 5, 0, 14),
  911.                             Position = UDim2.new(0, 30, 0.5, 0),
  912.                             AnchorPoint = Vector2.new(0, 0.5),
  913.                             RichText = true,
  914.                             Text = '<b>Remember me</b>',
  915.                             TextSize = 14,
  916.                             TextColor3 = library.Settings.theme.PlaceHolderColor,
  917.                             TextTransparency = 0.1,
  918.                             TextXAlignment = Enum.TextXAlignment.Left,
  919.                             Font = library.Settings.Elements_Font
  920.                         }),
  921.                     }),
  922.                     newInstance('TextButton', {
  923.                         LayoutOrder = 4,
  924.                         AutoButtonColor = false,
  925.                         BackgroundColor3 = Color3.new(1, 1, 1),
  926.                         Size = UDim2.new(0, 100, 0, 26),
  927.                         Text = '',
  928.                         ClipsDescendants = true
  929.                     }, {
  930.                         newInstance('UIGradient', {
  931.                             Color = ColorSequence.new{
  932.                                 ColorSequenceKeypoint.new(0, Color3.fromRGB(40, 53, 221)),
  933.                                 ColorSequenceKeypoint.new(1, Color3.fromRGB(3, 156, 251))
  934.                             },
  935.                         }),
  936.                         newInstance('TextLabel', {
  937.                             Name = 'Title',
  938.                             BackgroundTransparency = 1,
  939.                             Size = UDim2.new(1, 0, 1, 0),
  940.                             Text = '<b>LOGIN</b>',
  941.                             RichText = true,
  942.                             TextColor3 = library.Settings.theme.TextColor,
  943.                             TextSize = 14,
  944.                             Font = library.Settings.Elements_Font
  945.                         }),
  946.                     }, UDim.new(0, 8)),
  947.                 }),
  948.                 newInstance('Frame', {
  949.                     Name = 'Container',
  950.                     BackgroundTransparency = 1,
  951.                     Size = UDim2.new(1, 0, 1, 0),
  952.                     Visible = false
  953.                 }, {
  954.                     newInstance('Frame', {
  955.                         Name = 'Top_Frame',
  956.                         Size = UDim2.new(1, 0, 0, 35),
  957.                         BackgroundTransparency = 1,
  958.                     }, {
  959.                         newInstance("UIPadding", {
  960.                             PaddingLeft = UDim.new(0, 15)
  961.                         }),
  962.                         newInstance('UIListLayout', {
  963.                             VerticalAlignment = Enum.VerticalAlignment.Center,
  964.                             HorizontalAlignment = Enum.HorizontalAlignment.Left,
  965.                             FillDirection = Enum.FillDirection.Horizontal,
  966.                             Padding = UDim.new(0, 10),
  967.                             SortOrder = Enum.SortOrder.LayoutOrder
  968.                         }),
  969.                         newInstance('Frame', {
  970.                             Name = 'Title_Frame',
  971.                             Size = UDim2.new(0, 150, 1, 0),
  972.                             BackgroundTransparency = 1,
  973.                             LayoutOrder = 0,
  974.                         }, {
  975.                             newInstance('UIListLayout', {
  976.                                 VerticalAlignment = Enum.VerticalAlignment.Center,
  977.                                 HorizontalAlignment = Enum.HorizontalAlignment.Left,
  978.                                 FillDirection = Enum.FillDirection.Horizontal,
  979.                                 Padding = UDim.new(0, 10),
  980.                                 SortOrder = Enum.SortOrder.LayoutOrder
  981.                             }),
  982.                             newInstance('ImageButton', {
  983.                                 Name = 'Logo',
  984.                                 Size = UDim2.new(0, 25, 0, 25),
  985.                                 AutoButtonColor = false,
  986.                                 BackgroundTransparency = 1,
  987.                                 Image = 'rbxassetid://7733678388',
  988.                                 ImageColor3 = Color3.new(1, 1, 1),
  989.                             }, {
  990.                                 newInstance('UIGradient', {
  991.                                     Color = ColorSequence.new{
  992.                                         ColorSequenceKeypoint.new(0, Color3.fromRGB(254, 116, 13)),
  993.                                         ColorSequenceKeypoint.new(1, Color3.fromRGB(234, 12, 50))
  994.                                     }
  995.                                 })
  996.                             }),
  997.                             newInstance('TextLabel', {
  998.                                 Name = 'Title',
  999.                                 LayoutOrder = 1,
  1000.                                 BackgroundTransparency = 1,
  1001.                                 Size = UDim2.new(0, 110, 1, 0),
  1002.                                 Text = '<b>' .. game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Name .. '</b>',
  1003.                                 RichText = true,
  1004.                                 TextColor3 = library.Settings.theme.TextColor,
  1005.                                 TextXAlignment = Enum.TextXAlignment.Left,
  1006.                                 TextTruncate = Enum.TextTruncate.AtEnd,
  1007.                                 TextSize = 18,
  1008.                                 Font = library.Settings.Elements_Font
  1009.                             }),
  1010.                         }),
  1011.                         newInstance('Frame', {
  1012.                             Name = 'Search_Frame',
  1013.                             Size = UDim2.new(0, 300, 0, 25),
  1014.                             BackgroundTransparency = 1,
  1015.                             Visible = not library.IsMobile,
  1016.                             LayoutOrder = 1,
  1017.                         }, {
  1018.                             newInstance('UIPadding', {
  1019.                                 PaddingLeft = UDim.new(0, 15)
  1020.                             }),
  1021.                             newInstance('TextBox', {
  1022.                                 BackgroundTransparency = 1,
  1023.                                 ClearTextOnFocus = true,
  1024.                                 Size = UDim2.new(1, 0, 1, 0),
  1025.                                 Text = '',
  1026.                                 TextSize = 14,
  1027.                                 TextColor3 = library.Settings.theme.TextColor,
  1028.                                 PlaceholderColor3 = library.Settings.theme.PlaceHolderColor,
  1029.                                 PlaceholderText = 'Search...',
  1030.                                 TextXAlignment = Enum.TextXAlignment.Left,
  1031.                                 TextTruncate = Enum.TextTruncate.AtEnd,
  1032.                                 Font = library.Settings.Elements_Font
  1033.                             }, {
  1034.                                 newInstance('Frame', {
  1035.                                     Name = 'Bar',
  1036.                                     BackgroundColor3 = library.Settings.theme.LightContrast,
  1037.                                     Size = UDim2.new(1, 0, 0, 2),
  1038.                                     AnchorPoint = Vector2.new(0, 1),
  1039.                                     Position = UDim2.new(0, 0, 1, -2),
  1040.                                 }, {}, UDim.new(1, 0)),
  1041.                             }),
  1042.                         }),
  1043.                         newInstance('ImageButton', {
  1044.                             Name = 'Search_Button',
  1045.                             AutoButtonColor = false,
  1046.                             Size = UDim2.new(0, 25, 0, 25),
  1047.                             BackgroundColor3 = library.Settings.theme.DarkContrast,
  1048.                             LayoutOrder = 2,
  1049.                         }, {
  1050.                             newInstance('ImageLabel', {
  1051.                                 Size = UDim2.new(0, 15, 0, 15),
  1052.                                 BackgroundTransparency = 1,
  1053.                                 Position = UDim2.new(0.5, 0, 0.5, 0),
  1054.                                 AnchorPoint = Vector2.new(0.5, 0.5),
  1055.                                 Image = 'rbxassetid://7072721559',
  1056.                                 ImageColor3 = library.Settings.theme.TextColor,
  1057.                             })
  1058.                         }, UDim.new(0, 5)),
  1059.                     }),
  1060.                     newInstance('Frame', {
  1061.                         Name = 'Left_Frame',
  1062.                         Size = UDim2.new(0, 55, 1, -35),
  1063.                         Position = UDim2.new(0, 0, 1, 0),
  1064.                         AnchorPoint = Vector2.new(0, 1),
  1065.                         BackgroundTransparency = 1,
  1066.                     }, {
  1067.                         newInstance("UIPadding", {
  1068.                             PaddingTop = UDim.new(0, 10),
  1069.                             PaddingLeft = UDim.new(0, 10),
  1070.                             PaddingRight = UDim.new(0, 10)
  1071.                         }),
  1072.                         newInstance('UIListLayout', {
  1073.                             VerticalAlignment = Enum.VerticalAlignment.Top,
  1074.                             HorizontalAlignment = Enum.HorizontalAlignment.Center,
  1075.                             FillDirection = Enum.FillDirection.Vertical,
  1076.                             Padding = UDim.new(0, 10),
  1077.                             SortOrder = Enum.SortOrder.LayoutOrder
  1078.                         }),
  1079.                     }),
  1080.                     newInstance('Frame', {
  1081.                         Name = 'Center_Frame',
  1082.                         Size = UDim2.new(1, -55, 1, -35),
  1083.                         Position = UDim2.new(1, 0, 1, 0),
  1084.                         AnchorPoint = Vector2.new(1, 1),
  1085.                         BackgroundColor3 = library.Settings.theme.DarkContrast,
  1086.                     }, {
  1087.                         newInstance('Frame', {
  1088.                             Name = '',
  1089.                             Size = UDim2.new(0, 30, 0, 30),
  1090.                             Position = UDim2.new(1, 0, 0, 0),
  1091.                             AnchorPoint = Vector2.new(1, 0),
  1092.                             BorderSizePixel = 0,
  1093.                             BackgroundColor3 = library.Settings.theme.DarkContrast,
  1094.                         }),
  1095.                         newInstance('Frame', {
  1096.                             Name = '',
  1097.                             Size = UDim2.new(0, 30, 0, 30),
  1098.                             Position = UDim2.new(0, 0, 1, 0),
  1099.                             AnchorPoint = Vector2.new(0, 1),
  1100.                             BorderSizePixel = 0,
  1101.                             BackgroundColor3 = library.Settings.theme.DarkContrast,
  1102.                         }),
  1103.                         newInstance('ImageButton', {
  1104.                             Name = 'Resize_Button',
  1105.                             AutoButtonColor = false,
  1106.                             BackgroundTransparency = 1,
  1107.                             Size = UDim2.new(0, 15, 0, 15),
  1108.                             Position = UDim2.new(1, -5, 1, -5),
  1109.                             AnchorPoint = Vector2.new(1, 1),
  1110.                             Image = 'rbxassetid://7734013178',
  1111.                             ImageColor3 = library.Settings.theme.Inactive,
  1112.                             ZIndex = 2,
  1113.                         }),
  1114.                         newInstance('ScrollingFrame', {
  1115.                             Name = 'Section_Container',
  1116.                             ClipsDescendants = true,
  1117.                             ScrollingEnabled = false,
  1118.                             Size = UDim2.new(1, -15, 1, -15),
  1119.                             Position = UDim2.new(0.5, 0, 0.5, 0),
  1120.                             AnchorPoint = Vector2.new(0.5, 0.5),
  1121.                             BackgroundTransparency = 1,
  1122.                             BorderSizePixel = 0,
  1123.                             ScrollBarThickness = 0,
  1124.                             ScrollingDirection = Enum.ScrollingDirection.X,
  1125.                             CanvasSize = UDim2.new(0, 0, 0, 0),
  1126.                         }, {
  1127.                             newInstance('UIGridLayout', {
  1128.                                 CellPadding = UDim2.new(0, 0, 0, 10),
  1129.                                 FillDirection = Enum.FillDirection.Horizontal,
  1130.                                 FillDirectionMaxCells = 1,
  1131.                                 HorizontalAlignment = Enum.HorizontalAlignment.Center,
  1132.                                 VerticalAlignment = Enum.VerticalAlignment.Top
  1133.                             }),
  1134.                         }),
  1135.                     }, UDim.new(0, 8)),
  1136.                 })
  1137.             }, UDim.new(0, 15)),
  1138.             newInstance('Frame', {
  1139.                 Name = 'Notifications_Container',
  1140.                 ClipsDescendants = true,
  1141.                 Size = UDim2.new(0, 350, 1, 0),
  1142.                 Position = UDim2.new(0, 0, 1, 0),
  1143.                 AnchorPoint = Vector2.new(0, 1),
  1144.                 BackgroundTransparency = 1,
  1145.             }, {
  1146.                 newInstance("UIPadding", {
  1147.                     PaddingBottom = UDim.new(0, 10),
  1148.                     PaddingRight = UDim.new(0, 10),
  1149.                     PaddingLeft = UDim.new(0, 10),
  1150.                 }),
  1151.             })
  1152.         })
  1153.  
  1154.         local Notification_Types = {
  1155.             "Success",
  1156.             "Error",
  1157.             "Warning",
  1158.             "Info",
  1159.         }
  1160.         local function Notification(type, title, message, time)
  1161.             local frame = newInstance('Frame', {
  1162.                 Name = 'Notification',
  1163.                 Parent = UI.Notifications_Container,
  1164.                 BackgroundColor3 = library.Settings.theme.Background,
  1165.                 Position = UDim2.new(0, 0, 1, 0),
  1166.                 AnchorPoint = Vector2.new(0, 1),
  1167.                 Size = UDim2.new(1, 0, 0, 42),
  1168.                 Visible = false
  1169.             }, {
  1170.                 newInstance('Frame', {
  1171.                     Name = 'Content',
  1172.                     Size = UDim2.new(1, 0, 1, -4),
  1173.                     BackgroundTransparency = 1
  1174.                 }, {
  1175.                     newInstance('UIPadding', {
  1176.                         PaddingLeft = UDim.new(0, 5),
  1177.                         PaddingRight = UDim.new(0, 5),
  1178.                         PaddingTop = UDim.new(0, 5),
  1179.                     }),
  1180.                     newInstance('UIListLayout', {
  1181.                         Padding = UDim.new(0, 0),
  1182.                         FillDirection = Enum.FillDirection.Vertical,
  1183.                         VerticalAlignment = Enum.VerticalAlignment.Top,
  1184.                         SortOrder = Enum.SortOrder.LayoutOrder
  1185.                     }),
  1186.                     newInstance('TextLabel', {
  1187.                         Name = 'Title',
  1188.                         Size = UDim2.new(1, 0, 0, 14),
  1189.                         BackgroundTransparency = 1,
  1190.                         Text = '<b><u>' .. (title and string.len(title) > 0 and title or 'Notification Title') .. '</u></b>',
  1191.                         Font = library.Settings.Elements_Font,
  1192.                         RichText = true,
  1193.                         TextSize = 14,
  1194.                         TextColor3 = library.Settings.theme.TextColor,
  1195.                         TextXAlignment = Enum.TextXAlignment.Left,
  1196.                         LayoutOrder = 0
  1197.                     }),
  1198.                     newInstance('TextLabel', {
  1199.                         Name = 'Description',
  1200.                         Size = UDim2.new(1, 0, 0, 14),
  1201.                         BackgroundTransparency = 1,
  1202.                         Font = library.Settings.Elements_Font,
  1203.                         LineHeight = 0.8,
  1204.                         RichText = true,
  1205.                         TextWrapped = true,
  1206.                         TextSize = 14,
  1207.                         TextColor3 = library.Settings.theme.PlaceHolderColor,
  1208.                         TextXAlignment = Enum.TextXAlignment.Left,
  1209.                         TextYAlignment = Enum.TextYAlignment.Top,
  1210.                         LayoutOrder = 1
  1211.                     }),
  1212.                 }),
  1213.                 newInstance('Frame', {
  1214.                     Name = 'Bar',
  1215.                     Size = UDim2.new(1, 0, 0, 4),
  1216.                     Position = UDim2.new(0, 0, 1, 0),
  1217.                     AnchorPoint = Vector2.new(0, 1),
  1218.                     BackgroundColor3 = library.Settings.theme[typeof(type) == "string" and type or Notification_Types[type]],
  1219.                     BorderSizePixel = 0
  1220.                 }, {}, UDim.new(0, 5))
  1221.             }, UDim.new(0, 5))
  1222.  
  1223.             local text = (message and string.len(message) > 0 and message or 'Description')
  1224.             for i = 1, text:len() do
  1225.                 frame.Content.Description.Text = text:sub(1, i)
  1226.                 frame.Content.Description.Size = UDim2.new(1, 0, 0, frame.Content.Description.TextBounds.Y)
  1227.             end
  1228.             frame.Size = UDim2.new(1, 0, 0, 28 + frame.Content.Description.AbsoluteSize.Y)
  1229.  
  1230.             table.insert(library.notifications, frame)
  1231.  
  1232.             table.insert(library.connections, frame.Destroying:connect(function()
  1233.                 for i, v in pairs(library.notifications) do
  1234.                     pcall(function()
  1235.                         if i == 1 then
  1236.                             v.Position = UDim2.new(0, 0, 1, 0)
  1237.                         else
  1238.                             v.Position = library.notifications[i - 1].Position - UDim2.new(0, 0, 0, library.notifications[i - 1].AbsoluteSize.Y + 10)
  1239.                         end
  1240.                     end)
  1241.                 end
  1242.             end))
  1243.             task.spawn(function()
  1244.                 if #library.notifications == 1 then
  1245.                     frame.Visible = true
  1246.                     Tween(frame.Bar, { Size = UDim2.new(0, 0, 0, 4) }, time or 5).Completed:Wait()
  1247.                     Tween(frame, { Position = frame.Position + UDim2.new(0, 0, 0, frame.AbsoluteSize.Y) }, 0.2).Completed:Wait()
  1248.                     table.remove(library.notifications, table.find(library.notifications, frame))
  1249.                     frame:Destroy()
  1250.                 else
  1251.                     if table.find(library.notifications, frame) > library.Settings.Notifications_Max then
  1252.                         repeat
  1253.                             task.wait()
  1254.                         until table.find(library.notifications, frame) <= library.Settings.Notifications_Max
  1255.                     end
  1256.                     local notification_pos = table.find(library.notifications, frame)
  1257.  
  1258.                     if notification_pos == 1 then
  1259.                         frame.Position = UDim2.new(0, 0, 1, 0)
  1260.                     else
  1261.                         frame.Position = library.notifications[notification_pos - 1].Position - UDim2.new(0, 0, 0, library.notifications[notification_pos - 1].AbsoluteSize.Y + 10)
  1262.                     end
  1263.  
  1264.                     frame.Visible = true
  1265.                     Tween(frame.Bar, { Size = UDim2.new(0, 0, 0, 4) }, time or 5).Completed:Wait()
  1266.                     Tween(frame, { Position = frame.Position + UDim2.new(0, 0, 0, frame.AbsoluteSize.Y) }, 0.2).Completed:Wait()
  1267.                     table.remove(library.notifications, table.find(library.notifications, frame))
  1268.                     frame:Destroy()
  1269.                 end
  1270.             end)
  1271.         end
  1272.  
  1273.         local lib = setmetatable({
  1274.             Enabled = true,
  1275.             container = UI,
  1276.             pageContainer = UI.Frame.Container.Left_Frame,
  1277.             sectionContainer = UI.Frame.Container.Center_Frame.Section_Container,
  1278.             pages = {},
  1279.             Notification = Notification
  1280.         }, library)
  1281.  
  1282.         table.insert(library.connections, UI.Destroying:Connect(function()
  1283.             lib:close()
  1284.         end))
  1285.  
  1286.         local discord_toggling = false
  1287.         UI.Frame.Login.ImageLabel.Frame.Circle.Switch_Button.MouseButton1Click:Connect(function()
  1288.             if discord_toggling then return end
  1289.             discord_toggling = true
  1290.  
  1291.             Tween(UI.Frame.Login.ImageLabel.Frame.Circle.Switch_Button, { Rotation = (UI.Frame.Login.ImageLabel.Frame.Circle.Switch_Button.Rotation == 180 and 0) or 180 }, 0.2)
  1292.             Tween(UI.Frame.Login.ImageLabel.ImageLabel, { ImageTransparency = (UI.Frame.Login.ImageLabel.ImageLabel.ImageTransparency == 0 and 1) or 0 }, 0.2)
  1293.             Tween(UI.Frame.Login.ImageLabel.Frame, { Position = (UI.Frame.Login.ImageLabel.Frame.Position == UDim2.new(1, 330, 0.5, 0) and UDim2.new(1, 0, 0.5, 0)) or UDim2.new(1, 330, 0.5, 0) }, 0.2).Completed:Wait()
  1294.  
  1295.             discord_toggling = false
  1296.         end)
  1297.         local Join_toggling = false
  1298.         UI.Frame.Login.ImageLabel.Frame.Container.TextButton.MouseButton1Click:Connect(function()
  1299.             if Join_toggling then return end
  1300.             Join_toggling = true
  1301.  
  1302.             rippleEffect(UI.Frame.Login.ImageLabel.Frame.Container.TextButton, 0.5)
  1303.             Tween(UI.Frame.Login.ImageLabel.Frame.Container.TextButton, { BackgroundColor3 = library.Settings.theme.LightContrast }, 0.2)
  1304.  
  1305.             local req = (syn and syn.request) or (http and http.request) or http_request
  1306.             for i = 6453, 6464 do wait()
  1307.                 spawn(function()
  1308.                     local success, _ = pcall(function()
  1309.                         req({
  1310.                             Url = "http://127.0.0.1:" .. tostring(i) .. "/rpc?v=1",
  1311.                             Method = "POST",
  1312.                             Headers = {
  1313.                                 ["Content-Type"] = "application/json",
  1314.                                 ["Origin"] = "https://discord.com"
  1315.                             },
  1316.                             Body = game:GetService("HttpService"):JSONEncode({
  1317.                                 ["cmd"] = "INVITE_BROWSER",
  1318.                                 ["nonce"] = game:GetService("HttpService"):GenerateGUID(false),
  1319.                                 ["args"] = {
  1320.                                     ["invite"] = {
  1321.                                         ["code"] = 'PremierX'
  1322.                                     },
  1323.                                     ["code"] = 'PremierX'
  1324.                                 }
  1325.                             })
  1326.                         })
  1327.                     end)
  1328.                     if not success then
  1329.                         Notification(4, 'Discord', 'The invitation link has been copied to your clipboard.')
  1330.                         setclipboard('https://discord.gg/PremierX')
  1331.                     end
  1332.                 end)
  1333.             end
  1334.  
  1335.             Tween(UI.Frame.Login.ImageLabel.Frame.Container.TextButton, { BackgroundColor3 = Color3.new(1, 1, 1) }, 0.2)
  1336.             Join_toggling = false
  1337.         end)
  1338.  
  1339.         UI.Frame.Login.Discord_ID.Focused:Connect(function()
  1340.             Tween(UI.Frame.Login.Discord_ID.Bar, { BackgroundColor3 = library.Settings.theme.TextColor }, 0.2)
  1341.             Tween(UI.Frame.Login.Discord_ID.Title, { TextColor3 = library.Settings.theme.TextColor }, 0.2)
  1342.             Tween(UI.Frame.Login.Discord_ID.Title, { Position = UDim2.new(0, 0, -1, -2), AnchorPoint = Vector2.new(0, -1) }, 0.2)
  1343.         end)
  1344.         UI.Frame.Login.Discord_ID.FocusLost:Connect(function()
  1345.             Tween(UI.Frame.Login.Discord_ID.Bar, { BackgroundColor3 = library.Settings.theme.LightContrast }, 0.2)
  1346.             Tween(UI.Frame.Login.Discord_ID.Title, { TextColor3 = library.Settings.theme.LightContrast }, 0.2)
  1347.             if UI.Frame.Login.Discord_ID.Text == "" then
  1348.                 Tween(UI.Frame.Login.Discord_ID.Title, { Position = UDim2.new(0, 0, 0, 0), AnchorPoint = Vector2.new(0, 0) }, 0.2)
  1349.             end
  1350.         end)
  1351.         UI.Frame.Login.Discord_ID:GetPropertyChangedSignal("Text"):Connect(function()
  1352.             UI.Frame.Login.Discord_ID.Text = UI.Frame.Login.Discord_ID.Text:gsub('%D+', ''):sub(0, 18)
  1353.         end)
  1354.  
  1355.         local CheckBox_Toggling = false
  1356.         local CheckBox_Enabled = false
  1357.         UI.Frame.Login.CheckBox_Frame.MouseButton1Click:Connect(function()
  1358.             if CheckBox_Toggling then return end
  1359.             CheckBox_Toggling = true
  1360.  
  1361.             if CheckBox_Enabled then
  1362.                 Tween(UI.Frame.Login.CheckBox_Frame.CheckBox.Check, { BackgroundTransparency = 1 }, 0.3).Completed:Wait()
  1363.             else
  1364.                 Tween(UI.Frame.Login.CheckBox_Frame.CheckBox.Check, { BackgroundTransparency = 0 }, 0.2).Completed:Wait()
  1365.             end
  1366.  
  1367.             CheckBox_Enabled = not CheckBox_Enabled
  1368.             CheckBox_Toggling = false
  1369.         end)
  1370.  
  1371.         local Login_Toggling = false
  1372.         UI.Frame.Login.TextButton.MouseButton1Click:Connect(function()
  1373.             if Login_Toggling then return end
  1374.             Login_Toggling = true
  1375.  
  1376.             rippleEffect(UI.Frame.Login.TextButton, 0.5)
  1377.             Tween(UI.Frame.Login.TextButton, { BackgroundColor3 = library.Settings.theme.LightContrast }, 0.2)
  1378.  
  1379.             if #UI.Frame.Login.Discord_ID.Text < 17 then
  1380.                 Tween(UI.Frame.Login.Discord_ID.Bar, { BackgroundColor3 = Color3.fromRGB(211, 86, 98) }, 0.2)
  1381.                 Notification(2, 'Login System', 'The discord id entered is invalid.')
  1382.                 task.wait(0.1)
  1383.                 Tween(UI.Frame.Login.TextButton, { BackgroundColor3 = Color3.new(1, 1, 1) }, 0.2)
  1384.                 Login_Toggling = false
  1385.             else
  1386.                 local function login()
  1387.                     Tween(UI.Frame.Login.TextButton, { BackgroundColor3 = Color3.new(1, 1, 1) }, 0.2)
  1388.                     Login_Toggling = false
  1389.  
  1390.                     local effect_time = 0.4
  1391.                     for _, v in pairs(UI.Frame.Login:GetDescendants()) do
  1392.                         local a, _ = pcall(function()
  1393.                             return v.BackgroundTransparency
  1394.                         end)
  1395.                         local a2, _ = pcall(function()
  1396.                             return v.ImageTransparency
  1397.                         end)
  1398.                         local a3, _ = pcall(function()
  1399.                             return v.TextTransparency
  1400.                         end)
  1401.                         if a then
  1402.                             local tween = Tween(v, { BackgroundTransparency = 1 }, effect_time)
  1403.                             task.spawn(function()
  1404.                                 tween.Completed:Wait()
  1405.                                 pcall(function()
  1406.                                     v:Destroy()
  1407.                                 end)
  1408.                             end)
  1409.                         end
  1410.                         if a2 then
  1411.                             local tween = Tween(v, { ImageTransparency = 1 }, effect_time)
  1412.                             task.spawn(function()
  1413.                                 tween.Completed:Wait()
  1414.                                 pcall(function()
  1415.                                     v:Destroy()
  1416.                                 end)
  1417.                             end)
  1418.                         end
  1419.                         if a3 then
  1420.                             local tween = Tween(v, { TextTransparency = 1 }, effect_time)
  1421.                             task.spawn(function()
  1422.                                 tween.Completed:Wait()
  1423.                                 pcall(function()
  1424.                                     v:Destroy()
  1425.                                 end)
  1426.                             end)
  1427.                         end
  1428.                     end
  1429.                     task.wait(effect_time/2)
  1430.                     Tween(UI.Frame, { Size = UDim2.new(0, 650, 0, 380) }, effect_time/2).Completed:Wait()
  1431.                     UI.Frame.Container.Center_Frame.Section_Container.UIGridLayout.CellSize = UDim2.new(0, UI.Frame.Container.Center_Frame.Section_Container.AbsoluteSize.X, 0, UI.Frame.Container.Center_Frame.Section_Container.AbsoluteSize.Y)
  1432.  
  1433.                     UI.Frame.Login:Destroy()
  1434.  
  1435.                     UI.Frame.Container.Visible = true
  1436.  
  1437.                     draggingInstance(UI.Frame)
  1438.                     Resizable(UI.Frame, UI.Frame.Container.Center_Frame.Resize_Button)
  1439.                 end
  1440.  
  1441.                 local user = Discord.FindUser(UI.Frame.Login.Discord_ID.Text, Discord.Server)
  1442.  
  1443.                 local server_roles = discord_server.roles
  1444.                 for _, v in pairs(user.roles) do
  1445.                     for _, role in pairs(server_roles) do
  1446.                         if role.id == v then
  1447.                             print(role.name, role.position)
  1448.                             break
  1449.                         end
  1450.                     end
  1451.                 end
  1452.                 if user then
  1453.                     if CheckBox_Enabled then
  1454.                         writefile('Premier UI/discord_id.lua', UI.Frame.Login.Discord_ID.Text)
  1455.                     else
  1456.                         if isfile('Premier UI/discord_id.lua') then
  1457.                             delfile('Premier UI/discord_id.lua')
  1458.                         end
  1459.                     end
  1460.                     local account = MongoDB:Find('accounts', {
  1461.                         discord_id = UI.Frame.Login.Discord_ID.Text,
  1462.                         hwid = game:GetService("RbxAnalyticsService"):GetClientId()
  1463.                     })
  1464.                     if account then
  1465.                         login()
  1466.                         if user.nick then
  1467.                             local new_nick = ''
  1468.                             for _, v in pairs(string.split(user.nick, '')) do
  1469.                                 if string.byte(v) >= 32 or string.byte(v) <= 136 then
  1470.                                     new_nick = new_nick .. v
  1471.                                 end
  1472.                             end
  1473.                             user.nick = new_nick
  1474.                         end
  1475.                         local new_username = ''
  1476.                         for _, v in pairs(string.split(user.user.username, '')) do
  1477.                             if string.byte(v) >= 32 or string.byte(v) <= 136 then
  1478.                                 new_username = new_username .. v
  1479.                             end
  1480.                         end
  1481.                         user.user.username = new_username
  1482.                         Notification(1, 'Login System', 'Welcome back ' .. (user.nick and (user.nick .. ' - ') or '') .. user.user.username .. '#' .. user.user.discriminator)
  1483.                         return
  1484.                     end
  1485.  
  1486.                     local count = MongoDB:Find('attempts', {
  1487.                         discord_id = UI.Frame.Login.Discord_ID.Text,
  1488.                         hwid = game:GetService("RbxAnalyticsService"):GetClientId()
  1489.                     })
  1490.  
  1491.                     if count and count.attempts >= 3 then
  1492.                         Notification(2, 'Login System', 'You have exceeded the number of attempts to try to link the account with id <font color="#' .. library.Settings.theme.Error:ToHex() .. '">' .. UI.Frame.Login.Discord_ID.Text .. '</font> and have been blocked.')
  1493.                         Tween(UI.Frame.Login.TextButton, { BackgroundColor3 = Color3.new(1, 1, 1) }, 0.2)
  1494.                         Login_Toggling = false
  1495.                         return
  1496.                     end
  1497.  
  1498.                     if MongoDB:Find('accounts', {
  1499.                         discord_id = UI.Frame.Login.Discord_ID.Text,
  1500.                         cooldown = true
  1501.                     }) then
  1502.                         Notification(3, 'Login System', 'This user has recently linked an account and has cooldown, please try again later. If you think this is an error, contact Premier administration.')
  1503.                         Tween(UI.Frame.Login.TextButton, { BackgroundColor3 = Color3.new(1, 1, 1) }, 0.2)
  1504.                         Login_Toggling = false
  1505.                         return
  1506.                     end
  1507.  
  1508.                     if MongoDB:Find('notifications', {
  1509.                         discord_id = UI.Frame.Login.Discord_ID.Text,
  1510.                         hwid = game:GetService("RbxAnalyticsService"):GetClientId(),
  1511.                     }) then
  1512.                         Notification(4, 'Login System', 'A verification message has already been sent, check dm.')
  1513.                     else
  1514.                         MongoDB:Insert('notifications', {
  1515.                             discord_id = UI.Frame.Login.Discord_ID.Text,
  1516.                             hwid = game:GetService("RbxAnalyticsService"):GetClientId(),
  1517.                             username = game.Players.LocalPlayer.Name,
  1518.                             notified = false
  1519.                         })
  1520.                         Notification(4, 'Login System', 'A verification message has been sent, check dm.')
  1521.                     end
  1522.  
  1523.                     task.spawn(function()
  1524.                         local seconds = 0
  1525.                         while seconds <= 120 do task.wait(1)
  1526.                             local account = MongoDB:Find('accounts', {
  1527.                                 discord_id = UI.Frame.Login.Discord_ID.Text,
  1528.                                 hwid = game:GetService("RbxAnalyticsService"):GetClientId()
  1529.                             })
  1530.                             if account then
  1531.                                 login()
  1532.                                 Notification(1, 'Login System', 'The account has been successfully verified.')
  1533.                                 break
  1534.                             end
  1535.                             seconds += 1
  1536.                         end
  1537.                     end)
  1538.  
  1539.                 else
  1540.                     Tween(UI.Frame.Login.Discord_ID.Bar, { BackgroundColor3 = Color3.fromRGB(211, 86, 98) }, 0.2)
  1541.                 end
  1542.             end
  1543.         end)
  1544.  
  1545.         local SideBar_Toggle = false
  1546.         local Logo_Toggling = false
  1547.         UI.Frame.Container.Top_Frame.Title_Frame.Logo.MouseButton1Click:Connect(function()
  1548.             if Logo_Toggling then return end
  1549.             Logo_Toggling = true
  1550.  
  1551.             rippleEffect(UI.Frame.Container.Top_Frame.Title_Frame.Logo, 0.5)
  1552.  
  1553.             Tween(UI.Frame.Container.Center_Frame, { Size = (SideBar_Toggle and UDim2.new(1, -55, 1, -35)) or UDim2.new(1, -185, 1, -35) }, 0.2)
  1554.             Tween(UI.Frame.Container.Left_Frame, { Size = (SideBar_Toggle and UDim2.new(0, 55, 1, -35)) or UDim2.new(0, 185, 1, -35) }, 0.2).Completed:Wait()
  1555.  
  1556.             SideBar_Toggle = not SideBar_Toggle
  1557.             Logo_Toggling = false
  1558.         end)
  1559.         UI.Frame.Container.Center_Frame:GetPropertyChangedSignal('AbsoluteSize'):Connect(function()
  1560.             pcall(function()
  1561.                 lib.focusedPage:Resize()
  1562.             end)
  1563.         end)
  1564.  
  1565.         UI.Frame.Container.Top_Frame.Search_Frame.TextBox.Focused:connect(function()
  1566.             Tween(UI.Frame.Container.Top_Frame.Search_Frame.TextBox.Bar, { BackgroundColor3 = library.Settings.theme.TextColor }, 0.2)
  1567.         end)
  1568.         UI.Frame.Container.Top_Frame.Search_Frame.TextBox.FocusLost:Connect(function()
  1569.             Tween(UI.Frame.Container.Top_Frame.Search_Frame.TextBox.Bar, { BackgroundColor3 = library.Settings.theme.LightContrast }, 0.2)
  1570.         end)
  1571.         UI.Frame.Container.Top_Frame.Search_Button.MouseButton1Click:Connect(function()
  1572.             rippleEffect(UI.Frame.Container.Top_Frame.Search_Button, 0.5)
  1573.         end)
  1574.  
  1575.         local Resize_Button_Pressing = false
  1576.         UI.Frame.Container.Center_Frame.Resize_Button.MouseEnter:Connect(function()
  1577.             Tween(UI.Frame.Container.Center_Frame.Resize_Button, { ImageColor3 = library.Settings.theme.TextColor }, 0.2)
  1578.         end)
  1579.         UI.Frame.Container.Center_Frame.Resize_Button.MouseLeave:Connect(function()
  1580.             if Resize_Button_Pressing then return end
  1581.             Tween(UI.Frame.Container.Center_Frame.Resize_Button, { ImageColor3 = library.Settings.theme.Inactive }, 0.2)
  1582.         end)
  1583.         UI.Frame.Container.Center_Frame.Resize_Button.InputBegan:connect(function(key)
  1584.             if key.UserInputType == Enum.UserInputType.MouseButton1 then
  1585.                 Resize_Button_Pressing = true
  1586.                 UI.Frame.Container.Center_Frame.Resize_Button.InputEnded:connect(function(key2)
  1587.                     if key == key2 then
  1588.                         Resize_Button_Pressing =  false
  1589.                         Tween(UI.Frame.Container.Center_Frame.Resize_Button, { ImageColor3 = library.Settings.theme.Inactive }, 0.2)
  1590.                     end
  1591.                 end)
  1592.             end
  1593.         end)
  1594.  
  1595.         if isfile('Premier UI/discord_id.lua') then
  1596.             CheckBox_Enabled = true
  1597.             UI.Frame.Login.CheckBox_Frame.CheckBox.Check.BackgroundTransparency = 0
  1598.  
  1599.             UI.Frame.Login.Discord_ID.Title.Position = UDim2.new(0, 0, -1, -2)
  1600.             UI.Frame.Login.Discord_ID.Title.AnchorPoint = Vector2.new(0, -1)
  1601.  
  1602.             UI.Frame.Login.Discord_ID.Text = readfile('Premier UI/discord_id.lua')
  1603.         end
  1604.  
  1605.         task.spawn(function()
  1606.             while true do task.wait(5)
  1607.                 local a, _ = pcall(function()
  1608.                     discord_server = Discord.FindGuild(Discord.Server)
  1609.  
  1610.                     UI.Frame.Login.ImageLabel.Frame.Container.Users_Counter.Size = UDim2.new(0, getTextSize(tostring(discord_server.approximate_member_count), 14, library.Settings.Elements_Font).X, 0, 14)
  1611.                     UI.Frame.Login.ImageLabel.Frame.Container.Users_Counter.Text = tostring(discord_server.approximate_member_count)
  1612.                     UI.Frame.Login.ImageLabel.Frame.Container.Users_Online_Icon.Position = UDim2.new(0, 37 + getTextSize(tostring(discord_server.approximate_member_count), 14, library.Settings.Elements_Font).X + 10, 0, 23)
  1613.                     UI.Frame.Login.ImageLabel.Frame.Container.Users_Online_Counter.Position = UDim2.new(0, 37 + getTextSize(tostring(discord_server.approximate_member_count), 14, library.Settings.Elements_Font).X + 10 + 18, 0, 24)
  1614.                     UI.Frame.Login.ImageLabel.Frame.Container.Users_Online_Counter.Text = '<b>' .. tostring(discord_server.approximate_presence_count) .. '</b>'
  1615.                 end)
  1616.                 if not a then
  1617.                     break
  1618.                 end
  1619.             end
  1620.         end)
  1621.  
  1622.         task.spawn(function()
  1623.             repeat task.wait() until lib.finish
  1624.             for i = 1, #AssetToLoad do
  1625.                 local Completed = false
  1626.                 game:GetService("ContentProvider"):PreloadAsync({ AssetToLoad[i] }, function()
  1627.                     Tween(UI.Frame.Loader.Bar.Fill, { Size = UDim2.new(i/#AssetToLoad, 0, 1, 0) }, 0.2)
  1628.                     Completed = true
  1629.                 end)
  1630.                 repeat task.wait() until Completed
  1631.             end
  1632.             repeat task.wait() until UI.Frame.Loader.Bar.Fill.Size == UDim2.new(1, 0, 1, 0)
  1633.  
  1634.             local effect_time = 0.4
  1635.             task.wait(effect_time)
  1636.             for _, v in pairs(UI.Frame.Loader:GetDescendants()) do
  1637.                 local a, _ = pcall(function()
  1638.                     return v.BackgroundTransparency
  1639.                 end)
  1640.                 local a2, _ = pcall(function()
  1641.                     return v.ImageTransparency
  1642.                 end)
  1643.                 local a3, _ = pcall(function()
  1644.                     return v.TextTransparency
  1645.                 end)
  1646.                 if a then
  1647.                     local tween = Tween(v, { BackgroundTransparency = 1 }, effect_time)
  1648.                     task.spawn(function()
  1649.                         tween.Completed:Wait()
  1650.                         pcall(function()
  1651.                             v:Destroy()
  1652.                         end)
  1653.                     end)
  1654.                 end
  1655.                 if a2 then
  1656.                     local tween = Tween(v, { ImageTransparency = 1 }, effect_time)
  1657.                     task.spawn(function()
  1658.                         tween.Completed:Wait()
  1659.                         pcall(function()
  1660.                             v:Destroy()
  1661.                         end)
  1662.                     end)
  1663.                 end
  1664.                 if a3 then
  1665.                     local tween = Tween(v, { TextTransparency = 1 }, effect_time)
  1666.                     task.spawn(function()
  1667.                         tween.Completed:Wait()
  1668.                         pcall(function()
  1669.                             v:Destroy()
  1670.                         end)
  1671.                     end)
  1672.                 end
  1673.             end
  1674.             task.wait(effect_time/2)
  1675.  
  1676.             Tween(UI.Frame.UICorner, { CornerRadius = UDim.new(0, 8) }, effect_time/2)
  1677.             Tween(UI.Frame, { Size = UDim2.new(0, 400, 0, 235) }, effect_time/2).Completed:Wait()
  1678.             UI.Frame.Loader:Destroy()
  1679.             UI.Frame.Login.Visible = true
  1680.  
  1681.             if #lib.pages > 0 then
  1682.                 local page = lib.pages[1]
  1683.                 Tween(page.button, { BackgroundTransparency = 0 }, 0.2)
  1684.                 Tween(page.button.Frame, { BackgroundTransparency = 0 }, 0.2)
  1685.                 Tween(page.button.Icon, { ImageColor3 = library.Settings.theme.PlaceHolderColor }, 0.2)
  1686.                 Tween(page.button.Title, { TextColor3 = library.Settings.theme.PlaceHolderColor }, 0.2)
  1687.  
  1688.                 lib.focusedPage = page
  1689.             end
  1690.         end)
  1691.  
  1692.         return lib
  1693.     end
  1694.     function library.page.new(config)
  1695.         config = config or {}
  1696.         local button = newInstance('ImageButton', {
  1697.             Name = betterFindIndex(config, 'title') or 'Page',
  1698.             Parent = betterFindIndex(config, 'library').pageContainer,
  1699.             Size = UDim2.new(1, 0, 0, 30),
  1700.             AutoButtonColor = false,
  1701.             BackgroundColor3 = library.Settings.theme.DarkContrast,
  1702.             BackgroundTransparency = 1,
  1703.         }, {
  1704.             newInstance('Frame', {
  1705.                 Size = UDim2.new(0, 2, 0, 20),
  1706.                 Position = UDim2.new(0, -1, 0.5, 0),
  1707.                 AnchorPoint = Vector2.new(0, 0.5),
  1708.                 BackgroundColor3 = Color3.new(1, 1, 1),
  1709.                 BackgroundTransparency = 1,
  1710.             }, {
  1711.                 newInstance('UIGradient', {
  1712.                     Color = ColorSequence.new{
  1713.                         ColorSequenceKeypoint.new(0, Color3.fromRGB(40, 53, 221)),
  1714.                         ColorSequenceKeypoint.new(1, Color3.fromRGB(3, 156, 251))
  1715.                     },
  1716.                     Rotation = 90
  1717.                 })
  1718.             }, UDim.new(1, 0)),
  1719.             newInstance('ImageLabel', {
  1720.                 Name = 'Icon',
  1721.                 Size = UDim2.new(0, 20, 0, 20),
  1722.                 Position = UDim2.new(0, 7.5, 0.5, 0),
  1723.                 AnchorPoint = Vector2.new(0, 0.5),
  1724.                 BackgroundTransparency = 1,
  1725.                 ImageColor3 = library.Settings.theme.LightContrast,
  1726.                 Image = betterFindIndex(config, 'icon') or 'rbxassetid://6034767621'
  1727.             }),
  1728.             newInstance('TextLabel', {
  1729.                 Name = 'Title',
  1730.                 Size = UDim2.new(1, -35, 1, 0),
  1731.                 Position = UDim2.new(0, 35, 0, 0),
  1732.                 ClipsDescendants = true,
  1733.                 BackgroundTransparency = 1,
  1734.                 Text = '<b>' .. (betterFindIndex(config, 'title') or 'Page Title') .. '</b>',
  1735.                 Font = library.Settings.Elements_Font,
  1736.                 RichText = true,
  1737.                 TextSize = 14,
  1738.                 TextColor3 = library.Settings.theme.LightContrast,
  1739.                 TextXAlignment = Enum.TextXAlignment.Left,
  1740.             }),
  1741.         }, UDim.new(0, 5))
  1742.  
  1743.         local container = newInstance('ScrollingFrame', {
  1744.             Name = betterFindIndex(config, 'title') or 'Container',
  1745.             Parent = betterFindIndex(config, 'library').sectionContainer,
  1746.             BackgroundTransparency = 1,
  1747.             BorderSizePixel = 0,
  1748.             ScrollBarThickness = 0,
  1749.             CanvasSize = UDim2.new(0, 0, 0, 0),
  1750.         }, {
  1751.             newInstance('UIListLayout', {
  1752.                 SortOrder = Enum.SortOrder.LayoutOrder,
  1753.                 Padding = UDim.new(0, 10),
  1754.             }),
  1755.             newInstance('UIPadding', {
  1756.                 PaddingTop = UDim.new(0, 5),
  1757.                 PaddingLeft = UDim.new(0, 5),
  1758.                 PaddingRight = UDim.new(0, 5),
  1759.                 PaddingBottom = UDim.new(0, 5),
  1760.             })
  1761.         })
  1762.  
  1763.         return setmetatable({
  1764.             library = betterFindIndex(config, 'library'),
  1765.             button = button,
  1766.             container = container,
  1767.             sections = {},
  1768.         }, library.page)
  1769.     end
  1770.     function library.section.new(config)
  1771.         config = config or {}
  1772.  
  1773.         local divisions = library.IsMobile and 1 or betterFindIndex(config, 'Divisions') or 1
  1774.  
  1775.         local container = newInstance('Frame', {
  1776.             Parent = betterFindIndex(config, 'page').container,
  1777.             BackgroundTransparency = 1,
  1778.             Size = UDim2.new(1, 0, 0, 30),
  1779.         }, {
  1780.             newInstance('UIListLayout', {
  1781.                 Padding = UDim.new(0, 5),
  1782.                 FillDirection = Enum.FillDirection.Horizontal,
  1783.             }),
  1784.         })
  1785.  
  1786.         local sections = {}
  1787.         for i = 1, divisions do
  1788.             local section = newInstance('Frame', {
  1789.                 Parent = container,
  1790.                 BackgroundColor3 = library.Settings.theme.Background,
  1791.                 Size = UDim2.new(1 / divisions, -(((5 * (divisions - 1)) / divisions) + 1), 0, 16),
  1792.                 ClipsDescendants = true
  1793.             }, {
  1794.                 newInstance('UIPadding', {
  1795.                     PaddingTop = UDim.new(0, 10),
  1796.                     PaddingLeft = UDim.new(0, 10),
  1797.                     PaddingRight = UDim.new(0, 10),
  1798.                     PaddingBottom = UDim.new(0, 10),
  1799.                 }),
  1800.                 newInstance('UIListLayout', {
  1801.                     SortOrder = Enum.SortOrder.LayoutOrder,
  1802.                     Padding = UDim.new(0, 4),
  1803.                 }),
  1804.                 newInstance('NumberValue', {
  1805.                     Name = 'Section',
  1806.                     Value = divisions,
  1807.                 }),
  1808.             }, UDim.new(0, 8))
  1809.             table.insert(sections, i, section)
  1810.         end
  1811.  
  1812.         return setmetatable({
  1813.             page = betterFindIndex(config, 'page'),
  1814.             parent = container,
  1815.             container = sections,
  1816.             colorpickers = {},
  1817.             modules = {},
  1818.             binds = {},
  1819.             lists = {},
  1820.         }, library.section)
  1821.     end
  1822.  
  1823.     function library:close()
  1824.         self.Enabled = false
  1825.         task.spawn(function()
  1826.             for _, func in pairs(library.end_funcs) do
  1827.                 func()
  1828.             end
  1829.         end)
  1830.     end
  1831.  
  1832.     function library:addPage(config)
  1833.         config = config or {}
  1834.         config.library = self
  1835.         local page = self.page.new(config)
  1836.  
  1837.         table.insert(self.pages, page)
  1838.         self.sectionContainer.CanvasSize = UDim2.new(0, 0, 0, (#self.pages - 1) * self.sectionContainer.AbsoluteSize.Y)
  1839.  
  1840.         page.button.MouseButton1Click:Connect(function()
  1841.             self:SelectPage(page, true)
  1842.         end)
  1843.         return page
  1844.     end
  1845.     function library.page:addSection(config)
  1846.         config = config or {}
  1847.         config.page = self
  1848.         local section = library.section.new(config)
  1849.  
  1850.         table.insert(self.sections, section)
  1851.  
  1852.         return section
  1853.     end
  1854.     function library.page:Resize()
  1855.         local size = (#self.sections - 1) * self.library.sectionContainer.UIGridLayout.CellPadding.Y.Offset
  1856.         self.library.sectionContainer.UIGridLayout.CellSize = UDim2.new(0, self.library.sectionContainer.AbsoluteSize.X, 0, self.library.sectionContainer.AbsoluteSize.Y)
  1857.  
  1858.         for i, section in pairs(self.sections) do
  1859.             section:Resize()
  1860.             size += section.parent.UIListLayout.AbsoluteContentSize.Y
  1861.         end
  1862.         for i, section in pairs(self.sections) do
  1863.             section:Resize()
  1864.         end
  1865.         self.container.CanvasSize = UDim2.new(0, 0, 0, size)
  1866.     end
  1867.  
  1868.     function library.section:Resize(smoth)
  1869.         local allSizes = {}
  1870.  
  1871.         local containerI = 0
  1872.         for i, v in pairs(self.container) do
  1873.             if v.ClassName == 'Frame' then
  1874.                 if v.Visible then
  1875.                     containerI += 1
  1876.                 end
  1877.             end
  1878.         end
  1879.         for i, v in pairs(self.container) do
  1880.             if v.ClassName == 'Frame' then
  1881.                 if v:FindFirstChild('Title_Element') and v:FindFirstChild('Title_Element').Toggle.Value then
  1882.                     if smoth then
  1883.                         Tween(v, { Size = UDim2.new(1 / containerI, -(((5 * (containerI - 1)) / containerI) + 1), 0, 34) }, 0.2)
  1884.                     else
  1885.                         v.Size = UDim2.new(1 / containerI, -(((5 * (containerI - 1)) / containerI) + 1), 0, 34)
  1886.                     end
  1887.                     table.insert(allSizes, i, 34)
  1888.                 else
  1889.                     local a = 16
  1890.                     for _, k in pairs(v:GetChildren()) do
  1891.                         if k.Name:match('_Element') or k.Name:match('_Module') then
  1892.                             if k.Visible then
  1893.                                 a += k.AbsoluteSize.Y + 4
  1894.                             end
  1895.                         end
  1896.                     end
  1897.                     if smoth then
  1898.                         Tween(v, { Size = UDim2.new(1 / containerI, -(((5 * (containerI - 1)) / containerI) + 1), 0, a) }, 0.2)
  1899.                     else
  1900.                         v.Size = UDim2.new(1 / containerI, -(((5 * (containerI - 1)) / containerI) + 1), 0, a)
  1901.                     end
  1902.                     table.insert(allSizes, i, a)
  1903.                 end
  1904.             end
  1905.         end
  1906.         if containerI == 0 then
  1907.             self.parent.Visible = false
  1908.             return
  1909.         else
  1910.             self.parent.Visible = true
  1911.         end
  1912.  
  1913.         local size = 0
  1914.         for i = 1, #allSizes do
  1915.             local a = allSizes[i]
  1916.             size = math.max(size, a)
  1917.         end
  1918.  
  1919.         Tween(self.parent, { Size = UDim2.new(1, 0, 0, size) }, 0)
  1920.     end
  1921.  
  1922.     function library:SelectPage(page, toggle)
  1923.         if toggle and self.focusedPage == page then
  1924.             return
  1925.         end
  1926.  
  1927.         if toggle then
  1928.             Tween(page.button, { BackgroundTransparency = 0 }, 0.2)
  1929.             Tween(page.button.Frame, { BackgroundTransparency = 0 }, 0.2)
  1930.             Tween(page.button.Icon, { ImageColor3 = library.Settings.theme.PlaceHolderColor }, 0.2)
  1931.             Tween(page.button.Title, { TextColor3 = library.Settings.theme.PlaceHolderColor }, 0.2)
  1932.             Tween(self.sectionContainer, { CanvasPosition = Vector2.new(0, ((table.find(self.pages, page) - 1) * self.sectionContainer.AbsoluteSize.Y) + ((table.find(self.pages, page) - 1) * self.sectionContainer.UIGridLayout.CellPadding.Y.Offset) ) }, 0.2)
  1933.  
  1934.             local focusedPage = self.focusedPage
  1935.             self.focusedPage = page
  1936.  
  1937.             if focusedPage then
  1938.                 self:SelectPage(focusedPage)
  1939.             end
  1940.             task.spawn(function()
  1941.                 page:Resize()
  1942.             end)
  1943.         else
  1944.             Tween(page.button.Frame, { BackgroundTransparency = 1 }, 0.2)
  1945.             Tween(page.button, { BackgroundTransparency = 1 }, 0.2)
  1946.             Tween(page.button.Icon, { ImageColor3 = library.Settings.theme.LightContrast }, 0.2)
  1947.             Tween(page.button.Title, { TextColor3 = library.Settings.theme.LightContrast }, 0.2)
  1948.             if page == self.focusedPage then
  1949.                 self.focusedPage = nil
  1950.             end
  1951.         end
  1952.     end
  1953.  
  1954.     function library.section:addTitle(config)
  1955.         config = config or {}
  1956.  
  1957.         local parent = (betterFindIndex(config, 'section') or 1) > #self.container and self.container[#self.container] or self.container[betterFindIndex(config, 'section') or 1]
  1958.         if parent:FindFirstChild('Title_Element') then return end
  1959.         local title = betterFindIndex(config, 'title') or ''
  1960.  
  1961.         local Title = newInstance('Frame', {
  1962.             Name = 'Title_Element',
  1963.             Parent = parent,
  1964.             BackgroundTransparency = 1,
  1965.             Size = UDim2.new(1, 0, 0, 20),
  1966.             LayoutOrder = 0,
  1967.         }, {
  1968.             newInstance('TextLabel', {
  1969.                 BackgroundTransparency = 1,
  1970.                 Size = UDim2.new(0, getTextSize(title, 14, library.Settings.Elements_Font).X, 0, 14),
  1971.                 Position = UDim2.new(0, 0, 0, 0),
  1972.                 AnchorPoint = Vector2.new(0, 0),
  1973.                 RichText = true,
  1974.                 Text = '<b>' .. title .. '</b>',
  1975.                 TextSize = 14,
  1976.                 TextColor3 = library.Settings.theme.TextColor,
  1977.                 TextXAlignment = Enum.TextXAlignment.Left,
  1978.                 Font = library.Settings.Elements_Font
  1979.             }),
  1980.             newInstance('ImageButton', {
  1981.                 AutoButtonColor = false,
  1982.                 BackgroundTransparency = 1,
  1983.                 Size = UDim2.new(0, 14, 0, 14),
  1984.                 Position = UDim2.new(1, 0, 0, 0),
  1985.                 AnchorPoint = Vector2.new(1, 0),
  1986.                 Image = 'rbxassetid://7733717447',
  1987.                 ImageColor3 = library.Settings.theme.TextColor
  1988.             }),
  1989.             newInstance('BoolValue', {
  1990.                 Name = 'Toggle',
  1991.                 Value = false
  1992.             })
  1993.         })
  1994.  
  1995.         local debounce = false
  1996.         Title.ImageButton.MouseButton1Click:Connect(function()
  1997.             if debounce then return end
  1998.             Title.Toggle.Value = not Title.Toggle.Value
  1999.             debounce = true
  2000.             self:Resize(true)
  2001.             rippleEffect(Title.ImageButton, 0.5, 6)
  2002.             Tween(Title.ImageButton, { Rotation = Title.Toggle.Value and 180 or 0 }, 0.2).Completed:Wait()
  2003.             debounce = false
  2004.         end)
  2005.     end
  2006.     function library.section:addButton(config)
  2007.         config = config or {}
  2008.         local text = betterFindIndex(config, 'Text')
  2009.         local disabled = betterFindIndex(config, 'Disabled') or false
  2010.         local button = newInstance('ImageButton', {
  2011.             Name = 'Button_Module',
  2012.             Parent = (betterFindIndex(config, 'section') or 1) > #self.container and self.container[#self.container] or self.container[betterFindIndex(config, 'section') or 1],
  2013.             BackgroundColor3 = library.Settings.theme.DarkContrast,
  2014.             AutoButtonColor = false,
  2015.             ClipsDescendants = true,
  2016.             Size = UDim2.new(1, 0, 0, 25),
  2017.         }, {
  2018.             newInstance('TextLabel', {
  2019.                 Size = UDim2.new(1, 0, 1, 0),
  2020.                 BackgroundTransparency = 1,
  2021.                 Text = (text and text ~= '' and text) or 'Button',
  2022.                 Font = library.Settings.Elements_Font,
  2023.                 TextSize = 14,
  2024.                 RichText = true,
  2025.                 TextColor3 = library.Settings.theme.TextColor,
  2026.             }),
  2027.             newInstance('ImageLabel', {
  2028.                 Image = 'rbxassetid://7072718362',
  2029.                 ImageColor3 = library.Settings.theme.Error,
  2030.                 ImageTransparency = 1,
  2031.                 BackgroundTransparency = 1,
  2032.                 Size = UDim2.new(0, 15, 0, 15),
  2033.                 Position = UDim2.new(0.5, 0, 0.5, 0),
  2034.                 AnchorPoint = Vector2.new(0.5, 0.5),
  2035.                 ZIndex = 2
  2036.             }),
  2037.             newInstance('StringValue', {
  2038.                 Name = 'SearchValue',
  2039.                 Value = ((text and text ~= '' and text) or 'Button'):gsub('<[^<>]->', ''),
  2040.             }),
  2041.         }, UDim.new(0, betterFindIndex(config, 'Corner') or 5))
  2042.  
  2043.         table.insert(self.modules, button)
  2044.         self.page:Resize()
  2045.  
  2046.         local function Disabled()
  2047.             disabled = true
  2048.  
  2049.             Tween(button, { BackgroundTransparency = 0.5 }, 0.2)
  2050.             Tween(button.TextLabel, { TextTransparency = 0.5 }, 0.2)
  2051.             Tween(button.ImageLabel, { ImageTransparency = 0 }, 0.2)
  2052.         end
  2053.         local function Enabled()
  2054.             disabled = false
  2055.  
  2056.             Tween(button, { BackgroundTransparency = 0 }, 0.2)
  2057.             Tween(button.TextLabel, { TextTransparency = 0 }, 0.2)
  2058.             Tween(button.ImageLabel, { ImageTransparency = 1 }, 0.2)
  2059.         end
  2060.         local function Update(new_config)
  2061.             new_config = new_config or {}
  2062.             for i,v in pairs(new_config) do
  2063.                 config[i] = v
  2064.                 if string.lower(tostring(i)) == 'text' then
  2065.                     button.TextLabel.Text = v
  2066.                 elseif  string.lower(tostring(i)) == 'disabled' then
  2067.                     if v then
  2068.                         Disabled()
  2069.                     else
  2070.                         Enabled()
  2071.                     end
  2072.                 end
  2073.             end
  2074.         end
  2075.  
  2076.         if disabled then
  2077.             Disabled()
  2078.         end
  2079.  
  2080.         local debounce
  2081.         button.MouseButton1Click:Connect(function()
  2082.             if debounce or disabled then return end
  2083.  
  2084.             rippleEffect(button, 0.5)
  2085.  
  2086.             debounce = true
  2087.  
  2088.             Tween(button, { BackgroundTransparency = 0.5 }, 0.2)
  2089.             if betterFindIndex(config, 'CallBack') then
  2090.                 betterFindIndex(config, 'CallBack')()
  2091.             end
  2092.             Tween(button, { BackgroundTransparency = 0 }, 0.2)
  2093.  
  2094.             debounce = false
  2095.         end)
  2096.  
  2097.         return { Disabled = Disabled, Enabled = Enabled, Update = Update }
  2098.     end
  2099.     function library.section:addToggle(config)
  2100.         config = config or {}
  2101.         local title = betterFindIndex(config, "Title") or 'Toggle'
  2102.         local disabled = betterFindIndex(config, 'Disabled') or false
  2103.         local toggle = newInstance("ImageButton", {
  2104.             Name = "Toggle_Module",
  2105.             Parent = (betterFindIndex(config, "section") or 1) > #self.container and self.container[#self.container] or self.container[betterFindIndex(config, "section") or 1],
  2106.             AutoButtonColor = false,
  2107.             BackgroundColor3 = library.Settings.theme.DarkContrast,
  2108.             Size = UDim2.new(1, 0, 0, 25),
  2109.         }, {
  2110.             newInstance('UIPadding', {
  2111.                 PaddingLeft = UDim.new(0, 10),
  2112.                 PaddingRight = UDim.new(0, 10),
  2113.             }),
  2114.             newInstance("TextLabel", {
  2115.                 Size = UDim2.new(1, -40, 1, 0),
  2116.                 BackgroundTransparency = 1,
  2117.                 Font = library.Settings.Elements_Font,
  2118.                 TextColor3 = library.Settings.theme.TextColor,
  2119.                 -- RichText = true,
  2120.                 Text = title,
  2121.                 TextSize = 14,
  2122.                 ClipsDescendants = true,
  2123.                 TextXAlignment = Enum.TextXAlignment.Left,
  2124.                 TextTruncate = Enum.TextTruncate.AtEnd,
  2125.             }),
  2126.             newInstance("Frame", {
  2127.                 BackgroundColor3 = library.Settings.theme.Background,
  2128.                 BorderSizePixel = 0,
  2129.                 Size = UDim2.new(0, 35, 0, 12),
  2130.                 Position = UDim2.new(1, 0, 0.5, 0),
  2131.                 AnchorPoint = Vector2.new(1, 0.5),
  2132.             }, {
  2133.                 newInstance("Frame", {
  2134.                     Name = "Button",
  2135.                     BackgroundColor3 = library.Settings.theme.LightContrast,
  2136.                     Position = UDim2.new(0, 0, 0.5, 0),
  2137.                     AnchorPoint = Vector2.new(0, 0.5),
  2138.                     Size = UDim2.new(0, 14, 0, 14),
  2139.                 }, {
  2140.                     newInstance('UIGradient', {
  2141.                         Color = ColorSequence.new{
  2142.                             ColorSequenceKeypoint.new(0, Color3.fromRGB(40, 53, 221)),
  2143.                             ColorSequenceKeypoint.new(1, Color3.fromRGB(3, 156, 251))
  2144.                         },
  2145.                         Enabled = false
  2146.                     }),
  2147.                 }, UDim.new(1, 0)),
  2148.             }, UDim.new(1, 0)),
  2149.             newInstance('ImageLabel', {
  2150.                 Image = 'rbxassetid://7072718362',
  2151.                 ImageColor3 = library.Settings.theme.Error,
  2152.                 ImageTransparency = 1,
  2153.                 BackgroundTransparency = 1,
  2154.                 Size = UDim2.new(0, 15, 0, 15),
  2155.                 Position = UDim2.new(0.5, 0, 0.5, 0),
  2156.                 AnchorPoint = Vector2.new(0.5, 0.5),
  2157.                 ZIndex = 2
  2158.             }),
  2159.             newInstance("StringValue", {
  2160.                 Name = "SearchValue",
  2161.                 Value = title,
  2162.             }),
  2163.         }, UDim.new(0, betterFindIndex(config, "Corner") or 5))
  2164.  
  2165.         table.insert(self.modules, toggle)
  2166.         self.page:Resize()
  2167.  
  2168.         local function Disabled()
  2169.             disabled = true
  2170.  
  2171.             Tween(toggle, { BackgroundTransparency = 0.5 }, 0.2)
  2172.             Tween(toggle.Frame, { BackgroundTransparency = 0.5 }, 0.2)
  2173.             Tween(toggle.Frame.Button, { BackgroundTransparency = 0.5 }, 0.2)
  2174.             Tween(toggle.TextLabel, { TextTransparency = 0.5 }, 0.2)
  2175.             Tween(toggle.ImageLabel, { ImageTransparency = 0 }, 0.2)
  2176.         end
  2177.         local function Enabled()
  2178.             disabled = false
  2179.  
  2180.             Tween(toggle, { BackgroundTransparency = 0 }, 0.2)
  2181.             Tween(toggle.Frame, { BackgroundTransparency = 0 }, 0.2)
  2182.             Tween(toggle.Frame.Button, { BackgroundTransparency = 0 }, 0.2)
  2183.             Tween(toggle.TextLabel, { TextTransparency = 0 }, 0.2)
  2184.             Tween(toggle.ImageLabel, { ImageTransparency = 1 }, 0.2)
  2185.         end
  2186.         local function Update(new_config)
  2187.             new_config = new_config or {}
  2188.  
  2189.             local new_value
  2190.             for i,v in pairs(new_config) do
  2191.                 config[i] = v
  2192.                 if string.lower(tostring(i)) == 'title' then
  2193.                     title = betterFindIndex(config, "Title") or title
  2194.                     toggle.TextLabel.Text = title
  2195.                     toggle.SearchValue.Value = title
  2196.                 elseif string.lower(tostring(i)) == 'value' then
  2197.                     new_value = v
  2198.                 elseif string.lower(tostring(i)) == 'disabled' then
  2199.                     if v then
  2200.                         Disabled()
  2201.                     else
  2202.                         Enabled()
  2203.                     end
  2204.                 end
  2205.             end
  2206.  
  2207.             if new_value ~= nil then
  2208.                 if new_value then
  2209.                     toggle.Frame.Button.UIGradient.Enabled = true
  2210.                     toggle.Frame.Button.BackgroundColor3 = Color3.new(1, 1, 1)
  2211.                     Tween(toggle.Frame.Button, { Position = UDim2.new(1, 0, 0.5, 0), AnchorPoint = Vector2.new(1, 0.5) }, 0.3)
  2212.  
  2213.                     if betterFindIndex(config, "CallBack") then
  2214.                         betterFindIndex(config, "CallBack")(true)
  2215.                     end
  2216.                 else
  2217.                     toggle.Frame.Button.UIGradient.Enabled = false
  2218.                     toggle.Frame.Button.BackgroundColor3 = library.Settings.theme.LightContrast
  2219.                     Tween(toggle.Frame.Button, { Position = UDim2.new(0, 0, 0.5, 0), AnchorPoint = Vector2.new(0, 0.5) }, 0.3)
  2220.  
  2221.                     if betterFindIndex(config, "CallBack") then
  2222.                         betterFindIndex(config, "CallBack")(false)
  2223.                     end
  2224.                 end
  2225.                 task.wait(0.2)
  2226.             end
  2227.         end
  2228.  
  2229.         if disabled then
  2230.             Disabled()
  2231.         end
  2232.  
  2233.         local active = betterFindIndex(config, "Value") or false
  2234.         if active then
  2235.             Update({ value = active })
  2236.         end
  2237.  
  2238.         local debounce
  2239.         toggle.MouseButton1Click:Connect(function()
  2240.             if debounce or disabled then return end
  2241.  
  2242.             debounce = true
  2243.  
  2244.             active = not active
  2245.             Update({ value = active })
  2246.  
  2247.             debounce = false
  2248.         end)
  2249.  
  2250.         return { Disabled = Disabled, Enabled = Enabled, Update = Update }
  2251.     end
  2252. end
  2253.  
  2254. return { Library = library, Discord = Discord, MongoDB = MongoDB }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement