NCXKayy

Rayfield

Jun 7th, 2025
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 173.81 KB | Source Code | 0 0
  1. --[[
  2.  
  3.     Rayfield Interface Suite
  4.     by Sirius
  5.  
  6.     shlex | Designing + Programming
  7.     iRay  | Programming
  8.     Max   | Programming
  9.  
  10. ]]
  11.  
  12. if debugX then
  13.     warn('Initialising Rayfield')
  14. end
  15.  
  16. local function getService(name)
  17.     local service = game:GetService(name)
  18.     return if cloneref then cloneref(service) else service
  19. end
  20.  
  21. -- Loads and executes a function hosted on a remote URL. Cancels the request if the requested URL takes too long to respond.
  22. -- Errors with the function are caught and logged to the output
  23. local function loadWithTimeout(url: string, timeout: number?): ...any
  24.     assert(type(url) == "string", "Expected string, got " .. type(url))
  25.     timeout = timeout or 5
  26.     local requestCompleted = false
  27.     local success, result = false, nil
  28.  
  29.     local requestThread = task.spawn(function()
  30.         local fetchSuccess, fetchResult = pcall(game.HttpGet, game, url) -- game:HttpGet(url)
  31.         -- If the request fails the content can be empty, even if fetchSuccess is true
  32.         if not fetchSuccess or #fetchResult == 0 then
  33.             if #fetchResult == 0 then
  34.                 fetchResult = "Empty response" -- Set the error message
  35.             end
  36.             success, result = false, fetchResult
  37.             requestCompleted = true
  38.             return
  39.         end
  40.         local content = fetchResult -- Fetched content
  41.         local execSuccess, execResult = pcall(function()
  42.             return loadstring(content)()
  43.         end)
  44.         success, result = execSuccess, execResult
  45.         requestCompleted = true
  46.     end)
  47.  
  48.     local timeoutThread = task.delay(timeout, function()
  49.         if not requestCompleted then
  50.             warn(`Request for {url} timed out after {timeout} seconds`)
  51.             task.cancel(requestThread)
  52.             result = "Request timed out"
  53.             requestCompleted = true
  54.         end
  55.     end)
  56.  
  57.     -- Wait for completion or timeout
  58.     while not requestCompleted do
  59.         task.wait()
  60.     end
  61.     -- Cancel timeout thread if still running when request completes
  62.     if coroutine.status(timeoutThread) ~= "dead" then
  63.         task.cancel(timeoutThread)
  64.     end
  65.     if not success then
  66.         warn(`Failed to process {url}: {result}`)
  67.     end
  68.     return if success then result else nil
  69. end
  70.  
  71. local requestsDisabled = true --getgenv and getgenv().DISABLE_RAYFIELD_REQUESTS
  72. local InterfaceBuild = '3K3W'
  73. local Release = "Build 1.672"
  74. local RayfieldFolder = "Rayfield"
  75. local ConfigurationFolder = RayfieldFolder.."/Configurations"
  76. local ConfigurationExtension = ".rfld"
  77. local settingsTable = {
  78.     General = {
  79.         -- if needs be in order just make getSetting(name)
  80.         rayfieldOpen = {Type = 'bind', Value = 'K', Name = 'Rayfield Keybind'},
  81.         -- buildwarnings
  82.         -- rayfieldprompts
  83.  
  84.     },
  85.     System = {
  86.         usageAnalytics = {Type = 'toggle', Value = true, Name = 'Anonymised Analytics'},
  87.     }
  88. }
  89.  
  90. -- Settings that have been overridden by the developer. These will not be saved to the user's configuration file
  91. -- Overridden settings always take precedence over settings in the configuration file, and are cleared if the user changes the setting in the UI
  92. local overriddenSettings: { [string]: any } = {} -- For example, overriddenSettings["System.rayfieldOpen"] = "J"
  93. local function overrideSetting(category: string, name: string, value: any)
  94.     overriddenSettings[`{category}.{name}`] = value
  95. end
  96.  
  97. local function getSetting(category: string, name: string): any
  98.     if overriddenSettings[`{category}.{name}`] ~= nil then
  99.         return overriddenSettings[`{category}.{name}`]
  100.     elseif settingsTable[category][name] ~= nil then
  101.         return settingsTable[category][name].Value
  102.     end
  103. end
  104.  
  105. -- If requests/analytics have been disabled by developer, set the user-facing setting to false as well
  106. if requestsDisabled then
  107.     overrideSetting("System", "usageAnalytics", false)
  108. end
  109.  
  110. local HttpService = getService('HttpService')
  111. local RunService = getService('RunService')
  112.  
  113. -- Environment Check
  114. local useStudio = RunService:IsStudio() or false
  115.  
  116. local settingsCreated = false
  117. local settingsInitialized = false -- Whether the UI elements in the settings page have been set to the proper values
  118. local cachedSettings
  119. --local prompt = useStudio and require(script.Parent.prompt) or loadWithTimeout('https://raw.githubusercontent.com/SiriusSoftwareLtd/Sirius/refs/heads/request/prompt.lua')
  120. local request = (syn and syn.request) or (fluxus and fluxus.request) or (http and http.request) or http_request or request
  121.  
  122.  
  123.  
  124. local function loadSettings()
  125.     local file = nil
  126.    
  127.     local success, result = pcall(function()
  128.         task.spawn(function()
  129.             if isfolder and isfolder(RayfieldFolder) then
  130.                 if isfile and isfile(RayfieldFolder..'/settings'..ConfigurationExtension) then
  131.                     file = readfile(RayfieldFolder..'/settings'..ConfigurationExtension)
  132.                 end
  133.             end
  134.  
  135.             -- for debug in studio
  136.             if useStudio then
  137.                 file = [[
  138.         {"General":{"rayfieldOpen":{"Value":"K","Type":"bind","Name":"Rayfield Keybind","Element":{"HoldToInteract":false,"Ext":true,"Name":"Rayfield Keybind","Set":null,"CallOnChange":true,"Callback":null,"CurrentKeybind":"K"}}},"System":{"usageAnalytics":{"Value":false,"Type":"toggle","Name":"Anonymised Analytics","Element":{"Ext":true,"Name":"Anonymised Analytics","Set":null,"CurrentValue":false,"Callback":null}}}}
  139.     ]]
  140.             end
  141.  
  142.  
  143.             if file then
  144.                 local success, decodedFile = pcall(function() return HttpService:JSONDecode(file) end)
  145.                 if success then
  146.                     file = decodedFile
  147.                 else
  148.                     file = {}
  149.                 end
  150.             else
  151.                 file = {}
  152.             end
  153.  
  154.  
  155.             if not settingsCreated then
  156.                 cachedSettings = file
  157.                 return
  158.             end
  159.  
  160.             if file ~= {} then
  161.                 for categoryName, settingCategory in pairs(settingsTable) do
  162.                     if file[categoryName] then
  163.                         for settingName, setting in pairs(settingCategory) do
  164.                             if file[categoryName][settingName] then
  165.                                 setting.Value = file[categoryName][settingName].Value
  166.                                 setting.Element:Set(getSetting(categoryName, settingName))
  167.                             end
  168.                         end
  169.                     end
  170.                 end
  171.             end
  172.             settingsInitialized = true
  173.         end)
  174.     end)
  175.    
  176.     if not success then
  177.         if writefile then
  178.             warn('Rayfield had an issue accessing configuration saving capability.')
  179.         end
  180.     end
  181. end
  182.  
  183. if debugX then
  184.     warn('Now Loading Settings Configuration')
  185. end
  186.  
  187. loadSettings()
  188.  
  189. if debugX then
  190.     warn('Settings Loaded')
  191. end
  192.  
  193. --if not cachedSettings or not cachedSettings.System or not cachedSettings.System.usageAnalytics then
  194. --  local fileFunctionsAvailable = isfile and writefile and readfile
  195.  
  196. --  if not fileFunctionsAvailable and not useStudio then
  197. --      warn('Rayfield Interface Suite | Sirius Analytics:\n\n\nAs you don\'t have file functionality with your executor, we are unable to save whether you want to opt in or out to analytics.\nIf you do not want to take part in anonymised usage statistics, let us know in our Discord at sirius.menu/discord and we will manually opt you out.')
  198. --      analytics = true   
  199. --  else
  200. --      prompt.create(
  201. --          'Help us improve',
  202. --              [[Would you like to allow Sirius to collect usage statistics?
  203.  
  204. --<font transparency='0.4'>No data is linked to you or your personal activity.</font>]],
  205. --          'Continue',
  206. --          'Cancel',
  207. --          function(result)
  208. --              settingsTable.System.usageAnalytics.Value = result
  209. --              analytics = result
  210. --          end
  211. --      )
  212. --  end
  213.  
  214. --  repeat task.wait() until analytics ~= nil
  215. --end
  216.  
  217. if not requestsDisabled then
  218.     if debugX then
  219.         warn('Querying Settings for Reporter Information')
  220.     end
  221.     local function sendReport()
  222.         if useStudio then
  223.             print('Sending Analytics')
  224.         else
  225.             if debugX then warn('Reporting Analytics') end
  226.             task.spawn(function()
  227.                 local success, reporter = pcall(function()
  228.                     return loadstring(game:HttpGet("https://analytics.sirius.menu/v1/reporter", true))()
  229.                 end)
  230.                 if success and reporter then
  231.                     pcall(function()
  232.                         reporter.report("Rayfield", Release, InterfaceBuild)
  233.                     end)
  234.                 else
  235.                     warn("Failed to load or execute the reporter. \nPlease notify Rayfield developers at sirius.menu/discord.")
  236.                 end
  237.             end)
  238.             if debugX then warn('Finished Report') end
  239.         end
  240.     end
  241.     if cachedSettings and (#cachedSettings == 0 or (cachedSettings.System and cachedSettings.System.usageAnalytics and cachedSettings.System.usageAnalytics.Value)) then
  242.         sendReport()
  243.     elseif not cachedSettings then
  244.         sendReport()
  245.     end
  246. end
  247.  
  248. if debugX then
  249.     warn('Moving on to continue initialisation'-- Lighter shade
  250.             SliderProgress = Color3.fromRGB(70, 130, 180),
  251.             SliderStroke = Color3.fromRGB(150, 180, 220),
  252.  
  253.             ToggleBackground = Color3.fromRGB(210, 220, 230),
  254.             ToggleEnabled = Color3.fromRGB(70, 160, 210),
  255.             ToggleDisabled = Color3.fromRGB(180, 180, 180),
  256.             ToggleEnabledStroke = Color3.fromRGB(60, 150, 200),
  257.             ToggleDisabledStroke = Color3.fromRGB(140, 140, 140),
  258.             ToggleEnabledOuterStroke = Color3.fromRGB(100, 120, 140),
  259.             ToggleDisabledOuterStroke = Color3.fromRGB(120, 120, 130),
  260.  
  261.             DropdownSelected = Color3.fromRGB(220, 230, 240),
  262.             DropdownUnselected = Color3.fromRGB(200, 210, 220),
  263.  
  264.             InputBackground = Color3.fromRGB(220, 230, 240),
  265.             InputStroke = Color3.fromRGB(180, 190, 200),
  266.             PlaceholderColor = Color3.fromRGB(150, 150, 150)
  267.         },
  268.     }
  269. }
  270.  
  271.  
  272. -- Services
  273. local UserInputService = getService("UserInputService")
  274. local TweenService = getService("TweenService")
  275. local Players = getService("Players")
  276. local CoreGui = getService("CoreGui")
  277.  
  278. -- Interface Management
  279.  
  280. local Rayfield = useStudio and script.Parent:FindFirstChild('Rayfield') or game:GetObjects("rbxassetid://10804731440")[1]
  281. local buildAttempts = 0
  282. local correctBuild = false
  283. local warned
  284. local globalLoaded
  285. local rayfieldDestroyed = false -- True when RayfieldLibrary:Destroy() is called
  286.  
  287. repeat
  288.     if Rayfield:FindFirstChild('Build') and Rayfield.Build.Value == InterfaceBuild then
  289.         correctBuild = true
  290.         break
  291.     end
  292.  
  293.     correctBuild = false
  294.  
  295.     if not warned then
  296.         warn('Rayfield | Build Mismatch')
  297.         print('Rayfield may encounter issues as you are running an incompatible interface version ('.. ((Rayfield:FindFirstChild('Build') and Rayfield.Build.Value) or 'No Build') ..').\n\nThis version of Rayfield is intended for interface build '..InterfaceBuild..'.')
  298.         warned = true
  299.     end
  300.  
  301.     toDestroy, Rayfield = Rayfield, useStudio and script.Parent:FindFirstChild('Rayfield') or game:GetObjects("rbxassetid://10804731440")[1]
  302.     if toDestroy and not useStudio then toDestroy:Destroy() end
  303.  
  304.     buildAttempts = buildAttempts + 1
  305. until buildAttempts >= 2
  306.  
  307. Rayfield.Enabled = false
  308.  
  309. if gethui then
  310.     Rayfield.Parent = gethui()
  311. elseif syn and syn.protect_gui then
  312.     syn.protect_gui(Rayfield)
  313.     Rayfield.Parent = CoreGui
  314. elseif not useStudio and CoreGui:FindFirstChild("RobloxGui") then
  315.     Rayfield.Parent = CoreGui:FindFirstChild("RobloxGui")
  316. elseif not useStudio then
  317.     Rayfield.Parent = CoreGui
  318. end
  319.  
  320. if gethui then
  321.     for _, Interface in ipairs(gethui():GetChildren()) do
  322.         if Interface.Name == Rayfield.Name and Interface ~= Rayfield then
  323.             Interface.Enabled = false
  324.             Interface.Name = "Rayfield-Old"
  325.         end
  326.     end
  327. elseif not useStudio then
  328.     for _, Interface in ipairs(CoreGui:GetChildren()) do
  329.         if Interface.Name == Rayfield.Name and Interface ~= Rayfield then
  330.             Interface.Enabled = false
  331.             Interface.Name = "Rayfield-Old"
  332.         end
  333.     end
  334. end
  335.  
  336.  
  337. local minSize = Vector2.new(1024, 768)
  338. local useMobileSizing
  339.  
  340. if Rayfield.AbsoluteSize.X < minSize.X and Rayfield.AbsoluteSize.Y < minSize.Y then
  341.     useMobileSizing = true
  342. end
  343.  
  344. if UserInputService.TouchEnabled then
  345.     useMobilePrompt = true
  346. end
  347.  
  348.  
  349. -- Object Variables
  350.  
  351. local Main = Rayfield.Main
  352. local MPrompt = Rayfield:FindFirstChild('Prompt')
  353. local Topbar = Main.Topbar
  354. local Elements = Main.Elements
  355. local LoadingFrame = Main.LoadingFrame
  356. local TabList = Main.TabList
  357. local dragBar = Rayfield:FindFirstChild('Drag')
  358. local dragInteract = dragBar and dragBar.Interact or nil
  359. local dragBarCosmetic = dragBar and dragBar.Drag or nil
  360.  
  361. local dragOffset = 255
  362. local dragOffsetMobile = 150
  363.  
  364. Rayfield.DisplayOrder = 100
  365. LoadingFrame.Version.Text = Release
  366.  
  367. -- Thanks to Latte Softworks for the Lucide integration for Roblox
  368. local Icons = useStudio and require(script.Parent.icons) or loadWithTimeout('https://raw.githubusercontent.com/SiriusSoftwareLtd/Rayfield/refs/heads/main/icons.lua')
  369. -- Variables
  370.  
  371. local CFileName = nil
  372. local CEnabled = false
  373. local Minimised = false
  374. local Hidden = false
  375. local Debounce = false
  376. local searchOpen = false
  377. local Notifications = Rayfield.Notifications
  378.  
  379. local SelectedTheme = RayfieldLibrary.Theme.Default
  380.  
  381. local function ChangeTheme(Theme)
  382.     if typeof(Theme) == 'string' then
  383.         SelectedTheme = RayfieldLibrary.Theme[Theme]
  384.     elseif typeof(Theme) == 'table' then
  385.         SelectedTheme = Theme
  386.     end
  387.  
  388.     Rayfield.Main.BackgroundColor3 = SelectedTheme.Background
  389.     Rayfield.Main.Topbar.BackgroundColor3 = SelectedTheme.Topbar
  390.     Rayfield.Main.Topbar.CornerRepair.BackgroundColor3 = SelectedTheme.Topbar
  391.     Rayfield.Main.Shadow.Image.ImageColor3 = SelectedTheme.Shadow
  392.  
  393.     Rayfield.Main.Topbar.ChangeSize.ImageColor3 = SelectedTheme.TextColor
  394.     Rayfield.Main.Topbar.Hide.ImageColor3 = SelectedTheme.TextColor
  395.     Rayfield.Main.Topbar.Search.ImageColor3 = SelectedTheme.TextColor
  396.     if Topbar:FindFirstChild('Settings') then
  397.         Rayfield.Main.Topbar.Settings.ImageColor3 = SelectedTheme.TextColor
  398.         Rayfield.Main.Topbar.Divider.BackgroundColor3 = SelectedTheme.ElementStroke
  399.     end
  400.  
  401.     Main.Search.BackgroundColor3 = SelectedTheme.TextColor
  402.     Main.Search.Shadow.ImageColor3 = SelectedTheme.TextColor
  403.     Main.Search.Search.ImageColor3 = SelectedTheme.TextColor
  404.     Main.Search.Input.PlaceholderColor3 = SelectedTheme.TextColor
  405.     Main.Search.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  406.  
  407.     if Main:FindFirstChild('Notice') then
  408.         Main.Notice.BackgroundColor3 = SelectedTheme.Background
  409.     end
  410.  
  411.     for _, text in ipairs(Rayfield:GetDescendants()) do
  412.         if text.Parent.Parent ~= Notifications then
  413.             if text:IsA('TextLabel') or text:IsA('TextBox') then text.TextColor3 = SelectedTheme.TextColor end
  414.         end
  415.     end
  416.  
  417.     for _, TabPage in ipairs(Elements:GetChildren()) do
  418.         for _, Element in ipairs(TabPage:GetChildren()) do
  419.             if Element.ClassName == "Frame" and Element.Name ~= "Placeholder" and Element.Name ~= "SectionSpacing" and Element.Name ~= "Divider" and Element.Name ~= "SectionTitle" and Element.Name ~= "SearchTitle-fsefsefesfsefesfesfThanks" then
  420.                 Element.BackgroundColor3 = SelectedTheme.ElementBackground
  421.                 Element.UIStroke.Color = SelectedTheme.ElementStroke
  422.             end
  423.         end
  424.     end
  425. end
  426.  
  427. local function getIcon(name : string): {id: number, imageRectSize: Vector2, imageRectOffset: Vector2}
  428.     if not Icons then
  429.         warn("Lucide Icons: Cannot use icons as icons library is not loaded")
  430.         return
  431.     end
  432.     name = string.match(string.lower(name), "^%s*(.*)%s*$") :: string
  433.     local sizedicons = Icons['48px']
  434.     local r = sizedicons[name]
  435.     if not r then
  436.         error(`Lucide Icons: Failed to find icon by the name of "{name}"`, 2)
  437.     end
  438.  
  439.     local rirs = r[2]
  440.     local riro = r[3]
  441.  
  442.     if type(r[1]) ~= "number" or type(rirs) ~= "table" or type(riro) ~= "table" then
  443.         error("Lucide Icons: Internal error: Invalid auto-generated asset entry")
  444.     end
  445.  
  446.     local irs = Vector2.new(rirs[1], rirs[2])
  447.     local iro = Vector2.new(riro[1], riro[2])
  448.  
  449.     local asset = {
  450.         id = r[1],
  451.         imageRectSize = irs,
  452.         imageRectOffset = iro,
  453.     }
  454.  
  455.     return asset
  456. end
  457. -- Converts ID to asset URI. Returns rbxassetid://0 if ID is not a number
  458. local function getAssetUri(id: any): string
  459.     local assetUri = "rbxassetid://0" -- Default to empty image
  460.     if type(id) == "number" then
  461.         assetUri = "rbxassetid://" .. id
  462.     elseif type(id) == "string" and not Icons then
  463.         warn("Rayfield | Cannot use Lucide icons as icons library is not loaded")
  464.     else
  465.         warn("Rayfield | The icon argument must either be an icon ID (number) or a Lucide icon name (string)")
  466.     end
  467.     return assetUri
  468. end
  469.  
  470. local function makeDraggable(object, dragObject, enableTaptic, tapticOffset)
  471.     local dragging = false
  472.     local relative = nil
  473.  
  474.     local offset = Vector2.zero
  475.     local screenGui = object:FindFirstAncestorWhichIsA("ScreenGui")
  476.     if screenGui and screenGui.IgnoreGuiInset then
  477.         offset += getService('GuiService'):GetGuiInset()
  478.     end
  479.  
  480.     local function connectFunctions()
  481.         if dragBar and enableTaptic then
  482.             dragBar.MouseEnter:Connect(function()
  483.                 if not dragging and not Hidden then
  484.                     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.5, Size = UDim2.new(0, 120, 0, 4)}):Play()
  485.                 end
  486.             end)
  487.  
  488.             dragBar.MouseLeave:Connect(function()
  489.                 if not dragging and not Hidden then
  490.                     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.7, Size = UDim2.new(0, 100, 0, 4)}):Play()
  491.                 end
  492.             end)
  493.         end
  494.     end
  495.  
  496.     connectFunctions()
  497.  
  498.     dragObject.InputBegan:Connect(function(input, processed)
  499.         if processed then return end
  500.  
  501.         local inputType = input.UserInputType.Name
  502.         if inputType == "MouseButton1" or inputType == "Touch" then
  503.             dragging = true
  504.  
  505.             relative = object.AbsolutePosition + object.AbsoluteSize * object.AnchorPoint - UserInputService:GetMouseLocation()
  506.             if enableTaptic and not Hidden then
  507.                 TweenService:Create(dragBarCosmetic, TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Size = UDim2.new(0, 110, 0, 4), BackgroundTransparency = 0}):Play()
  508.             end
  509.         end
  510.     end)
  511.  
  512.     local inputEnded = UserInputService.InputEnded:Connect(function(input)
  513.         if not dragging then return end
  514.  
  515.         local inputType = input.UserInputType.Name
  516.         if inputType == "MouseButton1" or inputType == "Touch" then
  517.             dragging = false
  518.  
  519.             connectFunctions()
  520.  
  521.             if enableTaptic and not Hidden then
  522.                 TweenService:Create(dragBarCosmetic, TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Size = UDim2.new(0, 100, 0, 4), BackgroundTransparency = 0.7}):Play()
  523.             end
  524.         end
  525.     end)
  526.  
  527.     local renderStepped = RunService.RenderStepped:Connect(function()
  528.         if dragging and not Hidden then
  529.             local position = UserInputService:GetMouseLocation() + relative + offset
  530.             if enableTaptic and tapticOffset then
  531.                 TweenService:Create(object, TweenInfo.new(0.4, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Position = UDim2.fromOffset(position.X, position.Y)}):Play()
  532.                 TweenService:Create(dragObject.Parent, TweenInfo.new(0.05, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Position = UDim2.fromOffset(position.X, position.Y + ((useMobileSizing and tapticOffset[2]) or tapticOffset[1]))}):Play()
  533.             else
  534.                 if dragBar and tapticOffset then
  535.                     dragBar.Position = UDim2.fromOffset(position.X, position.Y + ((useMobileSizing and tapticOffset[2]) or tapticOffset[1]))
  536.                 end
  537.                 object.Position = UDim2.fromOffset(position.X, position.Y)
  538.             end
  539.         end
  540.     end)
  541.  
  542.     object.Destroying:Connect(function()
  543.         if inputEnded then inputEnded:Disconnect() end
  544.         if renderStepped then renderStepped:Disconnect() end
  545.     end)
  546. end
  547.  
  548.  
  549. local function PackColor(Color)
  550.     return {R = Color.R * 255, G = Color.G * 255, B = Color.B * 255}
  551. end    
  552.  
  553. local function UnpackColor(Color)
  554.     return Color3.fromRGB(Color.R, Color.G, Color.B)
  555. end
  556.  
  557. local function LoadConfiguration(Configuration)
  558.     local success, Data = pcall(function() return HttpService:JSONDecode(Configuration) end)
  559.     local changed
  560.  
  561.     if not success then warn('Rayfield had an issue decoding the configuration file, please try delete the file and reopen Rayfield.') return end
  562.  
  563.     -- Iterate through current UI elements' flags
  564.     for FlagName, Flag in pairs(RayfieldLibrary.Flags) do
  565.         local FlagValue = Data[FlagName]
  566.  
  567.         if (typeof(FlagValue) == 'boolean' and FlagValue == false) or FlagValue then
  568.             task.spawn(function()
  569.                 if Flag.Type == "ColorPicker" then
  570.                     changed = true
  571.                     Flag:Set(UnpackColor(FlagValue))
  572.                 else
  573.                     if (Flag.CurrentValue or Flag.CurrentKeybind or Flag.CurrentOption or Flag.Color) ~= FlagValue then
  574.                         changed = true
  575.                         Flag:Set(FlagValue)    
  576.                     end
  577.                 end
  578.             end)
  579.         else
  580.             warn("Rayfield | Unable to find '"..FlagName.. "' in the save file.")
  581.             print("The error above may not be an issue if new elements have been added or not been set values.")
  582.             --RayfieldLibrary:Notify({Title = "Rayfield Flags", Content = "Rayfield was unable to find '"..FlagName.. "' in the save file. Check sirius.menu/discord for help.", Image = 3944688398})
  583.         end
  584.     end
  585.  
  586.     return changed
  587. end
  588.  
  589. local function SaveConfiguration()
  590.     if not CEnabled or not globalLoaded then return end
  591.  
  592.     if debugX then
  593.         print('Saving')
  594.     end
  595.  
  596.     local Data = {}
  597.     for i, v in pairs(RayfieldLibrary.Flags) do
  598.         if v.Type == "ColorPicker" then
  599.             Data[i] = PackColor(v.Color)
  600.         else
  601.             if typeof(v.CurrentValue) == 'boolean' then
  602.                 if v.CurrentValue == false then
  603.                     Data[i] = false
  604.                 else
  605.                     Data[i] = v.CurrentValue or v.CurrentKeybind or v.CurrentOption or v.Color
  606.                 end
  607.             else
  608.                 Data[i] = v.CurrentValue or v.CurrentKeybind or v.CurrentOption or v.Color
  609.             end
  610.         end
  611.     end
  612.  
  613.     if useStudio then
  614.         if script.Parent:FindFirstChild('configuration') then script.Parent.configuration:Destroy() end
  615.  
  616.         local ScreenGui = Instance.new("ScreenGui")
  617.         ScreenGui.Parent = script.Parent
  618.         ScreenGui.Name = 'configuration'
  619.  
  620.         local TextBox = Instance.new("TextBox")
  621.         TextBox.Parent = ScreenGui
  622.         TextBox.Size = UDim2.new(0, 800, 0, 50)
  623.         TextBox.AnchorPoint = Vector2.new(0.5, 0)
  624.         TextBox.Position = UDim2.new(0.5, 0, 0, 30)
  625.         TextBox.Text = HttpService:JSONEncode(Data)
  626.         TextBox.ClearTextOnFocus = false
  627.     end
  628.  
  629.     if debugX then
  630.         warn(HttpService:JSONEncode(Data))
  631.     end
  632.  
  633.     if writefile then
  634.         writefile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension, tostring(HttpService:JSONEncode(Data)))
  635.     end
  636. end
  637.  
  638. function RayfieldLibrary:Notify(data) -- action e.g open messages
  639.     task.spawn(function()
  640.  
  641.         -- Notification Object Creation
  642.         local newNotification = Notifications.Template:Clone()
  643.         newNotification.Name = data.Title or 'No Title Provided'
  644.         newNotification.Parent = Notifications
  645.         newNotification.LayoutOrder = #Notifications:GetChildren()
  646.         newNotification.Visible = false
  647.  
  648.         -- Set Data
  649.         newNotification.Title.Text = data.Title or "Unknown Title"
  650.         newNotification.Description.Text = data.Content or "Unknown Content"
  651.  
  652.         if data.Image then
  653.             if typeof(data.Image) == 'string' and Icons then
  654.                 local asset = getIcon(data.Image)
  655.  
  656.                 newNotification.Icon.Image = 'rbxassetid://'..asset.id
  657.                 newNotification.Icon.ImageRectOffset = asset.imageRectOffset
  658.                 newNotification.Icon.ImageRectSize = asset.imageRectSize
  659.             else
  660.                 newNotification.Icon.Image = getAssetUri(data.Image)
  661.             end
  662.         else
  663.             newNotification.Icon.Image = "rbxassetid://" .. 0
  664.         end
  665.  
  666.         -- Set initial transparency values
  667.  
  668.         newNotification.Title.TextColor3 = SelectedTheme.TextColor
  669.         newNotification.Description.TextColor3 = SelectedTheme.TextColor
  670.         newNotification.BackgroundColor3 = SelectedTheme.Background
  671.         newNotification.UIStroke.Color = SelectedTheme.TextColor
  672.         newNotification.Icon.ImageColor3 = SelectedTheme.TextColor
  673.  
  674.         newNotification.BackgroundTransparency = 1
  675.         newNotification.Title.TextTransparency = 1
  676.         newNotification.Description.TextTransparency = 1
  677.         newNotification.UIStroke.Transparency = 1
  678.         newNotification.Shadow.ImageTransparency = 1
  679.         newNotification.Size = UDim2.new(1, 0, 0, 800)
  680.         newNotification.Icon.ImageTransparency = 1
  681.         newNotification.Icon.BackgroundTransparency = 1
  682.  
  683.         task.wait()
  684.  
  685.         newNotification.Visible = true
  686.  
  687.         if data.Actions then
  688.             warn('Rayfield | Not seeing your actions in notifications?')
  689.             print("Notification Actions are being sunset for now, keep up to date on when they're back in the discord. (sirius.menu/discord)")
  690.         end
  691.  
  692.         -- Calculate textbounds and set initial values
  693.         local bounds = {newNotification.Title.TextBounds.Y, newNotification.Description.TextBounds.Y}
  694.         newNotification.Size = UDim2.new(1, -60, 0, -Notifications:FindFirstChild("UIListLayout").Padding.Offset)
  695.  
  696.         newNotification.Icon.Size = UDim2.new(0, 32, 0, 32)
  697.         newNotification.Icon.Position = UDim2.new(0, 20, 0.5, 0)
  698.  
  699.         TweenService:Create(newNotification, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, 0, 0, math.max(bounds[1] + bounds[2] + 31, 60))}):Play()
  700.  
  701.         task.wait(0.15)
  702.         TweenService:Create(newNotification, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.45}):Play()
  703.         TweenService:Create(newNotification.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  704.  
  705.         task.wait(0.05)
  706.  
  707.         TweenService:Create(newNotification.Icon, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  708.  
  709.         task.wait(0.05)
  710.         TweenService:Create(newNotification.Description, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.35}):Play()
  711.         TweenService:Create(newNotification.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 0.95}):Play()
  712.         TweenService:Create(newNotification.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.82}):Play()
  713.  
  714.         local waitDuration = math.min(math.max((#newNotification.Description.Text * 0.1) + 2.5, 3), 10)
  715.         task.wait(data.Duration or waitDuration)
  716.  
  717.         newNotification.Icon.Visible = false
  718.         TweenService:Create(newNotification, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  719.         TweenService:Create(newNotification.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  720.         TweenService:Create(newNotification.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  721.         TweenService:Create(newNotification.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  722.         TweenService:Create(newNotification.Description, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  723.  
  724.         TweenService:Create(newNotification, TweenInfo.new(1, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -90, 0, 0)}):Play()
  725.  
  726.         task.wait(1)
  727.  
  728.         TweenService:Create(newNotification, TweenInfo.new(1, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -90, 0, -Notifications:FindFirstChild("UIListLayout").Padding.Offset)}):Play()
  729.  
  730.         newNotification.Visible = false
  731.         newNotification:Destroy()
  732.     end)
  733. end
  734.  
  735. local function openSearch()
  736.     searchOpen = true
  737.  
  738.     Main.Search.BackgroundTransparency = 1
  739.     Main.Search.Shadow.ImageTransparency = 1
  740.     Main.Search.Input.TextTransparency = 1
  741.     Main.Search.Search.ImageTransparency = 1
  742.     Main.Search.UIStroke.Transparency = 1
  743.     Main.Search.Size = UDim2.new(1, 0, 0, 80)
  744.     Main.Search.Position = UDim2.new(0.5, 0, 0, 70)
  745.  
  746.     Main.Search.Input.Interactable = true
  747.  
  748.     Main.Search.Visible = true
  749.  
  750.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  751.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  752.             tabbtn.Interact.Visible = false
  753.             TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  754.             TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  755.             TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  756.             TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  757.         end
  758.     end
  759.  
  760.     Main.Search.Input:CaptureFocus()
  761.     TweenService:Create(Main.Search.Shadow, TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0.95}):Play()
  762.     TweenService:Create(Main.Search, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.5, 0, 0, 57), BackgroundTransparency = 0.9}):Play()
  763.     TweenService:Create(Main.Search.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.8}):Play()
  764.     TweenService:Create(Main.Search.Input, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  765.     TweenService:Create(Main.Search.Search, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.5}):Play()
  766.     TweenService:Create(Main.Search, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -35, 0, 35)}):Play()
  767. end
  768.  
  769. local function closeSearch()
  770.     searchOpen = false
  771.  
  772.     TweenService:Create(Main.Search, TweenInfo.new(0.35, Enum.EasingStyle.Quint), {BackgroundTransparency = 1, Size = UDim2.new(1, -55, 0, 30)}):Play()
  773.     TweenService:Create(Main.Search.Search, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  774.     TweenService:Create(Main.Search.Shadow, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  775.     TweenService:Create(Main.Search.UIStroke, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  776.     TweenService:Create(Main.Search.Input, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  777.  
  778.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  779.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  780.             tabbtn.Interact.Visible = true
  781.             if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  782.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  783.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  784.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  785.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  786.             else
  787.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  788.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  789.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  790.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  791.             end
  792.         end
  793.     end
  794.  
  795.     Main.Search.Input.Text = ''
  796.     Main.Search.Input.Interactable = false
  797. end
  798.  
  799. local function Hide(notify: boolean?)
  800.     if MPrompt then
  801.         MPrompt.Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  802.         MPrompt.Position = UDim2.new(0.5, 0, 0, -50)
  803.         MPrompt.Size = UDim2.new(0, 40, 0, 10)
  804.         MPrompt.BackgroundTransparency = 1
  805.         MPrompt.Title.TextTransparency = 1
  806.         MPrompt.Visible = true
  807.     end
  808.  
  809.     task.spawn(closeSearch)
  810.  
  811.     Debounce = true
  812.     if notify then
  813.         if useMobilePrompt then
  814.             RayfieldLibrary:Notify({Title = "Interface Hidden", Content = "The interface has been hidden, you can unhide the interface by tapping 'Show Rayfield'.", Duration = 7, Image = 4400697855})
  815.         else
  816.             RayfieldLibrary:Notify({Title = "Interface Hidden", Content = `The interface has been hidden, you can unhide the interface by tapping {getSetting("General", "rayfieldOpen")}.`, Duration = 7, Image = 4400697855})
  817.         end
  818.     end
  819.  
  820.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 470, 0, 0)}):Play()
  821.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 470, 0, 45)}):Play()
  822.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  823.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  824.     TweenService:Create(Main.Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  825.     TweenService:Create(Main.Topbar.CornerRepair, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  826.     TweenService:Create(Main.Topbar.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  827.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  828.     TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  829.     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  830.  
  831.     if useMobilePrompt and MPrompt then
  832.         TweenService:Create(MPrompt, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 120, 0, 30), Position = UDim2.new(0.5, 0, 0, 20), BackgroundTransparency = 0.3}):Play()
  833.         TweenService:Create(MPrompt.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0.3}):Play()
  834.     end
  835.  
  836.     for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  837.         if TopbarButton.ClassName == "ImageButton" then
  838.             TweenService:Create(TopbarButton, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  839.         end
  840.     end
  841.  
  842.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  843.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  844.             TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  845.             TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  846.             TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  847.             TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  848.         end
  849.     end
  850.  
  851.     dragInteract.Visible = false
  852.  
  853.     for _, tab in ipairs(Elements:GetChildren()) do
  854.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  855.             for _, element in ipairs(tab:GetChildren()) do
  856.                 if element.ClassName == "Frame" then
  857.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  858.                         if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  859.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  860.                         elseif element.Name == 'Divider' then
  861.                             TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  862.                         else
  863.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  864.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  865.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  866.                         end
  867.                         for _, child in ipairs(element:GetChildren()) do
  868.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  869.                                 child.Visible = false
  870.                             end
  871.                         end
  872.                     end
  873.                 end
  874.             end
  875.         end
  876.     end
  877.  
  878.     task.wait(0.5)
  879.     Main.Visible = false
  880.     Debounce = false
  881. end
  882.  
  883. local function Maximise()
  884.     Debounce = true
  885.     Topbar.ChangeSize.Image = "rbxassetid://"..10137941941
  886.  
  887.     TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  888.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  889.     TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  890.     TweenService:Create(Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  891.     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.7}):Play()
  892.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = useMobileSizing and UDim2.new(0, 500, 0, 275) or UDim2.new(0, 500, 0, 475)}):Play()
  893.     TweenService:Create(Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 45)}):Play()
  894.     TabList.Visible = true
  895.     task.wait(0.2)
  896.  
  897.     Elements.Visible = true
  898.  
  899.     for _, tab in ipairs(Elements:GetChildren()) do
  900.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  901.             for _, element in ipairs(tab:GetChildren()) do
  902.                 if element.ClassName == "Frame" then
  903.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  904.                         if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  905.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.4}):Play()
  906.                         elseif element.Name == 'Divider' then
  907.                             TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.85}):Play()
  908.                         else
  909.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  910.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  911.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  912.                         end
  913.                         for _, child in ipairs(element:GetChildren()) do
  914.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  915.                                 child.Visible = true
  916.                             end
  917.                         end
  918.                     end
  919.                 end
  920.             end
  921.         end
  922.     end
  923.  
  924.     task.wait(0.1)
  925.  
  926.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  927.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  928.             if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  929.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  930.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  931.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  932.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  933.             else
  934.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  935.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  936.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  937.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  938.             end
  939.  
  940.         end
  941.     end
  942.  
  943.     task.wait(0.5)
  944.     Debounce = false
  945. end
  946.  
  947.  
  948. local function Unhide()
  949.     Debounce = true
  950.     Main.Position = UDim2.new(0.5, 0, 0.5, 0)
  951.     Main.Visible = true
  952.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = useMobileSizing and UDim2.new(0, 500, 0, 275) or UDim2.new(0, 500, 0, 475)}):Play()
  953.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 45)}):Play()
  954.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  955.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  956.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  957.     TweenService:Create(Main.Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  958.     TweenService:Create(Main.Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  959.     TweenService:Create(Main.Topbar.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  960.  
  961.     if MPrompt then
  962.         TweenService:Create(MPrompt, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 40, 0, 10), Position = UDim2.new(0.5, 0, 0, -50), BackgroundTransparency = 1}):Play()
  963.         TweenService:Create(MPrompt.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  964.  
  965.         task.spawn(function()
  966.             task.wait(0.5)
  967.             MPrompt.Visible = false
  968.         end)
  969.     end
  970.  
  971.     if Minimised then
  972.         task.spawn(Maximise)
  973.     end
  974.  
  975.     dragBar.Position = useMobileSizing and UDim2.new(0.5, 0, 0.5, dragOffsetMobile) or UDim2.new(0.5, 0, 0.5, dragOffset)
  976.  
  977.     dragInteract.Visible = true
  978.  
  979.     for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  980.         if TopbarButton.ClassName == "ImageButton" then
  981.             if TopbarButton.Name == 'Icon' then
  982.                 TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  983.             else
  984.                 TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  985.             end
  986.  
  987.         end
  988.     end
  989.  
  990.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  991.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  992.             if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  993.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  994.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  995.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  996.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  997.             else
  998.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  999.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  1000.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  1001.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  1002.             end
  1003.         end
  1004.     end
  1005.  
  1006.     for _, tab in ipairs(Elements:GetChildren()) do
  1007.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  1008.             for _, element in ipairs(tab:GetChildren()) do
  1009.                 if element.ClassName == "Frame" then
  1010.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  1011.                         if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  1012.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.4}):Play()
  1013.                         elseif element.Name == 'Divider' then
  1014.                             TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.85}):Play()
  1015.                         else
  1016.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1017.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1018.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1019.                         end
  1020.                         for _, child in ipairs(element:GetChildren()) do
  1021.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  1022.                                 child.Visible = true
  1023.                             end
  1024.                         end
  1025.                     end
  1026.                 end
  1027.             end
  1028.         end
  1029.     end
  1030.  
  1031.     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.5}):Play()
  1032.  
  1033.     task.wait(0.5)
  1034.     Minimised = false
  1035.     Debounce = false
  1036. end
  1037.  
  1038. local function Minimise()
  1039.     Debounce = true
  1040.     Topbar.ChangeSize.Image = "rbxassetid://"..11036884234
  1041.  
  1042.     Topbar.UIStroke.Color = SelectedTheme.ElementStroke
  1043.  
  1044.     task.spawn(closeSearch)
  1045.  
  1046.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  1047.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  1048.             TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1049.             TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1050.             TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1051.             TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1052.         end
  1053.     end
  1054.  
  1055.     for _, tab in ipairs(Elements:GetChildren()) do
  1056.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  1057.             for _, element in ipairs(tab:GetChildren()) do
  1058.                 if element.ClassName == "Frame" then
  1059.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  1060.                         if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  1061.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1062.                         elseif element.Name == 'Divider' then
  1063.                             TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1064.                         else
  1065.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1066.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1067.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1068.                         end
  1069.                         for _, child in ipairs(element:GetChildren()) do
  1070.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  1071.                                 child.Visible = false
  1072.                             end
  1073.                         end
  1074.                     end
  1075.                 end
  1076.             end
  1077.         end
  1078.     end
  1079.  
  1080.     TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1081.     TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1082.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1083.     TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1084.     TweenService:Create(Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1085.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 495, 0, 45)}):Play()
  1086.     TweenService:Create(Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 495, 0, 45)}):Play()
  1087.  
  1088.     task.wait(0.3)
  1089.  
  1090.     Elements.Visible = false
  1091.     TabList.Visible = false
  1092.  
  1093.     task.wait(0.2)
  1094.     Debounce = false
  1095. end
  1096.  
  1097. local function saveSettings() -- Save settings to config file
  1098.     local encoded
  1099.     local success, err = pcall(function()
  1100.         encoded = HttpService:JSONEncode(settingsTable)
  1101.     end)
  1102.  
  1103.     if success then
  1104.         if useStudio then
  1105.             if script.Parent['get.val'] then
  1106.                 script.Parent['get.val'].Value = encoded
  1107.             end
  1108.         end
  1109.         if writefile then
  1110.             writefile(RayfieldFolder..'/settings'..ConfigurationExtension, encoded)
  1111.         end
  1112.     end
  1113. end
  1114.  
  1115. local function updateSetting(category: string, setting: string, value: any)
  1116.     if not settingsInitialized then
  1117.         return
  1118.     end
  1119.     settingsTable[category][setting].Value = value
  1120.     overriddenSettings[`{category}.{setting}`] = nil -- If user changes an overriden setting, remove the override
  1121.     saveSettings()
  1122. end
  1123.  
  1124. local function createSettings(window)
  1125.     if not (writefile and isfile and readfile and isfolder and makefolder) and not useStudio then
  1126.         if Topbar['Settings'] then Topbar.Settings.Visible = false end
  1127.         Topbar['Search'].Position = UDim2.new(1, -75, 0.5, 0)
  1128.         warn('Can\'t create settings as no file-saving functionality is available.')
  1129.         return
  1130.     end
  1131.  
  1132.     local newTab = window:CreateTab('Rayfield Settings', 0, true)
  1133.  
  1134.     if TabList['Rayfield Settings'] then
  1135.         TabList['Rayfield Settings'].LayoutOrder = 1000
  1136.     end
  1137.  
  1138.     if Elements['Rayfield Settings'] then
  1139.         Elements['Rayfield Settings'].LayoutOrder = 1000
  1140.     end
  1141.  
  1142.     -- Create sections and elements
  1143.     for categoryName, settingCategory in pairs(settingsTable) do
  1144.         newTab:CreateSection(categoryName)
  1145.  
  1146.         for settingName, setting in pairs(settingCategory) do
  1147.             if setting.Type == 'input' then
  1148.                 setting.Element = newTab:CreateInput({
  1149.                     Name = setting.Name,
  1150.                     CurrentValue = setting.Value,
  1151.                     PlaceholderText = setting.Placeholder,
  1152.                     Ext = true,
  1153.                     RemoveTextAfterFocusLost = setting.ClearOnFocus,
  1154.                     Callback = function(Value)
  1155.                         updateSetting(categoryName, settingName, Value)
  1156.                     end,
  1157.                 })
  1158.             elseif setting.Type == 'toggle' then
  1159.                 setting.Element = newTab:CreateToggle({
  1160.                     Name = setting.Name,
  1161.                     CurrentValue = setting.Value,
  1162.                     Ext = true,
  1163.                     Callback = function(Value)
  1164.                         updateSetting(categoryName, settingName, Value)
  1165.                     end,
  1166.                 })
  1167.             elseif setting.Type == 'bind' then
  1168.                 setting.Element = newTab:CreateKeybind({
  1169.                     Name = setting.Name,
  1170.                     CurrentKeybind = setting.Value,
  1171.                     HoldToInteract = false,
  1172.                     Ext = true,
  1173.                     CallOnChange = true,
  1174.                     Callback = function(Value)
  1175.                         updateSetting(categoryName, settingName, Value)
  1176.                     end,
  1177.                 })
  1178.             end
  1179.         end
  1180.     end
  1181.  
  1182.     settingsCreated = true
  1183.     loadSettings()
  1184.     saveSettings()
  1185. end
  1186.  
  1187.  
  1188.  
  1189. function RayfieldLibrary:CreateWindow(Settings)
  1190.     if Rayfield:FindFirstChild('Loading') then
  1191.         if getgenv and not getgenv().rayfieldCached then
  1192.             Rayfield.Enabled = true
  1193.             Rayfield.Loading.Visible = true
  1194.  
  1195.             task.wait(1.4)
  1196.             Rayfield.Loading.Visible = false
  1197.         end
  1198.     end
  1199.  
  1200.     if getgenv then getgenv().rayfieldCached = true end
  1201.  
  1202.     if not correctBuild and not Settings.DisableBuildWarnings then
  1203.         task.delay(3,
  1204.             function()
  1205.                 RayfieldLibrary:Notify({Title = 'Build Mismatch', Content = 'Rayfield may encounter issues as you are running an incompatible interface version ('.. ((Rayfield:FindFirstChild('Build') and Rayfield.Build.Value) or 'No Build') ..').\n\nThis version of Rayfield is intended for interface build '..InterfaceBuild..'.\n\nTry rejoining and then run the script twice.', Image = 4335487866, Duration = 15})     
  1206.             end)
  1207.     end
  1208.  
  1209.     if Settings.ToggleUIKeybind then -- Can either be a string or an Enum.KeyCode
  1210.         local keybind = Settings.ToggleUIKeybind
  1211.         if type(keybind) == "string" then
  1212.             keybind = string.upper(keybind)
  1213.             assert(pcall(function()
  1214.                 return Enum.KeyCode[keybind]
  1215.             end), "ToggleUIKeybind must be a valid KeyCode")
  1216.             overrideSetting("General", "rayfieldOpen", keybind)
  1217.         elseif typeof(keybind) == "EnumItem" then
  1218.             assert(keybind.EnumType == Enum.KeyCode, "ToggleUIKeybind must be a KeyCode enum")
  1219.             overrideSetting("General", "rayfieldOpen", keybind.Name)
  1220.         else
  1221.             error("ToggleUIKeybind must be a string or KeyCode enum")
  1222.         end
  1223.     end
  1224.  
  1225.     if isfolder and not isfolder(RayfieldFolder) then
  1226.         makefolder(RayfieldFolder)
  1227.     end
  1228.  
  1229.     local Passthrough = false
  1230.     Topbar.Title.Text = Settings.Name
  1231.  
  1232.     Main.Size = UDim2.new(0, 420, 0, 100)
  1233.     Main.Visible = true
  1234.     Main.BackgroundTransparency = 1
  1235.     if Main:FindFirstChild('Notice') then Main.Notice.Visible = false end
  1236.     Main.Shadow.Image.ImageTransparency = 1
  1237.  
  1238.     LoadingFrame.Title.TextTransparency = 1
  1239.     LoadingFrame.Subtitle.TextTransparency = 1
  1240.  
  1241.     LoadingFrame.Version.TextTransparency = 1
  1242.     LoadingFrame.Title.Text = Settings.LoadingTitle or "Rayfield"
  1243.     LoadingFrame.Subtitle.Text = Settings.LoadingSubtitle or "Interface Suite"
  1244.  
  1245.     if Settings.LoadingTitle ~= "Rayfield Interface Suite" then
  1246.         LoadingFrame.Version.Text = "Rayfield UI"
  1247.     end
  1248.  
  1249.     if Settings.Icon and Settings.Icon ~= 0 and Topbar:FindFirstChild('Icon') then
  1250.         Topbar.Icon.Visible = true
  1251.         Topbar.Title.Position = UDim2.new(0, 47, 0.5, 0)
  1252.  
  1253.         if Settings.Icon then
  1254.             if typeof(Settings.Icon) == 'string' and Icons then
  1255.                 local asset = getIcon(Settings.Icon)
  1256.  
  1257.                 Topbar.Icon.Image = 'rbxassetid://'..asset.id
  1258.                 Topbar.Icon.ImageRectOffset = asset.imageRectOffset
  1259.                 Topbar.Icon.ImageRectSize = asset.imageRectSize
  1260.             else
  1261.                 Topbar.Icon.Image = getAssetUri(Settings.Icon)
  1262.             end
  1263.         else
  1264.             Topbar.Icon.Image = "rbxassetid://" .. 0
  1265.         end
  1266.     end
  1267.  
  1268.     if dragBar then
  1269.         dragBar.Visible = false
  1270.         dragBarCosmetic.BackgroundTransparency = 1
  1271.         dragBar.Visible = true
  1272.     end
  1273.  
  1274.     if Settings.Theme then
  1275.         local success, result = pcall(ChangeTheme, Settings.Theme)
  1276.         if not success then
  1277.             local success, result2 = pcall(ChangeTheme, 'Default')
  1278.             if not success then
  1279.                 warn('CRITICAL ERROR - NO DEFAULT THEME')
  1280.                 print(result2)
  1281.             end
  1282.             warn('issue rendering theme. no theme on file')
  1283.             print(result)
  1284.         end
  1285.     end
  1286.  
  1287.     Topbar.Visible = false
  1288.     Elements.Visible = false
  1289.     LoadingFrame.Visible = true
  1290.  
  1291.     if not Settings.DisableRayfieldPrompts then
  1292.         task.spawn(function()
  1293.             while true do
  1294.                 task.wait(math.random(180, 600))
  1295.                 RayfieldLibrary:Notify({
  1296.                     Title = "Rayfield Interface",
  1297.                     Content = "Enjoying this UI library? Find it at sirius.menu/discord",
  1298.                     Duration = 7,
  1299.                     Image = 4370033185,
  1300.                 })
  1301.             end
  1302.         end)
  1303.     end
  1304.  
  1305.     pcall(function()
  1306.         if not Settings.ConfigurationSaving.FileName then
  1307.             Settings.ConfigurationSaving.FileName = tostring(game.PlaceId)
  1308.         end
  1309.  
  1310.         if Settings.ConfigurationSaving.Enabled == nil then
  1311.             Settings.ConfigurationSaving.Enabled = false
  1312.         end
  1313.  
  1314.         CFileName = Settings.ConfigurationSaving.FileName
  1315.         ConfigurationFolder = Settings.ConfigurationSaving.FolderName or ConfigurationFolder
  1316.         CEnabled = Settings.ConfigurationSaving.Enabled
  1317.  
  1318.         if Settings.ConfigurationSaving.Enabled then
  1319.             if not isfolder(ConfigurationFolder) then
  1320.                 makefolder(ConfigurationFolder)
  1321.             end
  1322.         end
  1323.     end)
  1324.  
  1325.  
  1326.     makeDraggable(Main, Topbar, false, {dragOffset, dragOffsetMobile})
  1327.     if dragBar then dragBar.Position = useMobileSizing and UDim2.new(0.5, 0, 0.5, dragOffsetMobile) or UDim2.new(0.5, 0, 0.5, dragOffset) makeDraggable(Main, dragInteract, true, {dragOffset, dragOffsetMobile}) end
  1328.  
  1329.     for _, TabButton in ipairs(TabList:GetChildren()) do
  1330.         if TabButton.ClassName == "Frame" and TabButton.Name ~= "Placeholder" then
  1331.             TabButton.BackgroundTransparency = 1
  1332.             TabButton.Title.TextTransparency = 1
  1333.             TabButton.Image.ImageTransparency = 1
  1334.             TabButton.UIStroke.Transparency = 1
  1335.         end
  1336.     end
  1337.  
  1338.     if Settings.Discord and Settings.Discord.Enabled and not useStudio then
  1339.         if isfolder and not isfolder(RayfieldFolder.."/Discord Invites") then
  1340.             makefolder(RayfieldFolder.."/Discord Invites")
  1341.         end
  1342.  
  1343.         if isfile and not isfile(RayfieldFolder.."/Discord Invites".."/"..Settings.Discord.Invite..ConfigurationExtension) then
  1344.             if request then
  1345.                 pcall(function()
  1346.                     request({
  1347.                         Url = 'http://127.0.0.1:6463/rpc?v=1',
  1348.                         Method = 'POST',
  1349.                         Headers = {
  1350.                             ['Content-Type'] = 'application/json',
  1351.                             Origin = 'https://discord.com'
  1352.                         },
  1353.                         Body = HttpService:JSONEncode({
  1354.                             cmd = 'INVITE_BROWSER',
  1355.                             nonce = HttpService:GenerateGUID(false),
  1356.                             args = {code = Settings.Discord.Invite}
  1357.                         })
  1358.                     })
  1359.                 end)
  1360.             end
  1361.  
  1362.             if Settings.Discord.RememberJoins then -- We do logic this way so if the developer changes this setting, the user still won't be prompted, only new users
  1363.                 writefile(RayfieldFolder.."/Discord Invites".."/"..Settings.Discord.Invite..ConfigurationExtension,"Rayfield RememberJoins is true for this invite, this invite will not ask you to join again")
  1364.             end
  1365.         end
  1366.     end
  1367.  
  1368.     if (Settings.KeySystem) then
  1369.         if not Settings.KeySettings then
  1370.             Passthrough = true
  1371.             return
  1372.         end
  1373.  
  1374.         if isfolder and not isfolder(RayfieldFolder.."/Key System") then
  1375.             makefolder(RayfieldFolder.."/Key System")
  1376.         end
  1377.  
  1378.         if typeof(Settings.KeySettings.Key) == "string" then Settings.KeySettings.Key = {Settings.KeySettings.Key} end
  1379.  
  1380.         if Settings.KeySettings.GrabKeyFromSite then
  1381.             for i, Key in ipairs(Settings.KeySettings.Key) do
  1382.                 local Success, Response = pcall(function()
  1383.                     Settings.KeySettings.Key[i] = tostring(game:HttpGet(Key):gsub("[\n\r]", " "))
  1384.                     Settings.KeySettings.Key[i] = string.gsub(Settings.KeySettings.Key[i], " ", "")
  1385.                 end)
  1386.                 if not Success then
  1387.                     print("Rayfield | "..Key.." Error " ..tostring(Response))
  1388.                     warn('Check docs.sirius.menu for help with Rayfield specific development.')
  1389.                 end
  1390.             end
  1391.         end
  1392.  
  1393.         if not Settings.KeySettings.FileName then
  1394.             Settings.KeySettings.FileName = "No file name specified"
  1395.         end
  1396.  
  1397.         if isfile and isfile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension) then
  1398.             for _, MKey in ipairs(Settings.KeySettings.Key) do
  1399.                 if string.find(readfile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension), MKey) then
  1400.                     Passthrough = true
  1401.                 end
  1402.             end
  1403.         end
  1404.  
  1405.         if not Passthrough then
  1406.             local AttemptsRemaining = math.random(2, 5)
  1407.             Rayfield.Enabled = false
  1408.             local KeyUI = useStudio and script.Parent:FindFirstChild('Key') or game:GetObjects("rbxassetid://11380036235")[1]
  1409.  
  1410.             KeyUI.Enabled = true
  1411.  
  1412.             if gethui then
  1413.                 KeyUI.Parent = gethui()
  1414.             elseif syn and syn.protect_gui then
  1415.                 syn.protect_gui(KeyUI)
  1416.                 KeyUI.Parent = CoreGui
  1417.             elseif not useStudio and CoreGui:FindFirstChild("RobloxGui") then
  1418.                 KeyUI.Parent = CoreGui:FindFirstChild("RobloxGui")
  1419.             elseif not useStudio then
  1420.                 KeyUI.Parent = CoreGui
  1421.             end
  1422.  
  1423.             if gethui then
  1424.                 for _, Interface in ipairs(gethui():GetChildren()) do
  1425.                     if Interface.Name == KeyUI.Name and Interface ~= KeyUI then
  1426.                         Interface.Enabled = false
  1427.                         Interface.Name = "KeyUI-Old"
  1428.                     end
  1429.                 end
  1430.             elseif not useStudio then
  1431.                 for _, Interface in ipairs(CoreGui:GetChildren()) do
  1432.                     if Interface.Name == KeyUI.Name and Interface ~= KeyUI then
  1433.                         Interface.Enabled = false
  1434.                         Interface.Name = "KeyUI-Old"
  1435.                     end
  1436.                 end
  1437.             end
  1438.  
  1439.             local KeyMain = KeyUI.Main
  1440.             KeyMain.Title.Text = Settings.KeySettings.Title or Settings.Name
  1441.             KeyMain.Subtitle.Text = Settings.KeySettings.Subtitle or "Key System"
  1442.             KeyMain.NoteMessage.Text = Settings.KeySettings.Note or "No instructions"
  1443.  
  1444.             KeyMain.Size = UDim2.new(0, 467, 0, 175)
  1445.             KeyMain.BackgroundTransparency = 1
  1446.             KeyMain.Shadow.Image.ImageTransparency = 1
  1447.             KeyMain.Title.TextTransparency = 1
  1448.             KeyMain.Subtitle.TextTransparency = 1
  1449.             KeyMain.KeyNote.TextTransparency = 1
  1450.             KeyMain.Input.BackgroundTransparency = 1
  1451.             KeyMain.Input.UIStroke.Transparency = 1
  1452.             KeyMain.Input.InputBox.TextTransparency = 1
  1453.             KeyMain.NoteTitle.TextTransparency = 1
  1454.             KeyMain.NoteMessage.TextTransparency = 1
  1455.             KeyMain.Hide.ImageTransparency = 1
  1456.  
  1457.             TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1458.             TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 187)}):Play()
  1459.             TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 0.5}):Play()
  1460.             task.wait(0.05)
  1461.             TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1462.             TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1463.             task.wait(0.05)
  1464.             TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1465.             TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1466.             TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1467.             TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1468.             task.wait(0.05)
  1469.             TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1470.             TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1471.             task.wait(0.15)
  1472.             TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 0.3}):Play()
  1473.  
  1474.  
  1475.             KeyUI.Main.Input.InputBox.FocusLost:Connect(function()
  1476.                 if #KeyUI.Main.Input.InputBox.Text == 0 then return end
  1477.                 local KeyFound = false
  1478.                 local FoundKey = ''
  1479.                 for _, MKey in ipairs(Settings.KeySettings.Key) do
  1480.                     --if string.find(KeyMain.Input.InputBox.Text, MKey) then
  1481.                     --  KeyFound = true
  1482.                     --  FoundKey = MKey
  1483.                     --end
  1484.  
  1485.  
  1486.                     -- stricter key check
  1487.                     if KeyMain.Input.InputBox.Text == MKey then
  1488.                         KeyFound = true
  1489.                         FoundKey = MKey
  1490.                     end
  1491.                 end
  1492.                 if KeyFound then
  1493.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1494.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1495.                     TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1496.                     TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1497.                     TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1498.                     TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1499.                     TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1500.                     TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1501.                     TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1502.                     TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1503.                     TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1504.                     TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1505.                     task.wait(0.51)
  1506.                     Passthrough = true
  1507.                     KeyMain.Visible = false
  1508.                     if Settings.KeySettings.SaveKey then
  1509.                         if writefile then
  1510.                             writefile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension, FoundKey)
  1511.                         end
  1512.                         RayfieldLibrary:Notify({Title = "Key System", Content = "The key for this script has been saved successfully.", Image = 3605522284})
  1513.                     end
  1514.                 else
  1515.                     if AttemptsRemaining == 0 then
  1516.                         TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1517.                         TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1518.                         TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1519.                         TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1520.                         TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1521.                         TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1522.                         TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1523.                         TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1524.                         TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1525.                         TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1526.                         TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1527.                         TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1528.                         task.wait(0.45)
  1529.                         Players.LocalPlayer:Kick("No Attempts Remaining")
  1530.                         game:Shutdown()
  1531.                     end
  1532.                     KeyMain.Input.InputBox.Text = ""
  1533.                     AttemptsRemaining = AttemptsRemaining - 1
  1534.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1535.                     TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Elastic), {Position = UDim2.new(0.495,0,0.5,0)}):Play()
  1536.                     task.wait(0.1)
  1537.                     TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Elastic), {Position = UDim2.new(0.505,0,0.5,0)}):Play()
  1538.                     task.wait(0.1)
  1539.                     TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.5,0,0.5,0)}):Play()
  1540.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 187)}):Play()
  1541.                 end
  1542.             end)
  1543.  
  1544.             KeyMain.Hide.MouseButton1Click:Connect(function()
  1545.                 TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1546.                 TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1547.                 TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1548.                 TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1549.                 TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1550.                 TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1551.                 TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1552.                 TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1553.                 TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1554.                 TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1555.                 TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1556.                 TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1557.                 task.wait(0.51)
  1558.                 RayfieldLibrary:Destroy()
  1559.                 KeyUI:Destroy()
  1560.             end)
  1561.         else
  1562.             Passthrough = true
  1563.         end
  1564.     end
  1565.     if Settings.KeySystem then
  1566.         repeat task.wait() until Passthrough
  1567.     end
  1568.  
  1569.     Notifications.Template.Visible = false
  1570.     Notifications.Visible = true
  1571.     Rayfield.Enabled = true
  1572.  
  1573.     task.wait(0.5)
  1574.     TweenService:Create(Main, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1575.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  1576.     task.wait(0.1)
  1577.     TweenService:Create(LoadingFrame.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1578.     task.wait(0.05)
  1579.     TweenService:Create(LoadingFrame.Subtitle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1580.     task.wait(0.05)
  1581.     TweenService:Create(LoadingFrame.Version, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1582.  
  1583.  
  1584.     Elements.Template.LayoutOrder = 100000
  1585.     Elements.Template.Visible = false
  1586.  
  1587.     Elements.UIPageLayout.FillDirection = Enum.FillDirection.Horizontal
  1588.     TabList.Template.Visible = false
  1589.  
  1590.     -- Tab
  1591.     local FirstTab = false
  1592.     local Window = {}
  1593.     function Window:CreateTab(Name, Image, Ext)
  1594.         local SDone = false
  1595.         local TabButton = TabList.Template:Clone()
  1596.         TabButton.Name = Name
  1597.         TabButton.Title.Text = Name
  1598.         TabButton.Parent = TabList
  1599.         TabButton.Title.TextWrapped = false
  1600.         TabButton.Size = UDim2.new(0, TabButton.Title.TextBounds.X + 30, 0, 30)
  1601.  
  1602.         if Image and Image ~= 0 then
  1603.             if typeof(Image) == 'string' and Icons then
  1604.                 local asset = getIcon(Image)
  1605.  
  1606.                 TabButton.Image.Image = 'rbxassetid://'..asset.id
  1607.                 TabButton.Image.ImageRectOffset = asset.imageRectOffset
  1608.                 TabButton.Image.ImageRectSize = asset.imageRectSize
  1609.             else
  1610.                 TabButton.Image.Image = getAssetUri(Image)
  1611.             end
  1612.  
  1613.             TabButton.Title.AnchorPoint = Vector2.new(0, 0.5)
  1614.             TabButton.Title.Position = UDim2.new(0, 37, 0.5, 0)
  1615.             TabButton.Image.Visible = true
  1616.             TabButton.Title.TextXAlignment = Enum.TextXAlignment.Left
  1617.             TabButton.Size = UDim2.new(0, TabButton.Title.TextBounds.X + 52, 0, 30)
  1618.         end
  1619.  
  1620.  
  1621.  
  1622.         TabButton.BackgroundTransparency = 1
  1623.         TabButton.Title.TextTransparency = 1
  1624.         TabButton.Image.ImageTransparency = 1
  1625.         TabButton.UIStroke.Transparency = 1
  1626.  
  1627.         TabButton.Visible = not Ext or false
  1628.  
  1629.         -- Create Elements Page
  1630.         local TabPage = Elements.Template:Clone()
  1631.         TabPage.Name = Name
  1632.         TabPage.Visible = true
  1633.  
  1634.         TabPage.LayoutOrder = #Elements:GetChildren() or Ext and 10000
  1635.  
  1636.         for _, TemplateElement in ipairs(TabPage:GetChildren()) do
  1637.             if TemplateElement.ClassName == "Frame" and TemplateElement.Name ~= "Placeholder" then
  1638.                 TemplateElement:Destroy()
  1639.             end
  1640.         end
  1641.  
  1642.         TabPage.Parent = Elements
  1643.         if not FirstTab and not Ext then
  1644.             Elements.UIPageLayout.Animated = false
  1645.             Elements.UIPageLayout:JumpTo(TabPage)
  1646.             Elements.UIPageLayout.Animated = true
  1647.         end
  1648.  
  1649.         TabButton.UIStroke.Color = SelectedTheme.TabStroke
  1650.  
  1651.         if Elements.UIPageLayout.CurrentPage == TabPage then
  1652.             TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  1653.             TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  1654.             TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  1655.         else
  1656.             TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  1657.             TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  1658.             TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  1659.         end
  1660.  
  1661.  
  1662.         -- Animate
  1663.         task.wait(0.1)
  1664.         if FirstTab or Ext then
  1665.             TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  1666.             TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  1667.             TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  1668.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  1669.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  1670.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  1671.             TweenService:Create(TabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  1672.         elseif not Ext then
  1673.             FirstTab = Name
  1674.             TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  1675.             TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  1676.             TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  1677.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  1678.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1679.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1680.         end
  1681.  
  1682.  
  1683.         TabButton.Interact.MouseButton1Click:Connect(function()
  1684.             if Minimised then return end
  1685.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1686.             TweenService:Create(TabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1687.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1688.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  1689.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.TabBackgroundSelected}):Play()
  1690.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextColor3 = SelectedTheme.SelectedTabTextColor}):Play()
  1691.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageColor3 = SelectedTheme.SelectedTabTextColor}):Play()
  1692.  
  1693.             for _, OtherTabButton in ipairs(TabList:GetChildren()) do
  1694.                 if OtherTabButton.Name ~= "Template" and OtherTabButton.ClassName == "Frame" and OtherTabButton ~= TabButton and OtherTabButton.Name ~= "Placeholder" then
  1695.                     TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.TabBackground}):Play()
  1696.                     TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextColor3 = SelectedTheme.TabTextColor}):Play()
  1697.                     TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageColor3 = SelectedTheme.TabTextColor}):Play()
  1698.                     TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  1699.                     TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  1700.                     TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  1701.                     TweenService:Create(OtherTabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  1702.                 end
  1703.             end
  1704.  
  1705.             if Elements.UIPageLayout.CurrentPage ~= TabPage then
  1706.                 Elements.UIPageLayout:JumpTo(TabPage)
  1707.             end
  1708.         end)
  1709.  
  1710.         local Tab = {}
  1711.  
  1712.         -- Button
  1713.         function Tab:CreateButton(ButtonSettings)
  1714.             local ButtonValue = {}
  1715.  
  1716.             local Button = Elements.Template.Button:Clone()
  1717.             Button.Name = ButtonSettings.Name
  1718.             Button.Title.Text = ButtonSettings.Name
  1719.             Button.Visible = true
  1720.             Button.Parent = TabPage
  1721.  
  1722.             Button.BackgroundTransparency = 1
  1723.             Button.UIStroke.Transparency = 1
  1724.             Button.Title.TextTransparency = 1
  1725.  
  1726.             TweenService:Create(Button, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1727.             TweenService:Create(Button.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1728.             TweenService:Create(Button.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play() 
  1729.  
  1730.  
  1731.             Button.Interact.MouseButton1Click:Connect(function()
  1732.                 local Success, Response = pcall(ButtonSettings.Callback)
  1733.                 -- Prevents animation from trying to play if the button's callback called RayfieldLibrary:Destroy()
  1734.                 if rayfieldDestroyed then
  1735.                     return
  1736.                 end
  1737.                 if not Success then
  1738.                     TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1739.                     TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1740.                     TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1741.                     Button.Title.Text = "Callback Error"
  1742.                     print("Rayfield | "..ButtonSettings.Name.." Callback Error " ..tostring(Response))
  1743.                     warn('Check docs.sirius.menu for help with Rayfield specific development.')
  1744.                     task.wait(0.5)
  1745.                     Button.Title.Text = ButtonSettings.Name
  1746.                     TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1747.                     TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.9}):Play()
  1748.                     TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1749.                 else
  1750.                     if not ButtonSettings.Ext then
  1751.                         SaveConfiguration(ButtonSettings.Name..'\n')
  1752.                     end
  1753.                     TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1754.                     TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1755.                     TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1756.                     task.wait(0.2)
  1757.                     TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1758.                     TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.9}):Play()
  1759.                     TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1760.                 end
  1761.             end)
  1762.  
  1763.             Button.MouseEnter:Connect(function()
  1764.                 TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1765.                 TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.7}):Play()
  1766.             end)
  1767.  
  1768.             Button.MouseLeave:Connect(function()
  1769.                 TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1770.                 TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.9}):Play()
  1771.             end)
  1772.  
  1773.             function ButtonValue:Set(NewButton)
  1774.                 Button.Title.Text = NewButton
  1775.                 Button.Name = NewButton
  1776.             end
  1777.  
  1778.             return ButtonValue
  1779.         end
  1780.  
  1781.         -- ColorPicker
  1782.         function Tab:CreateColorPicker(ColorPickerSettings) -- by Throit
  1783.             ColorPickerSettings.Type = "ColorPicker"
  1784.             local ColorPicker = Elements.Template.ColorPicker:Clone()
  1785.             local Background = ColorPicker.CPBackground
  1786.             local Display = Background.Display
  1787.             local Main = Background.MainCP
  1788.             local Slider = ColorPicker.ColorSlider
  1789.             ColorPicker.ClipsDescendants = true
  1790.             ColorPicker.Name = ColorPickerSettings.Name
  1791.             ColorPicker.Title.Text = ColorPickerSettings.Name
  1792.             ColorPicker.Visible = true
  1793.             ColorPicker.Parent = TabPage
  1794.             ColorPicker.Size = UDim2.new(1, -10, 0, 45)
  1795.             Background.Size = UDim2.new(0, 39, 0, 22)
  1796.             Display.BackgroundTransparency = 0
  1797.             Main.MainPoint.ImageTransparency = 1
  1798.             ColorPicker.Interact.Size = UDim2.new(1, 0, 1, 0)
  1799.             ColorPicker.Interact.Position = UDim2.new(0.5, 0, 0.5, 0)
  1800.             ColorPicker.RGB.Position = UDim2.new(0, 17, 0, 70)
  1801.             ColorPicker.HexInput.Position = UDim2.new(0, 17, 0, 90)
  1802.             Main.ImageTransparency = 1
  1803.             Background.BackgroundTransparency = 1
  1804.  
  1805.             for _, rgbinput in ipairs(ColorPicker.RGB:GetChildren()) do
  1806.                 if rgbinput:IsA("Frame") then
  1807.                     rgbinput.BackgroundColor3 = SelectedTheme.InputBackground
  1808.                     rgbinput.UIStroke.Color = SelectedTheme.InputStroke
  1809.                 end
  1810.             end
  1811.  
  1812.             ColorPicker.HexInput.BackgroundColor3 = SelectedTheme.InputBackground
  1813.             ColorPicker.HexInput.UIStroke.Color = SelectedTheme.InputStroke
  1814.  
  1815.             local opened = false
  1816.             local mouse = Players.LocalPlayer:GetMouse()
  1817.             Main.Image = "http://www.roblox.com/asset/?id=11415645739"
  1818.             local mainDragging = false
  1819.             local sliderDragging = false
  1820.             ColorPicker.Interact.MouseButton1Down:Connect(function()
  1821.                 task.spawn(function()
  1822.                     TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1823.                     TweenService:Create(ColorPicker.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1824.                     task.wait(0.2)
  1825.                     TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1826.                     TweenService:Create(ColorPicker.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1827.                 end)
  1828.  
  1829.                 if not opened then
  1830.                     opened = true
  1831.                     TweenService:Create(Background, TweenInfo.new(0.45, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 18, 0, 15)}):Play()
  1832.                     task.wait(0.1)
  1833.                     TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 120)}):Play()
  1834.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 173, 0, 86)}):Play()
  1835.                     TweenService:Create(Display, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1836.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.289, 0, 0.5, 0)}):Play()
  1837.                     TweenService:Create(ColorPicker.RGB, TweenInfo.new(0.8, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 40)}):Play()
  1838.                     TweenService:Create(ColorPicker.HexInput, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 73)}):Play()
  1839.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.574, 0, 1, 0)}):Play()
  1840.                     TweenService:Create(Main.MainPoint, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  1841.                     TweenService:Create(Main, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = SelectedTheme ~= RayfieldLibrary.Theme.Default and 0.25 or 0.1}):Play()
  1842.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1843.                 else
  1844.                     opened = false
  1845.                     TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  1846.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 39, 0, 22)}):Play()
  1847.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, 0, 1, 0)}):Play()
  1848.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.5, 0, 0.5, 0)}):Play()
  1849.                     TweenService:Create(ColorPicker.RGB, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 70)}):Play()
  1850.                     TweenService:Create(ColorPicker.HexInput, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 90)}):Play()
  1851.                     TweenService:Create(Display, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1852.                     TweenService:Create(Main.MainPoint, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1853.                     TweenService:Create(Main, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1854.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1855.                 end
  1856.  
  1857.             end)
  1858.  
  1859.             UserInputService.InputEnded:Connect(function(input, gameProcessed) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  1860.                     mainDragging = false
  1861.                     sliderDragging = false
  1862.                 end end)
  1863.             Main.MouseButton1Down:Connect(function()
  1864.                 if opened then
  1865.                     mainDragging = true
  1866.                 end
  1867.             end)
  1868.             Main.MainPoint.MouseButton1Down:Connect(function()
  1869.                 if opened then
  1870.                     mainDragging = true
  1871.                 end
  1872.             end)
  1873.             Slider.MouseButton1Down:Connect(function()
  1874.                 sliderDragging = true
  1875.             end)
  1876.             Slider.SliderPoint.MouseButton1Down:Connect(function()
  1877.                 sliderDragging = true
  1878.             end)
  1879.             local h,s,v = ColorPickerSettings.Color:ToHSV()
  1880.             local color = Color3.fromHSV(h,s,v)
  1881.             local hex = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1882.             ColorPicker.HexInput.InputBox.Text = hex
  1883.             local function setDisplay()
  1884.                 --Main
  1885.                 Main.MainPoint.Position = UDim2.new(s,-Main.MainPoint.AbsoluteSize.X/2,1-v,-Main.MainPoint.AbsoluteSize.Y/2)
  1886.                 Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1887.                 Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1888.                 Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1889.                 --Slider
  1890.                 local x = h * Slider.AbsoluteSize.X
  1891.                 Slider.SliderPoint.Position = UDim2.new(0,x-Slider.SliderPoint.AbsoluteSize.X/2,0.5,0)
  1892.                 Slider.SliderPoint.ImageColor3 = Color3.fromHSV(h,1,1)
  1893.                 local color = Color3.fromHSV(h,s,v)
  1894.                 local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1895.                 ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1896.                 ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1897.                 ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1898.                 hex = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1899.                 ColorPicker.HexInput.InputBox.Text = hex
  1900.             end
  1901.             setDisplay()
  1902.             ColorPicker.HexInput.InputBox.FocusLost:Connect(function()
  1903.                 if not pcall(function()
  1904.                         local r, g, b = string.match(ColorPicker.HexInput.InputBox.Text, "^#?(%w%w)(%w%w)(%w%w)$")
  1905.                         local rgbColor = Color3.fromRGB(tonumber(r, 16),tonumber(g, 16), tonumber(b, 16))
  1906.                         h,s,v = rgbColor:ToHSV()
  1907.                         hex = ColorPicker.HexInput.InputBox.Text
  1908.                         setDisplay()
  1909.                         ColorPickerSettings.Color = rgbColor
  1910.                     end)
  1911.                 then
  1912.                     ColorPicker.HexInput.InputBox.Text = hex
  1913.                 end
  1914.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1915.                 local r,g,b = math.floor((h*255)+0.5),math.floor((s*255)+0.5),math.floor((v*255)+0.5)
  1916.                 ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1917.                 if not ColorPickerSettings.Ext then
  1918.                     SaveConfiguration(ColorPickerSettings.Flag..'\n'..tostring(ColorPickerSettings.Color))
  1919.                 end
  1920.             end)
  1921.             --RGB
  1922.             local function rgbBoxes(box,toChange)
  1923.                 local value = tonumber(box.Text)
  1924.                 local color = Color3.fromHSV(h,s,v)
  1925.                 local oldR,oldG,oldB = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1926.                 local save
  1927.                 if toChange == "R" then save = oldR;oldR = value elseif toChange == "G" then save = oldG;oldG = value else save = oldB;oldB = value end
  1928.                 if value then
  1929.                     value = math.clamp(value,0,255)
  1930.                     h,s,v = Color3.fromRGB(oldR,oldG,oldB):ToHSV()
  1931.  
  1932.                     setDisplay()
  1933.                 else
  1934.                     box.Text = tostring(save)
  1935.                 end
  1936.                 local r,g,b = math.floor((h*255)+0.5),math.floor((s*255)+0.5),math.floor((v*255)+0.5)
  1937.                 ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1938.                 if not ColorPickerSettings.Ext then
  1939.                     SaveConfiguration()
  1940.                 end
  1941.             end
  1942.             ColorPicker.RGB.RInput.InputBox.FocusLost:connect(function()
  1943.                 rgbBoxes(ColorPicker.RGB.RInput.InputBox,"R")
  1944.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1945.             end)
  1946.             ColorPicker.RGB.GInput.InputBox.FocusLost:connect(function()
  1947.                 rgbBoxes(ColorPicker.RGB.GInput.InputBox,"G")
  1948.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1949.             end)
  1950.             ColorPicker.RGB.BInput.InputBox.FocusLost:connect(function()
  1951.                 rgbBoxes(ColorPicker.RGB.BInput.InputBox,"B")
  1952.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1953.             end)
  1954.  
  1955.             RunService.RenderStepped:connect(function()
  1956.                 if mainDragging then
  1957.                     local localX = math.clamp(mouse.X-Main.AbsolutePosition.X,0,Main.AbsoluteSize.X)
  1958.                     local localY = math.clamp(mouse.Y-Main.AbsolutePosition.Y,0,Main.AbsoluteSize.Y)
  1959.                     Main.MainPoint.Position = UDim2.new(0,localX-Main.MainPoint.AbsoluteSize.X/2,0,localY-Main.MainPoint.AbsoluteSize.Y/2)
  1960.                     s = localX / Main.AbsoluteSize.X
  1961.                     v = 1 - (localY / Main.AbsoluteSize.Y)
  1962.                     Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1963.                     Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1964.                     Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1965.                     local color = Color3.fromHSV(h,s,v)
  1966.                     local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1967.                     ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1968.                     ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1969.                     ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1970.                     ColorPicker.HexInput.InputBox.Text = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1971.                     pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1972.                     ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1973.                     if not ColorPickerSettings.Ext then
  1974.                         SaveConfiguration()
  1975.                     end
  1976.                 end
  1977.                 if sliderDragging then
  1978.                     local localX = math.clamp(mouse.X-Slider.AbsolutePosition.X,0,Slider.AbsoluteSize.X)
  1979.                     h = localX / Slider.AbsoluteSize.X
  1980.                     Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1981.                     Slider.SliderPoint.Position = UDim2.new(0,localX-Slider.SliderPoint.AbsoluteSize.X/2,0.5,0)
  1982.                     Slider.SliderPoint.ImageColor3 = Color3.fromHSV(h,1,1)
  1983.                     Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1984.                     Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1985.                     local color = Color3.fromHSV(h,s,v)
  1986.                     local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1987.                     ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1988.                     ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1989.                     ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1990.                     ColorPicker.HexInput.InputBox.Text = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1991.                     pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1992.                     ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1993.                     if not ColorPickerSettings.Ext then
  1994.                         SaveConfiguration()
  1995.                     end
  1996.                 end
  1997.             end)
  1998.  
  1999.             if Settings.ConfigurationSaving then
  2000.                 if Settings.ConfigurationSaving.Enabled and ColorPickerSettings.Flag then
  2001.                     RayfieldLibrary.Flags[ColorPickerSettings.Flag] = ColorPickerSettings
  2002.                 end
  2003.             end
  2004.  
  2005.             function ColorPickerSettings:Set(RGBColor)
  2006.                 ColorPickerSettings.Color = RGBColor
  2007.                 h,s,v = ColorPickerSettings.Color:ToHSV()
  2008.                 color = Color3.fromHSV(h,s,v)
  2009.                 setDisplay()
  2010.             end
  2011.  
  2012.             ColorPicker.MouseEnter:Connect(function()
  2013.                 TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2014.             end)
  2015.  
  2016.             ColorPicker.MouseLeave:Connect(function()
  2017.                 TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2018.             end)
  2019.  
  2020.             Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2021.                 for _, rgbinput in ipairs(ColorPicker.RGB:GetChildren()) do
  2022.                     if rgbinput:IsA("Frame") then
  2023.                         rgbinput.BackgroundColor3 = SelectedTheme.InputBackground
  2024.                         rgbinput.UIStroke.Color = SelectedTheme.InputStroke
  2025.                     end
  2026.                 end
  2027.  
  2028.                 ColorPicker.HexInput.BackgroundColor3 = SelectedTheme.InputBackground
  2029.                 ColorPicker.HexInput.UIStroke.Color = SelectedTheme.InputStroke
  2030.             end)
  2031.  
  2032.             return ColorPickerSettings
  2033.         end
  2034.  
  2035.         -- Section
  2036.         function Tab:CreateSection(SectionName)
  2037.  
  2038.             local SectionValue = {}
  2039.  
  2040.             if SDone then
  2041.                 local SectionSpace = Elements.Template.SectionSpacing:Clone()
  2042.                 SectionSpace.Visible = true
  2043.                 SectionSpace.Parent = TabPage
  2044.             end
  2045.  
  2046.             local Section = Elements.Template.SectionTitle:Clone()
  2047.             Section.Title.Text = SectionName
  2048.             Section.Visible = true
  2049.             Section.Parent = TabPage
  2050.  
  2051.             Section.Title.TextTransparency = 1
  2052.             TweenService:Create(Section.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.4}):Play()
  2053.  
  2054.             function SectionValue:Set(NewSection)
  2055.                 Section.Title.Text = NewSection
  2056.             end
  2057.  
  2058.             SDone = true
  2059.  
  2060.             return SectionValue
  2061.         end
  2062.  
  2063.         -- Divider
  2064.         function Tab:CreateDivider()
  2065.             local DividerValue = {}
  2066.  
  2067.             local Divider = Elements.Template.Divider:Clone()
  2068.             Divider.Visible = true
  2069.             Divider.Parent = TabPage
  2070.  
  2071.             Divider.Divider.BackgroundTransparency = 1
  2072.             TweenService:Create(Divider.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.85}):Play()
  2073.  
  2074.             function DividerValue:Set(Value)
  2075.                 Divider.Visible = Value
  2076.             end
  2077.  
  2078.             return DividerValue
  2079.         end
  2080.  
  2081.         -- Label
  2082.         function Tab:CreateLabel(LabelText : string, Icon: number, Color : Color3, IgnoreTheme : boolean)
  2083.             local LabelValue = {}
  2084.  
  2085.             local Label = Elements.Template.Label:Clone()
  2086.             Label.Title.Text = LabelText
  2087.             Label.Visible = true
  2088.             Label.Parent = TabPage
  2089.  
  2090.             Label.BackgroundColor3 = Color or SelectedTheme.SecondaryElementBackground
  2091.             Label.UIStroke.Color = Color or SelectedTheme.SecondaryElementStroke
  2092.  
  2093.             if Icon then
  2094.                 if typeof(Icon) == 'string' and Icons then
  2095.                     local asset = getIcon(Icon)
  2096.  
  2097.                     Label.Icon.Image = 'rbxassetid://'..asset.id
  2098.                     Label.Icon.ImageRectOffset = asset.imageRectOffset
  2099.                     Label.Icon.ImageRectSize = asset.imageRectSize
  2100.                 else
  2101.                     Label.Icon.Image = getAssetUri(Icon)
  2102.                 end
  2103.             else
  2104.                 Label.Icon.Image = "rbxassetid://" .. 0
  2105.             end
  2106.  
  2107.             if Icon and Label:FindFirstChild('Icon') then
  2108.                 Label.Title.Position = UDim2.new(0, 45, 0.5, 0)
  2109.                 Label.Title.Size = UDim2.new(1, -100, 0, 14)
  2110.  
  2111.                 if Icon then
  2112.                     if typeof(Icon) == 'string' and Icons then
  2113.                         local asset = getIcon(Icon)
  2114.  
  2115.                         Label.Icon.Image = 'rbxassetid://'..asset.id
  2116.                         Label.Icon.ImageRectOffset = asset.imageRectOffset
  2117.                         Label.Icon.ImageRectSize = asset.imageRectSize
  2118.                     else
  2119.                         Label.Icon.Image = getAssetUri(Icon)
  2120.                     end
  2121.                 else
  2122.                     Label.Icon.Image = "rbxassetid://" .. 0
  2123.                 end
  2124.  
  2125.                 Label.Icon.Visible = true
  2126.             end
  2127.  
  2128.             Label.Icon.ImageTransparency = 1
  2129.             Label.BackgroundTransparency = 1
  2130.             Label.UIStroke.Transparency = 1
  2131.             Label.Title.TextTransparency = 1
  2132.  
  2133.             TweenService:Create(Label, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = Color and 0.8 or 0}):Play()
  2134.             TweenService:Create(Label.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = Color and 0.7 or 0}):Play()
  2135.             TweenService:Create(Label.Icon, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  2136.             TweenService:Create(Label.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = Color and 0.2 or 0}):Play() 
  2137.  
  2138.             function LabelValue:Set(NewLabel, Icon, Color)
  2139.                 Label.Title.Text = NewLabel
  2140.  
  2141.                 if Color then
  2142.                     Label.BackgroundColor3 = Color or SelectedTheme.SecondaryElementBackground
  2143.                     Label.UIStroke.Color = Color or SelectedTheme.SecondaryElementStroke
  2144.                 end
  2145.  
  2146.                 if Icon and Label:FindFirstChild('Icon') then
  2147.                     Label.Title.Position = UDim2.new(0, 45, 0.5, 0)
  2148.                     Label.Title.Size = UDim2.new(1, -100, 0, 14)
  2149.  
  2150.                     if Icon then
  2151.                         if typeof(Icon) == 'string' and Icons then
  2152.                             local asset = getIcon(Icon)
  2153.  
  2154.                             Label.Icon.Image = 'rbxassetid://'..asset.id
  2155.                             Label.Icon.ImageRectOffset = asset.imageRectOffset
  2156.                             Label.Icon.ImageRectSize = asset.imageRectSize
  2157.                         else
  2158.                             Label.Icon.Image = getAssetUri(Icon)
  2159.                         end
  2160.                     else
  2161.                         Label.Icon.Image = "rbxassetid://" .. 0
  2162.                     end
  2163.  
  2164.                     Label.Icon.Visible = true
  2165.                 end
  2166.             end
  2167.  
  2168.             Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2169.                 Label.BackgroundColor3 = IgnoreTheme and (Color or Label.BackgroundColor3) or SelectedTheme.SecondaryElementBackground
  2170.                 Label.UIStroke.Color = IgnoreTheme and (Color or Label.BackgroundColor3) or SelectedTheme.SecondaryElementStroke
  2171.             end)
  2172.  
  2173.             return LabelValue
  2174.         end
  2175.  
  2176.         -- Paragraph
  2177.         function Tab:CreateParagraph(ParagraphSettings)
  2178.             local ParagraphValue = {}
  2179.  
  2180.             local Paragraph = Elements.Template.Paragraph:Clone()
  2181.             Paragraph.Title.Text = ParagraphSettings.Title
  2182.             Paragraph.Content.Text = ParagraphSettings.Content
  2183.             Paragraph.Visible = true
  2184.             Paragraph.Parent = TabPage
  2185.  
  2186.             Paragraph.BackgroundTransparency = 1
  2187.             Paragraph.UIStroke.Transparency = 1
  2188.             Paragraph.Title.TextTransparency = 1
  2189.             Paragraph.Content.TextTransparency = 1
  2190.  
  2191.             Paragraph.BackgroundColor3 = SelectedTheme.SecondaryElementBackground
  2192.             Paragraph.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  2193.  
  2194.             TweenService:Create(Paragraph, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2195.             TweenService:Create(Paragraph.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2196.             TweenService:Create(Paragraph.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()  
  2197.             TweenService:Create(Paragraph.Content, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2198.  
  2199.             function ParagraphValue:Set(NewParagraphSettings)
  2200.                 Paragraph.Title.Text = NewParagraphSettings.Title
  2201.                 Paragraph.Content.Text = NewParagraphSettings.Content
  2202.             end
  2203.  
  2204.             Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2205.                 Paragraph.BackgroundColor3 = SelectedTheme.SecondaryElementBackground
  2206.                 Paragraph.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  2207.             end)
  2208.  
  2209.             return ParagraphValue
  2210.         end
  2211.  
  2212.         -- Input
  2213.         function Tab:CreateInput(InputSettings)
  2214.             local Input = Elements.Template.Input:Clone()
  2215.             Input.Name = InputSettings.Name
  2216.             Input.Title.Text = InputSettings.Name
  2217.             Input.Visible = true
  2218.             Input.Parent = TabPage
  2219.  
  2220.             Input.BackgroundTransparency = 1
  2221.             Input.UIStroke.Transparency = 1
  2222.             Input.Title.TextTransparency = 1
  2223.  
  2224.             Input.InputFrame.InputBox.Text = InputSettings.CurrentValue or ''
  2225.  
  2226.             Input.InputFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2227.             Input.InputFrame.UIStroke.Color = SelectedTheme.InputStroke
  2228.  
  2229.             TweenService:Create(Input, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2230.             TweenService:Create(Input.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2231.             TweenService:Create(Input.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()  
  2232.  
  2233.             Input.InputFrame.InputBox.PlaceholderText = InputSettings.PlaceholderText
  2234.             Input.InputFrame.Size = UDim2.new(0, Input.InputFrame.InputBox.TextBounds.X + 24, 0, 30)
  2235.  
  2236.             Input.InputFrame.InputBox.FocusLost:Connect(function()
  2237.                 local Success, Response = pcall(function()
  2238.                     InputSettings.Callback(Input.InputFrame.InputBox.Text)
  2239.                     InputSettings.CurrentValue = Input.InputFrame.InputBox.Text
  2240.                 end)
  2241.  
  2242.                 if not Success then
  2243.                     TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2244.                     TweenService:Create(Input.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2245.                     Input.Title.Text = "Callback Error"
  2246.                     print("Rayfield | "..InputSettings.Name.." Callback Error " ..tostring(Response))
  2247.                     warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2248.                     task.wait(0.5)
  2249.                     Input.Title.Text = InputSettings.Name
  2250.                     TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2251.                     TweenService:Create(Input.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2252.                 end
  2253.  
  2254.                 if InputSettings.RemoveTextAfterFocusLost then
  2255.                     Input.InputFrame.InputBox.Text = ""
  2256.                 end
  2257.  
  2258.                 if not InputSettings.Ext then
  2259.                     SaveConfiguration()
  2260.                 end
  2261.             end)
  2262.  
  2263.             Input.MouseEnter:Connect(function()
  2264.                 TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2265.             end)
  2266.  
  2267.             Input.MouseLeave:Connect(function()
  2268.                 TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2269.             end)
  2270.  
  2271.             Input.InputFrame.InputBox:GetPropertyChangedSignal("Text"):Connect(function()
  2272.                 TweenService:Create(Input.InputFrame, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Input.InputFrame.InputBox.TextBounds.X + 24, 0, 30)}):Play()
  2273.             end)
  2274.  
  2275.             function InputSettings:Set(text)
  2276.                 Input.InputFrame.InputBox.Text = text
  2277.                 InputSettings.CurrentValue = text
  2278.  
  2279.                 local Success, Response = pcall(function()
  2280.                     InputSettings.Callback(text)
  2281.                 end)
  2282.  
  2283.                 if not InputSettings.Ext then
  2284.                     SaveConfiguration()
  2285.                 end
  2286.             end
  2287.  
  2288.             if Settings.ConfigurationSaving then
  2289.                 if Settings.ConfigurationSaving.Enabled and InputSettings.Flag then
  2290.                     RayfieldLibrary.Flags[InputSettings.Flag] = InputSettings
  2291.                 end
  2292.             end
  2293.  
  2294.             Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2295.                 Input.InputFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2296.                 Input.InputFrame.UIStroke.Color = SelectedTheme.InputStroke
  2297.             end)
  2298.  
  2299.             return InputSettings
  2300.         end
  2301.  
  2302.         -- Dropdown
  2303.         function Tab:CreateDropdown(DropdownSettings)
  2304.             local Dropdown = Elements.Template.Dropdown:Clone()
  2305.             if string.find(DropdownSettings.Name,"closed") then
  2306.                 Dropdown.Name = "Dropdown"
  2307.             else
  2308.                 Dropdown.Name = DropdownSettings.Name
  2309.             end
  2310.             Dropdown.Title.Text = DropdownSettings.Name
  2311.             Dropdown.Visible = true
  2312.             Dropdown.Parent = TabPage
  2313.  
  2314.             Dropdown.List.Visible = false
  2315.             if DropdownSettings.CurrentOption then
  2316.                 if type(DropdownSettings.CurrentOption) == "string" then
  2317.                     DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption}
  2318.                 end
  2319.                 if not DropdownSettings.MultipleOptions and type(DropdownSettings.CurrentOption) == "table" then
  2320.                     DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption[1]}
  2321.                 end
  2322.             else
  2323.                 DropdownSettings.CurrentOption = {}
  2324.             end
  2325.  
  2326.             if DropdownSettings.MultipleOptions then
  2327.                 if DropdownSettings.CurrentOption and type(DropdownSettings.CurrentOption) == "table" then
  2328.                     if #DropdownSettings.CurrentOption == 1 then
  2329.                         Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2330.                     elseif #DropdownSettings.CurrentOption == 0 then
  2331.                         Dropdown.Selected.Text = "None"
  2332.                     else
  2333.                         Dropdown.Selected.Text = "Various"
  2334.                     end
  2335.                 else
  2336.                     DropdownSettings.CurrentOption = {}
  2337.                     Dropdown.Selected.Text = "None"
  2338.                 end
  2339.             else
  2340.                 Dropdown.Selected.Text = DropdownSettings.CurrentOption[1] or "None"
  2341.             end
  2342.  
  2343.             Dropdown.Toggle.ImageColor3 = SelectedTheme.TextColor
  2344.             TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2345.  
  2346.             Dropdown.BackgroundTransparency = 1
  2347.             Dropdown.UIStroke.Transparency = 1
  2348.             Dropdown.Title.TextTransparency = 1
  2349.  
  2350.             Dropdown.Size = UDim2.new(1, -10, 0, 45)
  2351.  
  2352.             TweenService:Create(Dropdown, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2353.             TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2354.             TweenService:Create(Dropdown.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()   
  2355.  
  2356.             for _, ununusedoption in ipairs(Dropdown.List:GetChildren()) do
  2357.                 if ununusedoption.ClassName == "Frame" and ununusedoption.Name ~= "Placeholder" then
  2358.                     ununusedoption:Destroy()
  2359.                 end
  2360.             end
  2361.  
  2362.             Dropdown.Toggle.Rotation = 180
  2363.  
  2364.             Dropdown.Interact.MouseButton1Click:Connect(function()
  2365.                 TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2366.                 TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2367.                 task.wait(0.1)
  2368.                 TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2369.                 TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2370.                 if Debounce then return end
  2371.                 if Dropdown.List.Visible then
  2372.                     Debounce = true
  2373.                     TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  2374.                     for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  2375.                         if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  2376.                             TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  2377.                             TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2378.                             TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  2379.                         end
  2380.                     end
  2381.                     TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ScrollBarImageTransparency = 1}):Play()
  2382.                     TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Rotation = 180}):Play()
  2383.                     task.wait(0.35)
  2384.                     Dropdown.List.Visible = false
  2385.                     Debounce = false
  2386.                 else
  2387.                     TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 180)}):Play()
  2388.                     Dropdown.List.Visible = true
  2389.                     TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ScrollBarImageTransparency = 0.7}):Play()
  2390.                     TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Rotation = 0}):Play()  
  2391.                     for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  2392.                         if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  2393.                             if DropdownOpt.Name ~= Dropdown.Selected.Text then
  2394.                                 TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2395.                             end
  2396.                             TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2397.                             TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2398.                         end
  2399.                     end
  2400.                 end
  2401.             end)
  2402.  
  2403.             Dropdown.MouseEnter:Connect(function()
  2404.                 if not Dropdown.List.Visible then
  2405.                     TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2406.                 end
  2407.             end)
  2408.  
  2409.             Dropdown.MouseLeave:Connect(function()
  2410.                 TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2411.             end)
  2412.  
  2413.             local function SetDropdownOptions()
  2414.                 for _, Option in ipairs(DropdownSettings.Options) do
  2415.                     local DropdownOption = Elements.Template.Dropdown.List.Template:Clone()
  2416.                     DropdownOption.Name = Option
  2417.                     DropdownOption.Title.Text = Option
  2418.                     DropdownOption.Parent = Dropdown.List
  2419.                     DropdownOption.Visible = true
  2420.  
  2421.                     DropdownOption.BackgroundTransparency = 1
  2422.                     DropdownOption.UIStroke.Transparency = 1
  2423.                     DropdownOption.Title.TextTransparency = 1
  2424.  
  2425.                     --local Dropdown = Tab:CreateDropdown({
  2426.                     --  Name = "Dropdown Example",
  2427.                     --  Options = {"Option 1","Option 2"},
  2428.                     --  CurrentOption = {"Option 1"},
  2429.                     --  MultipleOptions = true,
  2430.                     --  Flag = "Dropdown1",
  2431.                     --  Callback = function(TableOfOptions)
  2432.  
  2433.                     --  end,
  2434.                     --})
  2435.  
  2436.  
  2437.                     DropdownOption.Interact.ZIndex = 50
  2438.                     DropdownOption.Interact.MouseButton1Click:Connect(function()
  2439.                         if not DropdownSettings.MultipleOptions and table.find(DropdownSettings.CurrentOption, Option) then
  2440.                             return
  2441.                         end
  2442.  
  2443.                         if table.find(DropdownSettings.CurrentOption, Option) then
  2444.                             table.remove(DropdownSettings.CurrentOption, table.find(DropdownSettings.CurrentOption, Option))
  2445.                             if DropdownSettings.MultipleOptions then
  2446.                                 if #DropdownSettings.CurrentOption == 1 then
  2447.                                     Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2448.                                 elseif #DropdownSettings.CurrentOption == 0 then
  2449.                                     Dropdown.Selected.Text = "None"
  2450.                                 else
  2451.                                     Dropdown.Selected.Text = "Various"
  2452.                                 end
  2453.                             else
  2454.                                 Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2455.                             end
  2456.                         else
  2457.                             if not DropdownSettings.MultipleOptions then
  2458.                                 table.clear(DropdownSettings.CurrentOption)
  2459.                             end
  2460.                             table.insert(DropdownSettings.CurrentOption, Option)
  2461.                             if DropdownSettings.MultipleOptions then
  2462.                                 if #DropdownSettings.CurrentOption == 1 then
  2463.                                     Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2464.                                 elseif #DropdownSettings.CurrentOption == 0 then
  2465.                                     Dropdown.Selected.Text = "None"
  2466.                                 else
  2467.                                     Dropdown.Selected.Text = "Various"
  2468.                                 end
  2469.                             else
  2470.                                 Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2471.                             end
  2472.                             TweenService:Create(DropdownOption.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2473.                             TweenService:Create(DropdownOption, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.DropdownSelected}):Play()
  2474.                             Debounce = true
  2475.                         end
  2476.  
  2477.  
  2478.                         local Success, Response = pcall(function()
  2479.                             DropdownSettings.Callback(DropdownSettings.CurrentOption)
  2480.                         end)
  2481.  
  2482.                         if not Success then
  2483.                             TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2484.                             TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2485.                             Dropdown.Title.Text = "Callback Error"
  2486.                             print("Rayfield | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  2487.                             warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2488.                             task.wait(0.5)
  2489.                             Dropdown.Title.Text = DropdownSettings.Name
  2490.                             TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2491.                             TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2492.                         end
  2493.  
  2494.                         for _, droption in ipairs(Dropdown.List:GetChildren()) do
  2495.                             if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" and not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2496.                                 TweenService:Create(droption, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.DropdownUnselected}):Play()
  2497.                             end
  2498.                         end
  2499.                         if not DropdownSettings.MultipleOptions then
  2500.                             task.wait(0.1)
  2501.                             TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  2502.                             for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  2503.                                 if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  2504.                                     TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  2505.                                     TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2506.                                     TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  2507.                                 end
  2508.                             end
  2509.                             TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ScrollBarImageTransparency = 1}):Play()
  2510.                             TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Rotation = 180}):Play()
  2511.                             task.wait(0.35)
  2512.                             Dropdown.List.Visible = false
  2513.                         end
  2514.                         Debounce = false
  2515.                         if not DropdownSettings.Ext then
  2516.                             SaveConfiguration()
  2517.                         end
  2518.                     end)
  2519.  
  2520.                     Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2521.                         DropdownOption.UIStroke.Color = SelectedTheme.ElementStroke
  2522.                     end)
  2523.                 end
  2524.             end
  2525.             SetDropdownOptions()
  2526.  
  2527.             for _, droption in ipairs(Dropdown.List:GetChildren()) do
  2528.                 if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" then
  2529.                     if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2530.                         droption.BackgroundColor3 = SelectedTheme.DropdownUnselected
  2531.                     else
  2532.                         droption.BackgroundColor3 = SelectedTheme.DropdownSelected
  2533.                     end
  2534.  
  2535.                     Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2536.                         if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2537.                             droption.BackgroundColor3 = SelectedTheme.DropdownUnselected
  2538.                         else
  2539.                             droption.BackgroundColor3 = SelectedTheme.DropdownSelected
  2540.                         end
  2541.                     end)
  2542.                 end
  2543.             end
  2544.  
  2545.             function DropdownSettings:Set(NewOption)
  2546.                 DropdownSettings.CurrentOption = NewOption
  2547.  
  2548.                 if typeof(DropdownSettings.CurrentOption) == "string" then
  2549.                     DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption}
  2550.                 end
  2551.  
  2552.                 if not DropdownSettings.MultipleOptions then
  2553.                     DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption[1]}
  2554.                 end
  2555.  
  2556.                 if DropdownSettings.MultipleOptions then
  2557.                     if #DropdownSettings.CurrentOption == 1 then
  2558.                         Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2559.                     elseif #DropdownSettings.CurrentOption == 0 then
  2560.                         Dropdown.Selected.Text = "None"
  2561.                     else
  2562.                         Dropdown.Selected.Text = "Various"
  2563.                     end
  2564.                 else
  2565.                     Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2566.                 end
  2567.  
  2568.  
  2569.                 local Success, Response = pcall(function()
  2570.                     DropdownSettings.Callback(NewOption)
  2571.                 end)
  2572.                 if not Success then
  2573.                     TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2574.                     TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2575.                     Dropdown.Title.Text = "Callback Error"
  2576.                     print("Rayfield | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  2577.                     warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2578.                     task.wait(0.5)
  2579.                     Dropdown.Title.Text = DropdownSettings.Name
  2580.                     TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2581.                     TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2582.                 end
  2583.  
  2584.                 for _, droption in ipairs(Dropdown.List:GetChildren()) do
  2585.                     if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" then
  2586.                         if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2587.                             droption.BackgroundColor3 = SelectedTheme.DropdownUnselected
  2588.                         else
  2589.                             droption.BackgroundColor3 = SelectedTheme.DropdownSelected
  2590.                         end
  2591.                     end
  2592.                 end
  2593.                 --SaveConfiguration()
  2594.             end
  2595.  
  2596.             function DropdownSettings:Refresh(optionsTable: table) -- updates a dropdown with new options from optionsTable
  2597.                 DropdownSettings.Options = optionsTable
  2598.                 for _, option in Dropdown.List:GetChildren() do
  2599.                     if option.ClassName == "Frame" and option.Name ~= "Placeholder" then
  2600.                         option:Destroy()
  2601.                     end
  2602.                 end
  2603.                 SetDropdownOptions()
  2604.             end
  2605.  
  2606.             if Settings.ConfigurationSaving then
  2607.                 if Settings.ConfigurationSaving.Enabled and DropdownSettings.Flag then
  2608.                     RayfieldLibrary.Flags[DropdownSettings.Flag] = DropdownSettings
  2609.                 end
  2610.             end
  2611.  
  2612.             Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2613.                 Dropdown.Toggle.ImageColor3 = SelectedTheme.TextColor
  2614.                 TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2615.             end)
  2616.  
  2617.             return DropdownSettings
  2618.         end
  2619.  
  2620.         -- Keybind
  2621.         function Tab:CreateKeybind(KeybindSettings)
  2622.             local CheckingForKey = false
  2623.             local Keybind = Elements.Template.Keybind:Clone()
  2624.             Keybind.Name = KeybindSettings.Name
  2625.             Keybind.Title.Text = KeybindSettings.Name
  2626.             Keybind.Visible = true
  2627.             Keybind.Parent = TabPage
  2628.  
  2629.             Keybind.BackgroundTransparency = 1
  2630.             Keybind.UIStroke.Transparency = 1
  2631.             Keybind.Title.TextTransparency = 1
  2632.  
  2633.             Keybind.KeybindFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2634.             Keybind.KeybindFrame.UIStroke.Color = SelectedTheme.InputStroke
  2635.  
  2636.             TweenService:Create(Keybind, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2637.             TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2638.             TweenService:Create(Keybind.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2639.  
  2640.             Keybind.KeybindFrame.KeybindBox.Text = KeybindSettings.CurrentKeybind
  2641.             Keybind.KeybindFrame.Size = UDim2.new(0, Keybind.KeybindFrame.KeybindBox.TextBounds.X + 24, 0, 30)
  2642.  
  2643.             Keybind.KeybindFrame.KeybindBox.Focused:Connect(function()
  2644.                 CheckingForKey = true
  2645.                 Keybind.KeybindFrame.KeybindBox.Text = ""
  2646.             end)
  2647.             Keybind.KeybindFrame.KeybindBox.FocusLost:Connect(function()
  2648.                 CheckingForKey = false
  2649.                 if Keybind.KeybindFrame.KeybindBox.Text == nil or Keybind.KeybindFrame.KeybindBox.Text == "" then
  2650.                     Keybind.KeybindFrame.KeybindBox.Text = KeybindSettings.CurrentKeybind
  2651.                     if not KeybindSettings.Ext then
  2652.                         SaveConfiguration()
  2653.                     end
  2654.                 end
  2655.             end)
  2656.  
  2657.             Keybind.MouseEnter:Connect(function()
  2658.                 TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2659.             end)
  2660.  
  2661.             Keybind.MouseLeave:Connect(function()
  2662.                 TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2663.             end)
  2664.  
  2665.             UserInputService.InputBegan:Connect(function(input, processed)
  2666.                 if CheckingForKey then
  2667.                     if input.KeyCode ~= Enum.KeyCode.Unknown then
  2668.                         local SplitMessage = string.split(tostring(input.KeyCode), ".")
  2669.                         local NewKeyNoEnum = SplitMessage[3]
  2670.                         Keybind.KeybindFrame.KeybindBox.Text = tostring(NewKeyNoEnum)
  2671.                         KeybindSettings.CurrentKeybind = tostring(NewKeyNoEnum)
  2672.                         Keybind.KeybindFrame.KeybindBox:ReleaseFocus()
  2673.                         if not KeybindSettings.Ext then
  2674.                             SaveConfiguration()
  2675.                         end
  2676.  
  2677.                         if KeybindSettings.CallOnChange then
  2678.                             KeybindSettings.Callback(tostring(NewKeyNoEnum))
  2679.                         end
  2680.                     end
  2681.                 elseif not KeybindSettings.CallOnChange and KeybindSettings.CurrentKeybind ~= nil and (input.KeyCode == Enum.KeyCode[KeybindSettings.CurrentKeybind] and not processed) then -- Test
  2682.                     local Held = true
  2683.                     local Connection
  2684.                     Connection = input.Changed:Connect(function(prop)
  2685.                         if prop == "UserInputState" then
  2686.                             Connection:Disconnect()
  2687.                             Held = false
  2688.                         end
  2689.                     end)
  2690.  
  2691.                     if not KeybindSettings.HoldToInteract then
  2692.                         local Success, Response = pcall(KeybindSettings.Callback)
  2693.                         if not Success then
  2694.                             TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2695.                             TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2696.                             Keybind.Title.Text = "Callback Error"
  2697.                             print("Rayfield | "..KeybindSettings.Name.." Callback Error " ..tostring(Response))
  2698.                             warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2699.                             task.wait(0.5)
  2700.                             Keybind.Title.Text = KeybindSettings.Name
  2701.                             TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2702.                             TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2703.                         end
  2704.                     else
  2705.                         task.wait(0.25)
  2706.                         if Held then
  2707.                             local Loop; Loop = RunService.Stepped:Connect(function()
  2708.                                 if not Held then
  2709.                                     KeybindSettings.Callback(false) -- maybe pcall this
  2710.                                     Loop:Disconnect()
  2711.                                 else
  2712.                                     KeybindSettings.Callback(true) -- maybe pcall this
  2713.                                 end
  2714.                             end)
  2715.                         end
  2716.                     end
  2717.                 end
  2718.             end)
  2719.  
  2720.             Keybind.KeybindFrame.KeybindBox:GetPropertyChangedSignal("Text"):Connect(function()
  2721.                 TweenService:Create(Keybind.KeybindFrame, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Keybind.KeybindFrame.KeybindBox.TextBounds.X + 24, 0, 30)}):Play()
  2722.             end)
  2723.  
  2724.             function KeybindSettings:Set(NewKeybind)
  2725.                 Keybind.KeybindFrame.KeybindBox.Text = tostring(NewKeybind)
  2726.                 KeybindSettings.CurrentKeybind = tostring(NewKeybind)
  2727.                 Keybind.KeybindFrame.KeybindBox:ReleaseFocus()
  2728.                 if not KeybindSettings.Ext then
  2729.                     SaveConfiguration()
  2730.                 end
  2731.  
  2732.                 if KeybindSettings.CallOnChange then
  2733.                     KeybindSettings.Callback(tostring(NewKeybind))
  2734.                 end
  2735.             end
  2736.  
  2737.             if Settings.ConfigurationSaving then
  2738.                 if Settings.ConfigurationSaving.Enabled and KeybindSettings.Flag then
  2739.                     RayfieldLibrary.Flags[KeybindSettings.Flag] = KeybindSettings
  2740.                 end
  2741.             end
  2742.  
  2743.             Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2744.                 Keybind.KeybindFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2745.                 Keybind.KeybindFrame.UIStroke.Color = SelectedTheme.InputStroke
  2746.             end)
  2747.  
  2748.             return KeybindSettings
  2749.         end
  2750.  
  2751.         -- Toggle
  2752.         function Tab:CreateToggle(ToggleSettings)
  2753.             local ToggleValue = {}
  2754.  
  2755.             local Toggle = Elements.Template.Toggle:Clone()
  2756.             Toggle.Name = ToggleSettings.Name
  2757.             Toggle.Title.Text = ToggleSettings.Name
  2758.             Toggle.Visible = true
  2759.             Toggle.Parent = TabPage
  2760.  
  2761.             Toggle.BackgroundTransparency = 1
  2762.             Toggle.UIStroke.Transparency = 1
  2763.             Toggle.Title.TextTransparency = 1
  2764.             Toggle.Switch.BackgroundColor3 = SelectedTheme.ToggleBackground
  2765.  
  2766.             if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2767.                 Toggle.Switch.Shadow.Visible = false
  2768.             end
  2769.  
  2770.             TweenService:Create(Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2771.             TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2772.             TweenService:Create(Toggle.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play() 
  2773.  
  2774.             if ToggleSettings.CurrentValue == true then
  2775.                 Toggle.Switch.Indicator.Position = UDim2.new(1, -20, 0.5, 0)
  2776.                 Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleEnabledStroke
  2777.                 Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleEnabled
  2778.                 Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleEnabledOuterStroke
  2779.             else
  2780.                 Toggle.Switch.Indicator.Position = UDim2.new(1, -40, 0.5, 0)
  2781.                 Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleDisabledStroke
  2782.                 Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleDisabled
  2783.                 Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleDisabledOuterStroke
  2784.             end
  2785.  
  2786.             Toggle.MouseEnter:Connect(function()
  2787.                 TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2788.             end)
  2789.  
  2790.             Toggle.MouseLeave:Connect(function()
  2791.                 TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2792.             end)
  2793.  
  2794.             Toggle.Interact.MouseButton1Click:Connect(function()
  2795.                 if ToggleSettings.CurrentValue == true then
  2796.                     ToggleSettings.CurrentValue = false
  2797.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2798.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2799.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -40, 0.5, 0)}):Play()
  2800.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledStroke}):Play()
  2801.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleDisabled}):Play()
  2802.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledOuterStroke}):Play()
  2803.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2804.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()  
  2805.                 else
  2806.                     ToggleSettings.CurrentValue = true
  2807.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2808.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2809.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -20, 0.5, 0)}):Play()
  2810.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledStroke}):Play()
  2811.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleEnabled}):Play()
  2812.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledOuterStroke}):Play()
  2813.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2814.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()      
  2815.                 end
  2816.  
  2817.                 local Success, Response = pcall(function()
  2818.                     if debugX then warn('Running toggle \''..ToggleSettings.Name..'\' (Interact)') end
  2819.  
  2820.                     ToggleSettings.Callback(ToggleSettings.CurrentValue)
  2821.                 end)
  2822.  
  2823.                 if not Success then
  2824.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2825.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2826.                     Toggle.Title.Text = "Callback Error"
  2827.                     print("Rayfield | "..ToggleSettings.Name.." Callback Error " ..tostring(Response))
  2828.                     warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2829.                     task.wait(0.5)
  2830.                     Toggle.Title.Text = ToggleSettings.Name
  2831.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2832.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2833.                 end
  2834.  
  2835.                 if not ToggleSettings.Ext then
  2836.                     SaveConfiguration()
  2837.                 end
  2838.             end)
  2839.  
  2840.             function ToggleSettings:Set(NewToggleValue)
  2841.                 if NewToggleValue == true then
  2842.                     ToggleSettings.CurrentValue = true
  2843.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2844.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2845.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -20, 0.5, 0)}):Play()
  2846.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2847.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledStroke}):Play()
  2848.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleEnabled}):Play()
  2849.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledOuterStroke}):Play()
  2850.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()  
  2851.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2852.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()  
  2853.                 else
  2854.                     ToggleSettings.CurrentValue = false
  2855.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2856.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2857.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -40, 0.5, 0)}):Play()
  2858.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2859.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledStroke}):Play()
  2860.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleDisabled}):Play()
  2861.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledOuterStroke}):Play()
  2862.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()
  2863.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2864.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()  
  2865.                 end
  2866.  
  2867.                 local Success, Response = pcall(function()
  2868.                     if debugX then warn('Running toggle \''..ToggleSettings.Name..'\' (:Set)') end
  2869.  
  2870.                     ToggleSettings.Callback(ToggleSettings.CurrentValue)
  2871.                 end)
  2872.  
  2873.                 if not Success then
  2874.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2875.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2876.                     Toggle.Title.Text = "Callback Error"
  2877.                     print("Rayfield | "..ToggleSettings.Name.." Callback Error " ..tostring(Response))
  2878.                     warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2879.                     task.wait(0.5)
  2880.                     Toggle.Title.Text = ToggleSettings.Name
  2881.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2882.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2883.                 end
  2884.  
  2885.                 if not ToggleSettings.Ext then
  2886.                     SaveConfiguration()
  2887.                 end
  2888.             end
  2889.  
  2890.             if not ToggleSettings.Ext then
  2891.                 if Settings.ConfigurationSaving then
  2892.                     if Settings.ConfigurationSaving.Enabled and ToggleSettings.Flag then
  2893.                         RayfieldLibrary.Flags[ToggleSettings.Flag] = ToggleSettings
  2894.                     end
  2895.                 end
  2896.             end
  2897.  
  2898.  
  2899.             Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2900.                 Toggle.Switch.BackgroundColor3 = SelectedTheme.ToggleBackground
  2901.  
  2902.                 if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2903.                     Toggle.Switch.Shadow.Visible = false
  2904.                 end
  2905.  
  2906.                 task.wait()
  2907.  
  2908.                 if not ToggleSettings.CurrentValue then
  2909.                     Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleDisabledStroke
  2910.                     Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleDisabled
  2911.                     Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleDisabledOuterStroke
  2912.                 else
  2913.                     Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleEnabledStroke
  2914.                     Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleEnabled
  2915.                     Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleEnabledOuterStroke
  2916.                 end
  2917.             end)
  2918.  
  2919.             return ToggleSettings
  2920.         end
  2921.  
  2922.         -- Slider
  2923.         function Tab:CreateSlider(SliderSettings)
  2924.             local SLDragging = false
  2925.             local Slider = Elements.Template.Slider:Clone()
  2926.             Slider.Name = SliderSettings.Name
  2927.             Slider.Title.Text = SliderSettings.Name
  2928.             Slider.Visible = true
  2929.             Slider.Parent = TabPage
  2930.  
  2931.             Slider.BackgroundTransparency = 1
  2932.             Slider.UIStroke.Transparency = 1
  2933.             Slider.Title.TextTransparency = 1
  2934.  
  2935.             if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2936.                 Slider.Main.Shadow.Visible = false
  2937.             end
  2938.  
  2939.             Slider.Main.BackgroundColor3 = SelectedTheme.SliderBackground
  2940.             Slider.Main.UIStroke.Color = SelectedTheme.SliderStroke
  2941.             Slider.Main.Progress.UIStroke.Color = SelectedTheme.SliderStroke
  2942.             Slider.Main.Progress.BackgroundColor3 = SelectedTheme.SliderProgress
  2943.  
  2944.             TweenService:Create(Slider, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2945.             TweenService:Create(Slider.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2946.             TweenService:Create(Slider.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play() 
  2947.  
  2948.             Slider.Main.Progress.Size = UDim2.new(0, Slider.Main.AbsoluteSize.X * ((SliderSettings.CurrentValue + SliderSettings.Range[1]) / (SliderSettings.Range[2] - SliderSettings.Range[1])) > 5 and Slider.Main.AbsoluteSize.X * (SliderSettings.CurrentValue / (SliderSettings.Range[2] - SliderSettings.Range[1])) or 5, 1, 0)
  2949.  
  2950.             if not SliderSettings.Suffix then
  2951.                 Slider.Main.Information.Text = tostring(SliderSettings.CurrentValue)
  2952.             else
  2953.                 Slider.Main.Information.Text = tostring(SliderSettings.CurrentValue) .. " " .. SliderSettings.Suffix
  2954.             end
  2955.  
  2956.             Slider.MouseEnter:Connect(function()
  2957.                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2958.             end)
  2959.  
  2960.             Slider.MouseLeave:Connect(function()
  2961.                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2962.             end)
  2963.  
  2964.             Slider.Main.Interact.InputBegan:Connect(function(Input)
  2965.                 if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  2966.                     TweenService:Create(Slider.Main.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2967.                     TweenService:Create(Slider.Main.Progress.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2968.                     SLDragging = true
  2969.                 end
  2970.             end)
  2971.  
  2972.             Slider.Main.Interact.InputEnded:Connect(function(Input)
  2973.                 if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  2974.                     TweenService:Create(Slider.Main.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0.4}):Play()
  2975.                     TweenService:Create(Slider.Main.Progress.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0.3}):Play()
  2976.                     SLDragging = false
  2977.                 end
  2978.             end)
  2979.  
  2980.             Slider.Main.Interact.MouseButton1Down:Connect(function(X)
  2981.                 local Current = Slider.Main.Progress.AbsolutePosition.X + Slider.Main.Progress.AbsoluteSize.X
  2982.                 local Start = Current
  2983.                 local Location = X
  2984.                 local Loop; Loop = RunService.Stepped:Connect(function()
  2985.                     if SLDragging then
  2986.                         Location = UserInputService:GetMouseLocation().X
  2987.                         Current = Current + 0.025 * (Location - Start)
  2988.  
  2989.                         if Location < Slider.Main.AbsolutePosition.X then
  2990.                             Location = Slider.Main.AbsolutePosition.X
  2991.                         elseif Location > Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X then
  2992.                             Location = Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X
  2993.                         end
  2994.  
  2995.                         if Current < Slider.Main.AbsolutePosition.X + 5 then
  2996.                             Current = Slider.Main.AbsolutePosition.X + 5
  2997.                         elseif Current > Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X then
  2998.                             Current = Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X
  2999.                         end
  3000.  
  3001.                         if Current <= Location and (Location - Start) < 0 then
  3002.                             Start = Location
  3003.                         elseif Current >= Location and (Location - Start) > 0 then
  3004.                             Start = Location
  3005.                         end
  3006.                         TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.45, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Current - Slider.Main.AbsolutePosition.X, 1, 0)}):Play()
  3007.                         local NewValue = SliderSettings.Range[1] + (Location - Slider.Main.AbsolutePosition.X) / Slider.Main.AbsoluteSize.X * (SliderSettings.Range[2] - SliderSettings.Range[1])
  3008.  
  3009.                         NewValue = math.floor(NewValue / SliderSettings.Increment + 0.5) * (SliderSettings.Increment * 10000000) / 10000000
  3010.                         NewValue = math.clamp(NewValue, SliderSettings.Range[1], SliderSettings.Range[2])
  3011.  
  3012.                         if not SliderSettings.Suffix then
  3013.                             Slider.Main.Information.Text = tostring(NewValue)
  3014.                         else
  3015.                             Slider.Main.Information.Text = tostring(NewValue) .. " " .. SliderSettings.Suffix
  3016.                         end
  3017.  
  3018.                         if SliderSettings.CurrentValue ~= NewValue then
  3019.                             local Success, Response = pcall(function()
  3020.                                 SliderSettings.Callback(NewValue)
  3021.                             end)
  3022.                             if not Success then
  3023.                                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  3024.                                 TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  3025.                                 Slider.Title.Text = "Callback Error"
  3026.                                 print("Rayfield | "..SliderSettings.Name.." Callback Error " ..tostring(Response))
  3027.                                 warn('Check docs.sirius.menu for help with Rayfield specific development.')
  3028.                                 task.wait(0.5)
  3029.                                 Slider.Title.Text = SliderSettings.Name
  3030.                                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  3031.                                 TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  3032.                             end
  3033.  
  3034.                             SliderSettings.CurrentValue = NewValue
  3035.                             if not SliderSettings.Ext then
  3036.                                 SaveConfiguration()
  3037.                             end
  3038.                         end
  3039.                     else
  3040.                         TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.3, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Location - Slider.Main.AbsolutePosition.X > 5 and Location - Slider.Main.AbsolutePosition.X or 5, 1, 0)}):Play()
  3041.                         Loop:Disconnect()
  3042.                     end
  3043.                 end)
  3044.             end)
  3045.  
  3046.             function SliderSettings:Set(NewVal)
  3047.                 local NewVal = math.clamp(NewVal, SliderSettings.Range[1], SliderSettings.Range[2])
  3048.  
  3049.                 TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.45, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Slider.Main.AbsoluteSize.X * ((NewVal + SliderSettings.Range[1]) / (SliderSettings.Range[2] - SliderSettings.Range[1])) > 5 and Slider.Main.AbsoluteSize.X * (NewVal / (SliderSettings.Range[2] - SliderSettings.Range[1])) or 5, 1, 0)}):Play()
  3050.                 Slider.Main.Information.Text = tostring(NewVal) .. " " .. (SliderSettings.Suffix or "")
  3051.  
  3052.                 local Success, Response = pcall(function()
  3053.                     SliderSettings.Callback(NewVal)
  3054.                 end)
  3055.  
  3056.                 if not Success then
  3057.                     TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  3058.                     TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  3059.                     Slider.Title.Text = "Callback Error"
  3060.                     print("Rayfield | "..SliderSettings.Name.." Callback Error " ..tostring(Response))
  3061.                     warn('Check docs.sirius.menu for help with Rayfield specific development.')
  3062.                     task.wait(0.5)
  3063.                     Slider.Title.Text = SliderSettings.Name
  3064.                     TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  3065.                     TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  3066.                 end
  3067.  
  3068.                 SliderSettings.CurrentValue = NewVal
  3069.                 if not SliderSettings.Ext then
  3070.                     SaveConfiguration()
  3071.                 end
  3072.             end
  3073.  
  3074.             if Settings.ConfigurationSaving then
  3075.                 if Settings.ConfigurationSaving.Enabled and SliderSettings.Flag then
  3076.                     RayfieldLibrary.Flags[SliderSettings.Flag] = SliderSettings
  3077.                 end
  3078.             end
  3079.  
  3080.             Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  3081.                 if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  3082.                     Slider.Main.Shadow.Visible = false
  3083.                 end
  3084.  
  3085.                 Slider.Main.BackgroundColor3 = SelectedTheme.SliderBackground
  3086.                 Slider.Main.UIStroke.Color = SelectedTheme.SliderStroke
  3087.                 Slider.Main.Progress.UIStroke.Color = SelectedTheme.SliderStroke
  3088.                 Slider.Main.Progress.BackgroundColor3 = SelectedTheme.SliderProgress
  3089.             end)
  3090.  
  3091.             return SliderSettings
  3092.         end
  3093.  
  3094.         Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  3095.             TabButton.UIStroke.Color = SelectedTheme.TabStroke
  3096.  
  3097.             if Elements.UIPageLayout.CurrentPage == TabPage then
  3098.                 TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  3099.                 TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  3100.                 TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  3101.             else
  3102.                 TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  3103.                 TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  3104.                 TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  3105.             end
  3106.         end)
  3107.  
  3108.         return Tab
  3109.     end
  3110.  
  3111.     Elements.Visible = true
  3112.  
  3113.  
  3114.     task.wait(1.1)
  3115.     TweenService:Create(Main, TweenInfo.new(0.7, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Size = UDim2.new(0, 390, 0, 90)}):Play()
  3116.     task.wait(0.3)
  3117.     TweenService:Create(LoadingFrame.Title, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  3118.     TweenService:Create(LoadingFrame.Subtitle, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  3119.     TweenService:Create(LoadingFrame.Version, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  3120.     task.wait(0.1)
  3121.     TweenService:Create(Main, TweenInfo.new(0.6, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = useMobileSizing and UDim2.new(0, 500, 0, 275) or UDim2.new(0, 500, 0, 475)}):Play()
  3122.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  3123.  
  3124.     Topbar.BackgroundTransparency = 1
  3125.     Topbar.Divider.Size = UDim2.new(0, 0, 0, 1)
  3126.     Topbar.Divider.BackgroundColor3 = SelectedTheme.ElementStroke
  3127.     Topbar.CornerRepair.BackgroundTransparency = 1
  3128.     Topbar.Title.TextTransparency = 1
  3129.     Topbar.Search.ImageTransparency = 1
  3130.     if Topbar:FindFirstChild('Settings') then
  3131.         Topbar.Settings.ImageTransparency = 1
  3132.     end
  3133.     Topbar.ChangeSize.ImageTransparency = 1
  3134.     Topbar.Hide.ImageTransparency = 1
  3135.  
  3136.  
  3137.     task.wait(0.5)
  3138.     Topbar.Visible = true
  3139.     TweenService:Create(Topbar, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  3140.     TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  3141.     task.wait(0.1)
  3142.     TweenService:Create(Topbar.Divider, TweenInfo.new(1, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, 0, 0, 1)}):Play()
  3143.     TweenService:Create(Topbar.Title, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  3144.     task.wait(0.05)
  3145.     TweenService:Create(Topbar.Search, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  3146.     task.wait(0.05)
  3147.     if Topbar:FindFirstChild('Settings') then
  3148.         TweenService:Create(Topbar.Settings, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  3149.         task.wait(0.05)
  3150.     end
  3151.     TweenService:Create(Topbar.ChangeSize, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  3152.     task.wait(0.05)
  3153.     TweenService:Create(Topbar.Hide, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  3154.     task.wait(0.3)
  3155.  
  3156.     if dragBar then
  3157.         TweenService:Create(dragBarCosmetic, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  3158.     end
  3159.  
  3160.     function Window.ModifyTheme(NewTheme)
  3161.         local success = pcall(ChangeTheme, NewTheme)
  3162.         if not success then
  3163.             RayfieldLibrary:Notify({Title = 'Unable to Change Theme', Content = 'We are unable find a theme on file.', Image = 4400704299})
  3164.         else
  3165.             RayfieldLibrary:Notify({Title = 'Theme Changed', Content = 'Successfully changed theme to '..(typeof(NewTheme) == 'string' and NewTheme or 'Custom Theme')..'.', Image = 4483362748})
  3166.         end
  3167.     end
  3168.  
  3169.     local success, result = pcall(function()
  3170.         createSettings(Window)
  3171.     end)
  3172.    
  3173.     if not success then warn('Rayfield had an issue creating settings.') end
  3174.    
  3175.     return Window
  3176. end
  3177.  
  3178. local function setVisibility(visibility: boolean, notify: boolean?)
  3179.     if Debounce then return end
  3180.     if visibility then
  3181.         Hidden = false
  3182.         Unhide()
  3183.     else
  3184.         Hidden = true
  3185.         Hide(notify)
  3186.     end
  3187. end
  3188.  
  3189. function RayfieldLibrary:SetVisibility(visibility: boolean)
  3190.     setVisibility(visibility, false)
  3191. end
  3192.  
  3193. function RayfieldLibrary:IsVisible(): boolean
  3194.     return not Hidden
  3195. end
  3196.  
  3197. local hideHotkeyConnection -- Has to be initialized here since the connection is made later in the script
  3198. function RayfieldLibrary:Destroy()
  3199.     rayfieldDestroyed = true
  3200.     hideHotkeyConnection:Disconnect()
  3201.     Rayfield:Destroy()
  3202. end
  3203.  
  3204. Topbar.ChangeSize.MouseButton1Click:Connect(function()
  3205.     if Debounce then return end
  3206.     if Minimised then
  3207.         Minimised = false
  3208.         Maximise()
  3209.     else
  3210.         Minimised = true
  3211.         Minimise()
  3212.     end
  3213. end)
  3214.  
  3215. Main.Search.Input:GetPropertyChangedSignal('Text'):Connect(function()
  3216.     if #Main.Search.Input.Text > 0 then
  3217.         if not Elements.UIPageLayout.CurrentPage:FindFirstChild('SearchTitle-fsefsefesfsefesfesfThanks') then
  3218.             local searchTitle = Elements.Template.SectionTitle:Clone()
  3219.             searchTitle.Parent = Elements.UIPageLayout.CurrentPage
  3220.             searchTitle.Name = 'SearchTitle-fsefsefesfsefesfesfThanks'
  3221.             searchTitle.LayoutOrder = -100
  3222.             searchTitle.Title.Text = "Results from '"..Elements.UIPageLayout.CurrentPage.Name.."'"
  3223.             searchTitle.Visible = true
  3224.         end
  3225.     else
  3226.         local searchTitle = Elements.UIPageLayout.CurrentPage:FindFirstChild('SearchTitle-fsefsefesfsefesfesfThanks')
  3227.  
  3228.         if searchTitle then
  3229.             searchTitle:Destroy()
  3230.         end
  3231.     end
  3232.  
  3233.     for _, element in ipairs(Elements.UIPageLayout.CurrentPage:GetChildren()) do
  3234.         if element.ClassName ~= 'UIListLayout' and element.Name ~= 'Placeholder' and element.Name ~= 'SearchTitle-fsefsefesfsefesfesfThanks' then
  3235.             if element.Name == 'SectionTitle' then
  3236.                 if #Main.Search.Input.Text == 0 then
  3237.                     element.Visible = true
  3238.                 else
  3239.                     element.Visible = false
  3240.                 end
  3241.             else
  3242.                 if string.lower(element.Name):find(string.lower(Main.Search.Input.Text), 1, true) then
  3243.                     element.Visible = true
  3244.                 else
  3245.                     element.Visible = false
  3246.                 end
  3247.             end
  3248.         end
  3249.     end
  3250. end)
  3251.  
  3252. Main.Search.Input.FocusLost:Connect(function(enterPressed)
  3253.     if #Main.Search.Input.Text == 0 and searchOpen then
  3254.         task.wait(0.12)
  3255.         closeSearch()
  3256.     end
  3257. end)
  3258.  
  3259. Topbar.Search.MouseButton1Click:Connect(function()
  3260.     task.spawn(function()
  3261.         if searchOpen then
  3262.             closeSearch()
  3263.         else
  3264.             openSearch()
  3265.         end
  3266.     end)
  3267. end)
  3268.  
  3269. if Topbar:FindFirstChild('Settings') then
  3270.     Topbar.Settings.MouseButton1Click:Connect(function()
  3271.         task.spawn(function()
  3272.             for _, OtherTabButton in ipairs(TabList:GetChildren()) do
  3273.                 if OtherTabButton.Name ~= "Template" and OtherTabButton.ClassName == "Frame" and OtherTabButton ~= TabButton and OtherTabButton.Name ~= "Placeholder" then
  3274.                     TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.TabBackground}):Play()
  3275.                     TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextColor3 = SelectedTheme.TabTextColor}):Play()
  3276.                     TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageColor3 = SelectedTheme.TabTextColor}):Play()
  3277.                     TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  3278.                     TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  3279.                     TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  3280.                     TweenService:Create(OtherTabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  3281.                 end
  3282.             end
  3283.  
  3284.             Elements.UIPageLayout:JumpTo(Elements['Rayfield Settings'])
  3285.         end)
  3286.     end)
  3287.  
  3288. end
  3289.  
  3290.  
  3291. Topbar.Hide.MouseButton1Click:Connect(function()
  3292.     setVisibility(Hidden, not useMobileSizing)
  3293. end)
  3294.  
  3295. hideHotkeyConnection = UserInputService.InputBegan:Connect(function(input, processed)
  3296.     if (input.KeyCode == Enum.KeyCode[getSetting("General", "rayfieldOpen")]) and not processed then
  3297.         if Debounce then return end
  3298.         if Hidden then
  3299.             Hidden = false
  3300.             Unhide()
  3301.         else
  3302.             Hidden = true
  3303.             Hide()
  3304.         end
  3305.     end
  3306. end)
  3307.  
  3308. if MPrompt then
  3309.     MPrompt.Interact.MouseButton1Click:Connect(function()
  3310.         if Debounce then return end
  3311.         if Hidden then
  3312.             Hidden = false
  3313.             Unhide()
  3314.         end
  3315.     end)
  3316. end
  3317.  
  3318. for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  3319.     if TopbarButton.ClassName == "ImageButton" and TopbarButton.Name ~= 'Icon' then
  3320.         TopbarButton.MouseEnter:Connect(function()
  3321.             TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  3322.         end)
  3323.  
  3324.         TopbarButton.MouseLeave:Connect(function()
  3325.             TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  3326.         end)
  3327.     end
  3328. end
  3329.  
  3330.  
  3331. function RayfieldLibrary:LoadConfiguration()
  3332.     local config
  3333.  
  3334.     if debugX then
  3335.         warn('Loading Configuration')
  3336.     end
  3337.  
  3338.     if useStudio then
  3339.         config = [[{"Toggle1adwawd":true,"ColorPicker1awd":{"B":255,"G":255,"R":255},"Slider1dawd":100,"ColorPicfsefker1":{"B":255,"G":255,"R":255},"Slidefefsr1":80,"dawdawd":"","Input1":"hh","Keybind1":"B","Dropdown1":["Ocean"]}]]
  3340.     end
  3341.  
  3342.     if CEnabled then
  3343.         local notified
  3344.         local loaded
  3345.  
  3346.         local success, result = pcall(function()
  3347.             if useStudio and config then
  3348.                 loaded = LoadConfiguration(config)
  3349.                 return
  3350.             end
  3351.  
  3352.             if isfile then
  3353.                 if isfile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension) then
  3354.                     loaded = LoadConfiguration(readfile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension))
  3355.                 end
  3356.             else
  3357.                 notified = true
  3358.                 RayfieldLibrary:Notify({Title = "Rayfield Configurations", Content = "We couldn't enable Configuration Saving as you are not using software with filesystem support.", Image = 4384402990})
  3359.             end
  3360.         end)
  3361.  
  3362.         if success and loaded and not notified then
  3363.             RayfieldLibrary:Notify({Title = "Rayfield Configurations", Content = "The configuration file for this script has been loaded from a previous session.", Image = 4384403532})
  3364.         elseif not success and not notified then
  3365.             warn('Rayfield Configurations Error | '..tostring(result))
  3366.             RayfieldLibrary:Notify({Title = "Rayfield Configurations", Content = "We've encountered an issue loading your configuration correctly.\n\nCheck the Developer Console for more information.", Image = 4384402990})
  3367.         end
  3368.     end
  3369.  
  3370.     globalLoaded = true
  3371. end
  3372.  
  3373.  
  3374.  
  3375. if useStudio then
  3376.     -- run w/ studio
  3377.     -- Feel free to place your own script here to see how it'd work in Roblox Studio before running it on your execution software.
  3378.  
  3379.  
  3380.     local Window = RayfieldLibrary:CreateWindow({
  3381.         Name = "Rayfield Example Window",
  3382.         LoadingTitle = "Rayfield Interface Suite",
  3383.         Theme = 'Default',
  3384.         Icon = 0,
  3385.         LoadingSubtitle = "by Sirius",
  3386.         ConfigurationSaving = {
  3387.             Enabled = true,
  3388.             FolderName = nil, -- Create a custom folder for your hub/game
  3389.             FileName = "Big Hub52"
  3390.         },
  3391.         Discord = {
  3392.             Enabled = false,
  3393.             Invite = "noinvitelink", -- The Discord invite code, do not include discord.gg/. E.g. discord.gg/ABCD would be ABCD
  3394.             RememberJoins = true -- Set this to false to make them join the discord every time they load it up
  3395.         },
  3396.         KeySystem = false, -- Set this to true to use our key system
  3397.         KeySettings = {
  3398.             Title = "Untitled",
  3399.             Subtitle = "Key System",
  3400.             Note = "No method of obtaining the key is provided",
  3401.             FileName = "Key", -- It is recommended to use something unique as other scripts using Rayfield may overwrite your key file
  3402.             SaveKey = true, -- The user's key will be saved, but if you change the key, they will be unable to use your script
  3403.             GrabKeyFromSite = false, -- If this is true, set Key below to the RAW site you would like Rayfield to get the key from
  3404.             Key = {"Hello"} -- List of keys that will be accepted by the system, can be RAW file links (pastebin, github etc) or simple strings ("hello","key22")
  3405.         }
  3406.     })
  3407.  
  3408.     local Tab = Window:CreateTab("Tab Example", 'key-round') -- Title, Image
  3409.     local Tab2 = Window:CreateTab("Tab Example 2", 4483362458) -- Title, Image
  3410.  
  3411.     local Section = Tab2:CreateSection("Section")
  3412.  
  3413.  
  3414.     local ColorPicker = Tab2:CreateColorPicker({
  3415.         Name = "Color Picker",
  3416.         Color = Color3.fromRGB(255,255,255),
  3417.         Flag = "ColorPicfsefker1", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3418.         Callback = function(Value)
  3419.             -- The function that takes place every time the color picker is moved/changed
  3420.             -- The variable (Value) is a Color3fromRGB value based on which color is selected
  3421.         end
  3422.     })
  3423.  
  3424.     local Slider = Tab2:CreateSlider({
  3425.         Name = "Slider Example",
  3426.         Range = {0, 100},
  3427.         Increment = 10,
  3428.         Suffix = "Bananas",
  3429.         CurrentValue = 40,
  3430.         Flag = "Slidefefsr1", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3431.         Callback = function(Value)
  3432.             -- The function that takes place when the slider changes
  3433.             -- The variable (Value) is a number which correlates to the value the slider is currently at
  3434.         end,
  3435.     })
  3436.  
  3437.     local Input = Tab2:CreateInput({
  3438.         Name = "Input Example",
  3439.         CurrentValue = '',
  3440.         PlaceholderText = "Input Placeholder",
  3441.         Flag = 'dawdawd',
  3442.         RemoveTextAfterFocusLost = false,
  3443.         Callback = function(Text)
  3444.             -- The function that takes place when the input is changed
  3445.             -- The variable (Text) is a string for the value in the text box
  3446.         end,
  3447.     })
  3448.  
  3449.  
  3450.     --RayfieldLibrary:Notify({Title = "Rayfield Interface", Content = "Welcome to Rayfield. These - are the brand new notification design for Rayfield, with custom sizing and Rayfield calculated wait times.", Image = 4483362458})
  3451.  
  3452.     local Section = Tab:CreateSection("Section Example")
  3453.  
  3454.     local Button = Tab:CreateButton({
  3455.         Name = "Change Theme",
  3456.         Callback = function()
  3457.             -- The function that takes place when the button is pressed
  3458.             Window.ModifyTheme('DarkBlue')
  3459.         end,
  3460.     })
  3461.  
  3462.     local Toggle = Tab:CreateToggle({
  3463.         Name = "Toggle Example",
  3464.         CurrentValue = false,
  3465.         Flag = "Toggle1adwawd", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3466.         Callback = function(Value)
  3467.             -- The function that takes place when the toggle is pressed
  3468.             -- The variable (Value) is a boolean on whether the toggle is true or false
  3469.         end,
  3470.     })
  3471.  
  3472.     local ColorPicker = Tab:CreateColorPicker({
  3473.         Name = "Color Picker",
  3474.         Color = Color3.fromRGB(255,255,255),
  3475.         Flag = "ColorPicker1awd", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3476.         Callback = function(Value)
  3477.             -- The function that takes place every time the color picker is moved/changed
  3478.             -- The variable (Value) is a Color3fromRGB value based on which color is selected
  3479.         end
  3480.     })
  3481.  
  3482.     local Slider = Tab:CreateSlider({
  3483.         Name = "Slider Example",
  3484.         Range = {0, 100},
  3485.         Increment = 10,
  3486.         Suffix = "Bananas",
  3487.         CurrentValue = 40,
  3488.         Flag = "Slider1dawd", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3489.         Callback = function(Value)
  3490.             -- The function that takes place when the slider changes
  3491.             -- The variable (Value) is a number which correlates to the value the slider is currently at
  3492.         end,
  3493.     })
  3494.  
  3495.     local Input = Tab:CreateInput({
  3496.         Name = "Input Example",
  3497.         CurrentValue = "Helo",
  3498.         PlaceholderText = "Adaptive Input",
  3499.         RemoveTextAfterFocusLost = false,
  3500.         Flag = 'Input1',
  3501.         Callback = function(Text)
  3502.             -- The function that takes place when the input is changed
  3503.             -- The variable (Text) is a string for the value in the text box
  3504.         end,
  3505.     })
  3506.  
  3507.     local thoptions = {}
  3508.     for themename, theme in pairs(RayfieldLibrary.Theme) do
  3509.         table.insert(thoptions, themename)
  3510.     end
  3511.  
  3512.     local Dropdown = Tab:CreateDropdown({
  3513.         Name = "Theme",
  3514.         Options = thoptions,
  3515.         CurrentOption = {"Default"},
  3516.         MultipleOptions = false,
  3517.         Flag = "Dropdown1", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3518.         Callback = function(Options)
  3519.             --Window.ModifyTheme(Options[1])
  3520.             -- The function that takes place when the selected option is changed
  3521.             -- The variable (Options) is a table of strings for the current selected options
  3522.         end,
  3523.     })
  3524.  
  3525.  
  3526.     --Window.ModifyTheme({
  3527.     --  TextColor = Color3.fromRGB(50, 55, 60),
  3528.     --  Background = Color3.fromRGB(240, 245, 250),
  3529.     --  Topbar = Color3.fromRGB(215, 225, 235),
  3530.     --  Shadow = Color3.fromRGB(200, 210, 220),
  3531.  
  3532.     --  NotificationBackground = Color3.fromRGB(210, 220, 230),
  3533.     --  NotificationActionsBackground = Color3.fromRGB(225, 230, 240),
  3534.  
  3535.     --  TabBackground = Color3.fromRGB(200, 210, 220),
  3536.     --  TabStroke = Color3.fromRGB(180, 190, 200),
  3537.     --  TabBackgroundSelected = Color3.fromRGB(175, 185, 200),
  3538.     --  TabTextColor = Color3.fromRGB(50, 55, 60),
  3539.     --  SelectedTabTextColor = Color3.fromRGB(30, 35, 40),
  3540.  
  3541.     --  ElementBackground = Color3.fromRGB(210, 220, 230),
  3542.     --  ElementBackgroundHover = Color3.fromRGB(220, 230, 240),
  3543.     --  SecondaryElementBackground = Color3.fromRGB(200, 210, 220),
  3544.     --  ElementStroke = Color3.fromRGB(190, 200, 210),
  3545.     --  SecondaryElementStroke = Color3.fromRGB(180, 190, 200),
  3546.  
  3547.     --  SliderBackground = Color3.fromRGB(200, 220, 235),  -- Lighter shade
  3548.     --  SliderProgress = Color3.fromRGB(70, 130, 180),
  3549.     --  SliderStroke = Color3.fromRGB(150, 180, 220),
  3550.  
  3551.     --  ToggleBackground = Color3.fromRGB(210, 220, 230),
  3552.     --  ToggleEnabled = Color3.fromRGB(70, 160, 210),
  3553.     --  ToggleDisabled = Color3.fromRGB(180, 180, 180),
  3554.     --  ToggleEnabledStroke = Color3.fromRGB(60, 150, 200),
  3555.     --  ToggleDisabledStroke = Color3.fromRGB(140, 140, 140),
  3556.     --  ToggleEnabledOuterStroke = Color3.fromRGB(100, 120, 140),
  3557.     --  ToggleDisabledOuterStroke = Color3.fromRGB(120, 120, 130),
  3558.  
  3559.     --  DropdownSelected = Color3.fromRGB(220, 230, 240),
  3560.     --  DropdownUnselected = Color3.fromRGB(200, 210, 220),
  3561.  
  3562.     --  InputBackground = Color3.fromRGB(220, 230, 240),
  3563.     --  InputStroke = Color3.fromRGB(180, 190, 200),
  3564.     --  PlaceholderColor = Color3.fromRGB(150, 150, 150)
  3565.     --})
  3566.  
  3567.     local Keybind = Tab:CreateKeybind({
  3568.         Name = "Keybind Example",
  3569.         CurrentKeybind = "Q",
  3570.         HoldToInteract = false,
  3571.         Flag = "Keybind1", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3572.         Callback = function(Keybind)
  3573.             -- The function that takes place when the keybind is pressed
  3574.             -- The variable (Keybind) is a boolean for whether the keybind is being held or not (HoldToInteract needs to be true)
  3575.         end,
  3576.     })
  3577.  
  3578.     local Label = Tab:CreateLabel("Label Example")
  3579.  
  3580.     local Label2 = Tab:CreateLabel("Warning", 4483362458, Color3.fromRGB(255, 159, 49),  true)
  3581.  
  3582.     local Paragraph = Tab:CreateParagraph({Title = "Paragraph Example", Content = "Paragraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph Example"})
  3583. end
  3584.  
  3585. if CEnabled and Main:FindFirstChild('Notice') then
  3586.     Main.Notice.BackgroundTransparency = 1
  3587.     Main.Notice.Title.TextTransparency = 1
  3588.     Main.Notice.Size = UDim2.new(0, 0, 0, 0)
  3589.     Main.Notice.Position = UDim2.new(0.5, 0, 0, -100)
  3590.     Main.Notice.Visible = true
  3591.  
  3592.  
  3593.     TweenService:Create(Main.Notice, TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Size = UDim2.new(0, 280, 0, 35), Position = UDim2.new(0.5, 0, 0, -50), BackgroundTransparency = 0.5}):Play()
  3594.     TweenService:Create(Main.Notice.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0.1}):Play()
  3595. end
  3596.  
  3597. -- if not useStudio then
  3598. --  task.spawn(loadWithTimeout, "https://raw.githubusercontent.com/SiriusSoftwareLtd/Sirius/refs/heads/request/boost.lua")
  3599. -- end
  3600.  
  3601. task.delay(4, function()
  3602.     RayfieldLibrary.LoadConfiguration()
  3603.     if Main:FindFirstChild('Notice') and Main.Notice.Visible then
  3604.         TweenService:Create(Main.Notice, TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Size = UDim2.new(0, 100, 0, 25), Position = UDim2.new(0.5, 0, 0, -100), BackgroundTransparency = 1}):Play()
  3605.         TweenService:Create(Main.Notice.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  3606.  
  3607.         task.wait(0.5)
  3608.         Main.Notice.Visible = false
  3609.     end
  3610. end)
  3611.  
  3612. return RayfieldLibrary
Add Comment
Please, Sign In to add comment