Advertisement
asdasdca

rayfield

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