Mr_3242

Rayfield made by Sirius

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