Advertisement
Daozaaaa

Untitled

Feb 28th, 2024 (edited)
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 110.98 KB | None | 0 0
  1. --[[
  2.  
  3. Rayfield Interface Suite
  4. by Sirius
  5.  
  6. shlex | Designing + Programming
  7. iRay  | Programming
  8.  
  9. ]]
  10.  
  11.  
  12.  
  13. local Release = "Beta 8"
  14. local NotificationDuration = 6.5
  15. local RayfieldFolder = "Rayfield"
  16. local ConfigurationFolder = RayfieldFolder.."/Configurations"
  17. local ConfigurationExtension = ".rfld"
  18.  
  19. local InputDragList = {
  20.     Enum.UserInputType.MouseButton1,
  21.     Enum.UserInputType.Touch,
  22. }
  23.  
  24. local RayfieldLibrary = {
  25.     Flags = {},
  26.     Theme = {
  27.         Default = {
  28.             TextFont = "Default", -- Default will use the various font faces used across Rayfield
  29.             TextColor = Color3.fromRGB(240, 240, 240),
  30.  
  31.             Background = Color3.fromRGB(25, 25, 25),
  32.             Topbar = Color3.fromRGB(34, 34, 34),
  33.             Shadow = Color3.fromRGB(20, 20, 20),
  34.  
  35.             NotificationBackground = Color3.fromRGB(20, 20, 20),
  36.             NotificationActionsBackground = Color3.fromRGB(230, 230, 230),
  37.  
  38.             TabBackground = Color3.fromRGB(80, 80, 80),
  39.             TabStroke = Color3.fromRGB(85, 85, 85),
  40.             TabBackgroundSelected = Color3.fromRGB(210, 210, 210),
  41.             TabTextColor = Color3.fromRGB(240, 240, 240),
  42.             SelectedTabTextColor = Color3.fromRGB(50, 50, 50),
  43.  
  44.             ElementBackground = Color3.fromRGB(35, 35, 35),
  45.             ElementBackgroundHover = Color3.fromRGB(40, 40, 40),
  46.             SecondaryElementBackground = Color3.fromRGB(25, 25, 25), -- For labels and paragraphs
  47.             ElementStroke = Color3.fromRGB(50, 50, 50),
  48.             SecondaryElementStroke = Color3.fromRGB(40, 40, 40), -- For labels and paragraphs
  49.  
  50.             SliderBackground = Color3.fromRGB(43, 105, 159),
  51.             SliderProgress = Color3.fromRGB(43, 105, 159),
  52.             SliderStroke = Color3.fromRGB(48, 119, 177),
  53.  
  54.             ToggleBackground = Color3.fromRGB(30, 30, 30),
  55.             ToggleEnabled = Color3.fromRGB(0, 146, 214),
  56.             ToggleDisabled = Color3.fromRGB(100, 100, 100),
  57.             ToggleEnabledStroke = Color3.fromRGB(0, 170, 255),
  58.             ToggleDisabledStroke = Color3.fromRGB(125, 125, 125),
  59.             ToggleEnabledOuterStroke = Color3.fromRGB(100, 100, 100),
  60.             ToggleDisabledOuterStroke = Color3.fromRGB(65, 65, 65),
  61.  
  62.             InputBackground = Color3.fromRGB(30, 30, 30),
  63.             InputStroke = Color3.fromRGB(65, 65, 65),
  64.             PlaceholderColor = Color3.fromRGB(178, 178, 178)
  65.         },
  66.         Light = {
  67.             TextFont = "Gotham", -- Default will use the various font faces used across Rayfield
  68.             TextColor = Color3.fromRGB(50, 50, 50), -- i need to make all text 240, 240, 240 and base gray on transparency not color to do this
  69.  
  70.             Background = Color3.fromRGB(255, 255, 255),
  71.             Topbar = Color3.fromRGB(217, 217, 217),
  72.             Shadow = Color3.fromRGB(223, 223, 223),
  73.  
  74.             NotificationBackground = Color3.fromRGB(20, 20, 20),
  75.             NotificationActionsBackground = Color3.fromRGB(230, 230, 230),
  76.  
  77.             TabBackground = Color3.fromRGB(220, 220, 220),
  78.             TabStroke = Color3.fromRGB(112, 112, 112),
  79.             TabBackgroundSelected = Color3.fromRGB(0, 142, 208),
  80.             TabTextColor = Color3.fromRGB(240, 240, 240),
  81.             SelectedTabTextColor = Color3.fromRGB(50, 50, 50),
  82.  
  83.             ElementBackground = Color3.fromRGB(198, 198, 198),
  84.             ElementBackgroundHover = Color3.fromRGB(230, 230, 230),
  85.             SecondaryElementBackground = Color3.fromRGB(136, 136, 136), -- For labels and paragraphs
  86.             ElementStroke = Color3.fromRGB(180, 199, 97),
  87.             SecondaryElementStroke = Color3.fromRGB(40, 40, 40), -- For labels and paragraphs
  88.  
  89.             SliderBackground = Color3.fromRGB(31, 159, 71),
  90.             SliderProgress = Color3.fromRGB(31, 159, 71),
  91.             SliderStroke = Color3.fromRGB(42, 216, 94),
  92.  
  93.             ToggleBackground = Color3.fromRGB(170, 203, 60),
  94.             ToggleEnabled = Color3.fromRGB(32, 214, 29),
  95.             ToggleDisabled = Color3.fromRGB(100, 22, 23),
  96.             ToggleEnabledStroke = Color3.fromRGB(17, 255, 0),
  97.             ToggleDisabledStroke = Color3.fromRGB(65, 8, 8),
  98.             ToggleEnabledOuterStroke = Color3.fromRGB(0, 170, 0),
  99.             ToggleDisabledOuterStroke = Color3.fromRGB(170, 0, 0),
  100.  
  101.             InputBackground = Color3.fromRGB(31, 159, 71),
  102.             InputStroke = Color3.fromRGB(19, 65, 31),
  103.             PlaceholderColor = Color3.fromRGB(178, 178, 178)
  104.         }
  105.     }
  106. }
  107.  
  108.  
  109.  
  110. -- Services
  111.  
  112. local UserInputService = game:GetService("UserInputService")
  113. local TweenService = game:GetService("TweenService")
  114. local HttpService = game:GetService("HttpService")
  115. local RunService = game:GetService("RunService")
  116. local Players = game:GetService("Players")
  117. local CoreGui = game:GetService("CoreGui")
  118.  
  119. --
  120. local LocalPlayer = Players.LocalPlayer
  121.  
  122. -- Interface Management
  123. local Rayfield = game:GetObjects("rbxassetid://10804731440")[1]
  124.  
  125. Rayfield.Enabled = false
  126.  
  127.  
  128. if gethui then
  129.     Rayfield.Parent = gethui()
  130. elseif syn.protect_gui then
  131.     syn.protect_gui(Rayfield)
  132.     Rayfield.Parent = CoreGui
  133. elseif CoreGui:FindFirstChild("RobloxGui") then
  134.     Rayfield.Parent = CoreGui:FindFirstChild("RobloxGui")
  135. else
  136.     Rayfield.Parent = CoreGui
  137. end
  138.  
  139. if gethui then
  140.     for _, Interface in ipairs(gethui():GetChildren()) do
  141.         if Interface.Name == Rayfield.Name and Interface ~= Rayfield then
  142.             Interface.Enabled = false
  143.             Interface.Name = "Rayfield-Old"
  144.         end
  145.     end
  146. else
  147.     for _, Interface in ipairs(CoreGui:GetChildren()) do
  148.         if Interface.Name == Rayfield.Name and Interface ~= Rayfield then
  149.             Interface.Enabled = false
  150.             Interface.Name = "Rayfield-Old"
  151.         end
  152.     end
  153. end
  154.  
  155. -- Object Variables
  156.  
  157. local Camera = workspace.CurrentCamera
  158. local Main = Rayfield.Main
  159. local Topbar = Main.Topbar
  160. local Elements = Main.Elements
  161. local LoadingFrame = Main.LoadingFrame
  162. local TabList = Main.TabList
  163.  
  164. Elements.Template.Slider.Main.Information.TextXAlignment = Enum.TextXAlignment.Center
  165.  
  166. Rayfield.DisplayOrder = 100
  167. LoadingFrame.Version.Text = Release
  168.  
  169.  
  170. -- Variables
  171.  
  172. local request = (syn and syn.request) or (http and http.request) or http_request
  173. local CFileName = nil
  174. local CEnabled = false
  175. local Minimised = false
  176. local Hidden = false
  177. local Debounce = false
  178. local Notifications = Rayfield.Notifications
  179.  
  180. local SelectedTheme = RayfieldLibrary.Theme.Default
  181.  
  182. function ChangeTheme(ThemeName)
  183.     SelectedTheme = RayfieldLibrary.Theme[ThemeName]
  184.     for _, obj in ipairs(Rayfield:GetDescendants()) do
  185.         if obj.ClassName == "TextLabel" or obj.ClassName == "TextBox" or obj.ClassName == "TextButton" then
  186.             if SelectedTheme.TextFont ~= "Default" then
  187.                 obj.TextColor3 = SelectedTheme.TextColor
  188.                 obj.Font = SelectedTheme.TextFont
  189.             end
  190.         end
  191.     end
  192.  
  193.     Rayfield.Main.BackgroundColor3 = SelectedTheme.Background
  194.     Rayfield.Main.Topbar.BackgroundColor3 = SelectedTheme.Topbar
  195.     Rayfield.Main.Topbar.CornerRepair.BackgroundColor3 = SelectedTheme.Topbar
  196.     Rayfield.Main.Shadow.Image.ImageColor3 = SelectedTheme.Shadow
  197.  
  198.     Rayfield.Main.Topbar.ChangeSize.ImageColor3 = SelectedTheme.TextColor
  199.     Rayfield.Main.Topbar.Hide.ImageColor3 = SelectedTheme.TextColor
  200.     Rayfield.Main.Topbar.Theme.ImageColor3 = SelectedTheme.TextColor
  201.  
  202.     for _, TabPage in ipairs(Elements:GetChildren()) do
  203.         for _, Element in ipairs(TabPage:GetChildren()) do
  204.             if Element.ClassName == "Frame" and Element.Name ~= "Placeholder" and Element.Name ~= "SectionSpacing" and Element.Name ~= "SectionTitle"  then
  205.                 Element.BackgroundColor3 = SelectedTheme.ElementBackground
  206.                 Element.UIStroke.Color = SelectedTheme.ElementStroke
  207.             end
  208.         end
  209.     end
  210.  
  211. end
  212.  
  213. local function AddDraggingFunctionality(DragPoint, Main)
  214.     pcall(function()
  215.         local PreparingToDrag = false
  216.         local Dragging = false
  217.         local DragStart
  218.         local DragInput
  219.         local StartPos
  220.        
  221.         local function update(input)
  222.             local delta         = input.Position - DragStart
  223.             local newPosition   = UDim2.new(StartPos.X.Scale, StartPos.X.Offset + delta.X, StartPos.Y.Scale, StartPos.Y.Offset + delta.Y)
  224.             Main.Position   = newPosition
  225.  
  226.             return newPosition
  227.         end
  228.        
  229.         DragPoint.InputBegan:Connect(function(Input)
  230.             if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  231.                 PreparingToDrag = true
  232.                 local Connections
  233.                 Connections = Input.Changed:Connect(function()
  234.                     if Input.UserInputState == Enum.UserInputState.End and (Dragging or PreparingToDrag) then
  235.                         Dragging = false
  236.                         PreparingToDrag = false
  237.                         Connections:Disconnect()
  238.                     end
  239.                 end)
  240.             end
  241.         end)
  242.        
  243.         DragPoint.InputChanged:Connect(function(Input)
  244.             if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then
  245.                 DragInput = Input
  246.             end
  247.         end)
  248.        
  249.         UserInputService.InputChanged:Connect(function(input)
  250.             if PreparingToDrag then
  251.                 PreparingToDrag = false
  252.                 Dragging = true
  253.                 DragStart = input.Position
  254.                 StartPos = Main.Position
  255.             end
  256.  
  257.             if input == DragInput and Dragging then
  258.                 Main.Position = update(input)
  259.             end
  260.         end)
  261.     end)
  262. end  
  263.  
  264. local function PackColor(Color)
  265.     return {R = Color.R * 255, G = Color.G * 255, B = Color.B * 255}
  266. end    
  267.  
  268. local function UnpackColor(Color)
  269.     return Color3.fromRGB(Color.R, Color.G, Color.B)
  270. end
  271.  
  272. local function LoadConfiguration(Configuration)
  273.     local Data = HttpService:JSONDecode(Configuration)
  274.     for FlagName, FlagValue in next, Data do
  275.         if RayfieldLibrary.Flags[FlagName] then
  276.             spawn(function()
  277.                 if RayfieldLibrary.Flags[FlagName].Type == "ColorPicker" then
  278.                     RayfieldLibrary.Flags[FlagName]:Set(UnpackColor(FlagValue))
  279.                 else
  280.                     if RayfieldLibrary.Flags[FlagName].CurrentValue or RayfieldLibrary.Flags[FlagName].CurrentKeybind or RayfieldLibrary.Flags[FlagName].CurrentOption or RayfieldLibrary.Flags[FlagName].Color ~= FlagValue then RayfieldLibrary.Flags[FlagName]:Set(FlagValue) end
  281.                 end    
  282.             end)
  283.         else
  284.             RayfieldLibrary:Notify({Title = "Flag Error", Content = "Rayfield was unable to find '"..FlagName.. "'' in the current script"})
  285.         end
  286.     end
  287. end
  288.  
  289. local function SaveConfiguration()
  290.     if not CEnabled then return end
  291.     local Data = {}
  292.     for i,v in pairs(RayfieldLibrary.Flags) do
  293.         if v.Type == "ColorPicker" then
  294.             Data[i] = PackColor(v.Color)
  295.         else
  296.             Data[i] = v.CurrentValue or v.CurrentKeybind or v.CurrentOption or v.Color
  297.         end
  298.     end
  299.     writefile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension, tostring(HttpService:JSONEncode(Data)))
  300. end
  301.  
  302. local neon = (function() -- Open sourced neon module
  303.     local module = {}
  304.  
  305.     do
  306.         local function IsNotNaN(x)
  307.             return x == x
  308.         end
  309.         local continued = IsNotNaN(Camera:ScreenPointToRay(0,0).Origin.x)
  310.         while not continued do
  311.             RunService.RenderStepped:wait()
  312.             continued = IsNotNaN(Camera:ScreenPointToRay(0,0).Origin.x)
  313.         end
  314.     end
  315.     local RootParent = Camera
  316.     if getgenv().SecureMode == nil then
  317.         RootParent = Camera
  318.     else
  319.         if not getgenv().SecureMode then
  320.             RootParent = Camera
  321.         else
  322.             RootParent = nil
  323.         end
  324.     end
  325.  
  326.  
  327.     local binds = {}
  328.     local root = Instance.new('Folder', RootParent)
  329.     root.Name = 'neon'
  330.  
  331.  
  332.     local GenUid; do
  333.         local id = 0
  334.         function GenUid()
  335.             id = id + 1
  336.             return 'neon::'..tostring(id)
  337.         end
  338.     end
  339.  
  340.     local DrawQuad; do
  341.         local acos, max, pi, sqrt = math.acos, math.max, math.pi, math.sqrt
  342.         local sz = 0.2
  343.  
  344.         function DrawTriangle(v1, v2, v3, p0, p1)
  345.             local s1 = (v1 - v2).magnitude
  346.             local s2 = (v2 - v3).magnitude
  347.             local s3 = (v3 - v1).magnitude
  348.             local smax = max(s1, s2, s3)
  349.             local A, B, C
  350.             if s1 == smax then
  351.                 A, B, C = v1, v2, v3
  352.             elseif s2 == smax then
  353.                 A, B, C = v2, v3, v1
  354.             elseif s3 == smax then
  355.                 A, B, C = v3, v1, v2
  356.             end
  357.  
  358.             local para = ( (B-A).x*(C-A).x + (B-A).y*(C-A).y + (B-A).z*(C-A).z ) / (A-B).magnitude
  359.             local perp = sqrt((C-A).magnitude^2 - para*para)
  360.             local dif_para = (A - B).magnitude - para
  361.  
  362.             local st = CFrame.new(B, A)
  363.             local za = CFrame.Angles(pi/2,0,0)
  364.  
  365.             local cf0 = st
  366.  
  367.             local Top_Look = (cf0 * za).lookVector
  368.             local Mid_Point = A + CFrame.new(A, B).LookVector * para
  369.             local Needed_Look = CFrame.new(Mid_Point, C).LookVector
  370.             local dot = Top_Look.x*Needed_Look.x + Top_Look.y*Needed_Look.y + Top_Look.z*Needed_Look.z
  371.  
  372.             local ac = CFrame.Angles(0, 0, acos(dot))
  373.  
  374.             cf0 = cf0 * ac
  375.             if ((cf0 * za).lookVector - Needed_Look).magnitude > 0.01 then
  376.                 cf0 = cf0 * CFrame.Angles(0, 0, -2*acos(dot))
  377.             end
  378.             cf0 = cf0 * CFrame.new(0, perp/2, -(dif_para + para/2))
  379.  
  380.             local cf1 = st * ac * CFrame.Angles(0, pi, 0)
  381.             if ((cf1 * za).lookVector - Needed_Look).magnitude > 0.01 then
  382.                 cf1 = cf1 * CFrame.Angles(0, 0, 2*acos(dot))
  383.             end
  384.             cf1 = cf1 * CFrame.new(0, perp/2, dif_para/2)
  385.  
  386.             if not p0 then
  387.                 p0 = Instance.new('Part')
  388.                 p0.FormFactor = 'Custom'
  389.                 p0.TopSurface = 0
  390.                 p0.BottomSurface = 0
  391.                 p0.Anchored = true
  392.                 p0.CanCollide = false
  393.                 p0.Material = 'Glass'
  394.                 p0.Size = Vector3.new(sz, sz, sz)
  395.                 local mesh = Instance.new('SpecialMesh', p0)
  396.                 mesh.MeshType = 2
  397.                 mesh.Name = 'WedgeMesh'
  398.             end
  399.             p0.WedgeMesh.Scale = Vector3.new(0, perp/sz, para/sz)
  400.             p0.CFrame = cf0
  401.  
  402.             if not p1 then
  403.                 p1 = p0:clone()
  404.             end
  405.             p1.WedgeMesh.Scale = Vector3.new(0, perp/sz, dif_para/sz)
  406.             p1.CFrame = cf1
  407.  
  408.             return p0, p1
  409.         end
  410.  
  411.         function DrawQuad(v1, v2, v3, v4, parts)
  412.             parts[1], parts[2] = DrawTriangle(v1, v2, v3, parts[1], parts[2])
  413.             parts[3], parts[4] = DrawTriangle(v3, v2, v4, parts[3], parts[4])
  414.         end
  415.     end
  416.  
  417.     function module:BindFrame(frame, properties)
  418.         if RootParent == nil then return end
  419.         if binds[frame] then
  420.             return binds[frame].parts
  421.         end
  422.  
  423.         local uid = GenUid()
  424.         local parts = {}
  425.         local f = Instance.new('Folder', root)
  426.         f.Name = frame.Name
  427.  
  428.         local parents = {}
  429.         do
  430.             local function add(child)
  431.                 if child:IsA'GuiObject' then
  432.                     parents[#parents + 1] = child
  433.                     add(child.Parent)
  434.                 end
  435.             end
  436.             add(frame)
  437.         end
  438.  
  439.         local function UpdateOrientation(fetchProps)
  440.             local zIndex = 1 - 0.05*frame.ZIndex
  441.             local tl, br = frame.AbsolutePosition, frame.AbsolutePosition + frame.AbsoluteSize
  442.             local tr, bl = Vector2.new(br.x, tl.y), Vector2.new(tl.x, br.y)
  443.             do
  444.                 local rot = 0;
  445.                 for _, v in ipairs(parents) do
  446.                     rot = rot + v.Rotation
  447.                 end
  448.                 if rot ~= 0 and rot%180 ~= 0 then
  449.                     local mid = tl:lerp(br, 0.5)
  450.                     local s, c = math.sin(math.rad(rot)), math.cos(math.rad(rot))
  451.                     local vec = tl
  452.                     tl = Vector2.new(c*(tl.x - mid.x) - s*(tl.y - mid.y), s*(tl.x - mid.x) + c*(tl.y - mid.y)) + mid
  453.                     tr = Vector2.new(c*(tr.x - mid.x) - s*(tr.y - mid.y), s*(tr.x - mid.x) + c*(tr.y - mid.y)) + mid
  454.                     bl = Vector2.new(c*(bl.x - mid.x) - s*(bl.y - mid.y), s*(bl.x - mid.x) + c*(bl.y - mid.y)) + mid
  455.                     br = Vector2.new(c*(br.x - mid.x) - s*(br.y - mid.y), s*(br.x - mid.x) + c*(br.y - mid.y)) + mid
  456.                 end
  457.             end
  458.             DrawQuad(
  459.                 Camera:ScreenPointToRay(tl.x, tl.y, zIndex).Origin,
  460.                 Camera:ScreenPointToRay(tr.x, tr.y, zIndex).Origin,
  461.                 Camera:ScreenPointToRay(bl.x, bl.y, zIndex).Origin,
  462.                 Camera:ScreenPointToRay(br.x, br.y, zIndex).Origin,
  463.                 parts
  464.             )
  465.             if fetchProps then
  466.                 for _, pt in pairs(parts) do
  467.                     pt.Parent = f
  468.                 end
  469.                 for propName, propValue in pairs(properties) do
  470.                     for _, pt in pairs(parts) do
  471.                         pt[propName] = propValue
  472.                     end
  473.                 end
  474.             end
  475.         end
  476.  
  477.         UpdateOrientation(true)
  478.         RunService:BindToRenderStep(uid, 2000, UpdateOrientation)
  479.  
  480.         binds[frame] = {
  481.             uid = uid;
  482.             parts = parts;
  483.         }
  484.         return binds[frame].parts
  485.     end
  486.  
  487.     function module:Modify(frame, properties)
  488.         local parts = module:GetBoundParts(frame)
  489.         if parts then
  490.             for propName, propValue in pairs(properties) do
  491.                 for _, pt in pairs(parts) do
  492.                     pt[propName] = propValue
  493.                 end
  494.             end
  495.         end
  496.     end
  497.  
  498.     function module:UnbindFrame(frame)
  499.         if RootParent == nil then return end
  500.         local cb = binds[frame]
  501.         if cb then
  502.             RunService:UnbindFromRenderStep(cb.uid)
  503.             for _, v in pairs(cb.parts) do
  504.                 v:Destroy()
  505.             end
  506.             binds[frame] = nil
  507.         end
  508.     end
  509.  
  510.     function module:HasBinding(frame)
  511.         return binds[frame] ~= nil
  512.     end
  513.  
  514.     function module:GetBoundParts(frame)
  515.         return binds[frame] and binds[frame].parts
  516.     end
  517.  
  518.  
  519.     return module
  520.  
  521. end)()
  522.  
  523. function RayfieldLibrary:Notify(NotificationSettings)
  524.     spawn(function()
  525.         local ActionCompleted = true
  526.         local Notification = Notifications.Template:Clone()
  527.         Notification.Parent = Notifications
  528.         Notification.Name = NotificationSettings.Title or "Unknown Title"
  529.         Notification.Visible = true
  530.  
  531.         local blurlight = nil
  532.         if not getgenv().SecureMode then
  533.             blurlight = Instance.new("DepthOfFieldEffect",game:GetService("Lighting"))
  534.             blurlight.Enabled = true
  535.             blurlight.FarIntensity = 0
  536.             blurlight.FocusDistance = 51.6
  537.             blurlight.InFocusRadius = 50
  538.             blurlight.NearIntensity = 1
  539.             game:GetService("Debris"):AddItem(script,0)
  540.         end
  541.  
  542.         Notification.Actions.Template.Visible = false
  543.  
  544.         if NotificationSettings.Actions then
  545.             for _, Action in pairs(NotificationSettings.Actions) do
  546.                 ActionCompleted = false
  547.                 local NewAction = Notification.Actions.Template:Clone()
  548.                 NewAction.BackgroundColor3 = SelectedTheme.NotificationActionsBackground
  549.                 if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  550.                     NewAction.TextColor3 = SelectedTheme.TextColor
  551.                 end
  552.                 NewAction.Name = Action.Name
  553.                 NewAction.Visible = true
  554.                 NewAction.Parent = Notification.Actions
  555.                 NewAction.Text = Action.Name
  556.                 NewAction.BackgroundTransparency = 1
  557.                 NewAction.TextTransparency = 1
  558.                 NewAction.Size = UDim2.new(0, NewAction.TextBounds.X + 27, 0, 36)
  559.  
  560.                 NewAction.MouseButton1Click:Connect(function()
  561.                     local Success, Response = pcall(Action.Callback)
  562.                     if not Success then
  563.                         print("Rayfield | Action: "..Action.Name.." Callback Error " ..tostring(Response))
  564.                     end
  565.                     ActionCompleted = true
  566.                 end)
  567.             end
  568.         end
  569.         Notification.BackgroundColor3 = SelectedTheme.Background
  570.         Notification.Title.Text = NotificationSettings.Title or "Unknown"
  571.         Notification.Title.TextTransparency = 1
  572.         Notification.Title.TextColor3 = SelectedTheme.TextColor
  573.         Notification.Description.Text = NotificationSettings.Content or "Unknown"
  574.         Notification.Description.TextTransparency = 1
  575.         Notification.Description.TextColor3 = SelectedTheme.TextColor
  576.         Notification.Icon.ImageColor3 = SelectedTheme.TextColor
  577.         if NotificationSettings.Image then
  578.             Notification.Icon.Image = "rbxassetid://"..tostring(NotificationSettings.Image)
  579.         else
  580.             Notification.Icon.Image = "rbxassetid://3944680095"
  581.         end
  582.  
  583.         Notification.Icon.ImageTransparency = 1
  584.  
  585.         Notification.Parent = Notifications
  586.         Notification.Size = UDim2.new(0, 260, 0, 80)
  587.         Notification.BackgroundTransparency = 1
  588.  
  589.         TweenService:Create(Notification, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 295, 0, 91)}):Play()
  590.         TweenService:Create(Notification, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.1}):Play()
  591.         Notification:TweenPosition(UDim2.new(0.5,0,0.915,0),'Out','Quint',0.8,true)
  592.  
  593.         wait(0.3)
  594.         TweenService:Create(Notification.Icon, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  595.         TweenService:Create(Notification.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  596.         TweenService:Create(Notification.Description, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.2}):Play()
  597.         wait(0.2)
  598.  
  599.  
  600.  
  601.         -- Requires Graphics Level 8-10
  602.         if getgenv().SecureMode == nil then
  603.             TweenService:Create(Notification, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.4}):Play()
  604.         else
  605.             if not getgenv().SecureMode then
  606.                 TweenService:Create(Notification, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.4}):Play()
  607.             else
  608.                 TweenService:Create(Notification, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  609.             end
  610.         end
  611.  
  612.         if Rayfield.Name == "Rayfield" then
  613.             neon:BindFrame(Notification.BlurModule, {
  614.                 Transparency = 0.98;
  615.                 BrickColor = BrickColor.new("Institutional white");
  616.             })
  617.         end
  618.  
  619.         if not NotificationSettings.Actions then
  620.             wait(NotificationSettings.Duration or NotificationDuration - 0.5)
  621.         else
  622.             wait(0.8)
  623.             TweenService:Create(Notification, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 295, 0, 132)}):Play()
  624.             wait(0.3)
  625.             for _, Action in ipairs(Notification.Actions:GetChildren()) do
  626.                 if Action.ClassName == "TextButton" and Action.Name ~= "Template" then
  627.                     TweenService:Create(Action, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.2}):Play()
  628.                     TweenService:Create(Action, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  629.                     wait(0.05)
  630.                 end
  631.             end
  632.         end
  633.  
  634.         repeat wait(0.001) until ActionCompleted
  635.  
  636.         for _, Action in ipairs(Notification.Actions:GetChildren()) do
  637.             if Action.ClassName == "TextButton" and Action.Name ~= "Template" then
  638.                 TweenService:Create(Action, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  639.                 TweenService:Create(Action, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  640.             end
  641.         end
  642.  
  643.         TweenService:Create(Notification.Title, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Position = UDim2.new(0.47, 0,0.234, 0)}):Play()
  644.         TweenService:Create(Notification.Description, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {Position = UDim2.new(0.528, 0,0.637, 0)}):Play()
  645.         TweenService:Create(Notification, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 280, 0, 83)}):Play()
  646.         TweenService:Create(Notification.Icon, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  647.         TweenService:Create(Notification, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.6}):Play()
  648.  
  649.         wait(0.3)
  650.         TweenService:Create(Notification.Title, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.4}):Play()
  651.         TweenService:Create(Notification.Description, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.5}):Play()
  652.         wait(0.4)
  653.         TweenService:Create(Notification, TweenInfo.new(0.9, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 260, 0, 0)}):Play()
  654.         TweenService:Create(Notification, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  655.         TweenService:Create(Notification.Title, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  656.         TweenService:Create(Notification.Description, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  657.         wait(0.2)
  658.         if not getgenv().SecureMode then
  659.             neon:UnbindFrame(Notification.BlurModule)
  660.             blurlight:Destroy()
  661.         end
  662.         wait(0.9)
  663.         Notification:Destroy()
  664.     end)
  665. end
  666.  
  667. function Hide()
  668.     Debounce = true
  669.     RayfieldLibrary:Notify({Title = "Interface Hidden", Content = "The interface has been hidden, you can unhide the interface by tapping K", Duration = 7})
  670.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 470, 0, 400)}):Play()
  671.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 470, 0, 45)}):Play()
  672.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  673.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  674.     TweenService:Create(Main.Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  675.     TweenService:Create(Main.Topbar.CornerRepair, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  676.     TweenService:Create(Main.Topbar.Title, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  677.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  678.     TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  679.     for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  680.         if TopbarButton.ClassName == "ImageButton" then
  681.             TweenService:Create(TopbarButton, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  682.         end
  683.     end
  684.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  685.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  686.             TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  687.             TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  688.             TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  689.             TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  690.             TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  691.         end
  692.     end
  693.     for _, tab in ipairs(Elements:GetChildren()) do
  694.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  695.             for _, element in ipairs(tab:GetChildren()) do
  696.                 if element.ClassName == "Frame" then
  697.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  698.                         if element.Name == "SectionTitle" then
  699.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  700.                         else
  701.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  702.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  703.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  704.                         end
  705.                         for _, child in ipairs(element:GetChildren()) do
  706.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  707.                                 child.Visible = false
  708.                             end
  709.                         end
  710.                     end
  711.                 end
  712.             end
  713.         end
  714.     end
  715.     wait(0.5)
  716.     Main.Visible = false
  717.     Debounce = false
  718. end
  719.  
  720. function Unhide()
  721.     Debounce = true
  722.     Main.Position = UDim2.new(0.5, 0, 0.5, 0)
  723.     Main.Visible = true
  724.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 475)}):Play()
  725.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 45)}):Play()
  726.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.4}):Play()
  727.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  728.     TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  729.     TweenService:Create(Main.Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  730.     TweenService:Create(Main.Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  731.     TweenService:Create(Main.Topbar.Title, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  732.     if Minimised then
  733.         spawn(Maximise)
  734.     end
  735.     for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  736.         if TopbarButton.ClassName == "ImageButton" then
  737.             TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  738.         end
  739.     end
  740.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  741.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  742.             if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  743.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  744.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  745.                 TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.9}):Play()
  746.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  747.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  748.             else
  749.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.7}):Play()
  750.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.2}):Play()
  751.                 TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.7}):Play()
  752.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0.2}):Play()
  753.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  754.             end
  755.  
  756.         end
  757.     end
  758.     for _, tab in ipairs(Elements:GetChildren()) do
  759.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  760.             for _, element in ipairs(tab:GetChildren()) do
  761.                 if element.ClassName == "Frame" then
  762.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  763.                         if element.Name == "SectionTitle" then
  764.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  765.                         else
  766.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  767.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  768.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  769.                         end
  770.                         for _, child in ipairs(element:GetChildren()) do
  771.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  772.                                 child.Visible = true
  773.                             end
  774.                         end
  775.                     end
  776.                 end
  777.             end
  778.         end
  779.     end
  780.     wait(0.5)
  781.     Minimised = false
  782.     Debounce = false
  783. end
  784.  
  785. function Maximise()
  786.     Debounce = true
  787.     Topbar.ChangeSize.Image = "rbxassetid://"..10137941941
  788.  
  789.  
  790.     TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  791.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 0.4}):Play()
  792.     TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  793.     TweenService:Create(Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  794.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 475)}):Play()
  795.     TweenService:Create(Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 45)}):Play()
  796.     TabList.Visible = true
  797.     wait(0.2)
  798.  
  799.     Elements.Visible = true
  800.  
  801.     for _, tab in ipairs(Elements:GetChildren()) do
  802.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  803.             for _, element in ipairs(tab:GetChildren()) do
  804.                 if element.ClassName == "Frame" then
  805.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  806.                         if element.Name == "SectionTitle" then
  807.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  808.                         else
  809.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  810.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  811.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  812.                         end
  813.                         for _, child in ipairs(element:GetChildren()) do
  814.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  815.                                 child.Visible = true
  816.                             end
  817.                         end
  818.                     end
  819.                 end
  820.             end
  821.         end
  822.     end
  823.  
  824.  
  825.     wait(0.1)
  826.  
  827.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  828.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  829.             if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  830.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  831.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  832.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  833.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  834.                 TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.9}):Play()
  835.             else
  836.                 TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.7}):Play()
  837.                 TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.7}):Play()
  838.                 TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.2}):Play()
  839.                 TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0.2}):Play()
  840.                 TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  841.             end
  842.  
  843.         end
  844.     end
  845.  
  846.  
  847.     wait(0.5)
  848.     Debounce = false
  849. end
  850.  
  851. function Minimise()
  852.     Debounce = true
  853.     Topbar.ChangeSize.Image = "rbxassetid://"..11036884234
  854.  
  855.     for _, tabbtn in ipairs(TabList:GetChildren()) do
  856.         if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  857.             TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  858.             TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  859.             TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  860.             TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  861.             TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  862.         end
  863.     end
  864.  
  865.     for _, tab in ipairs(Elements:GetChildren()) do
  866.         if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  867.             for _, element in ipairs(tab:GetChildren()) do
  868.                 if element.ClassName == "Frame" then
  869.                     if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  870.                         if element.Name == "SectionTitle" then
  871.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  872.                         else
  873.                             TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  874.                             TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  875.                             TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  876.                         end
  877.                         for _, child in ipairs(element:GetChildren()) do
  878.                             if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  879.                                 child.Visible = false
  880.                             end
  881.                         end
  882.                     end
  883.                 end
  884.             end
  885.         end
  886.     end
  887.  
  888.     TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  889.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  890.     TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  891.     TweenService:Create(Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  892.     TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 495, 0, 45)}):Play()
  893.     TweenService:Create(Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 495, 0, 45)}):Play()
  894.  
  895.     wait(0.3)
  896.  
  897.     Elements.Visible = false
  898.     TabList.Visible = false
  899.  
  900.     wait(0.2)
  901.     Debounce = false
  902. end
  903.  
  904. function RayfieldLibrary:CreateWindow(Settings)
  905.     local Passthrough = false
  906.     Topbar.Title.Text = Settings.Name
  907.     Main.Size = UDim2.new(0, 450, 0, 260)
  908.     Main.Visible = true
  909.     Main.BackgroundTransparency = 1
  910.     LoadingFrame.Title.TextTransparency = 1
  911.     LoadingFrame.Subtitle.TextTransparency = 1
  912.     Main.Shadow.Image.ImageTransparency = 1
  913.     LoadingFrame.Version.TextTransparency = 1
  914.     LoadingFrame.Title.Text = Settings.LoadingTitle or "Rayfield Interface Suite"
  915.     LoadingFrame.Subtitle.Text = Settings.LoadingSubtitle or "by Sirius"
  916.     if Settings.LoadingTitle ~= "Rayfield Interface Suite" then
  917.         LoadingFrame.Version.Text = "Rayfield UI"
  918.     end
  919.     Topbar.Visible = false
  920.     Elements.Visible = false
  921.     LoadingFrame.Visible = true
  922.  
  923.  
  924.     pcall(function()
  925.         if not Settings.ConfigurationSaving.FileName then
  926.             Settings.ConfigurationSaving.FileName = tostring(game.PlaceId)
  927.         end
  928.         if not isfolder(RayfieldFolder.."/".."Configuration Folders") then
  929.  
  930.         end
  931.         if Settings.ConfigurationSaving.Enabled == nil then
  932.             Settings.ConfigurationSaving.Enabled = false
  933.         end
  934.         CFileName = Settings.ConfigurationSaving.FileName
  935.         ConfigurationFolder = Settings.ConfigurationSaving.FolderName or ConfigurationFolder
  936.         CEnabled = Settings.ConfigurationSaving.Enabled
  937.  
  938.         if Settings.ConfigurationSaving.Enabled then
  939.             if not isfolder(ConfigurationFolder) then
  940.                 makefolder(ConfigurationFolder)
  941.             end
  942.         end
  943.     end)
  944.  
  945.     AddDraggingFunctionality(Topbar,Main)
  946.  
  947.     for _, TabButton in ipairs(TabList:GetChildren()) do
  948.         if TabButton.ClassName == "Frame" and TabButton.Name ~= "Placeholder" then
  949.             TabButton.BackgroundTransparency = 1
  950.             TabButton.Title.TextTransparency = 1
  951.             TabButton.Shadow.ImageTransparency = 1
  952.             TabButton.Image.ImageTransparency = 1
  953.             TabButton.UIStroke.Transparency = 1
  954.         end
  955.     end
  956.  
  957.     if Settings.Discord then
  958.         if not isfolder(RayfieldFolder.."/Discord Invites") then
  959.             makefolder(RayfieldFolder.."/Discord Invites")
  960.         end
  961.         if not isfile(RayfieldFolder.."/Discord Invites".."/"..Settings.Discord.Invite..ConfigurationExtension) then
  962.             if request then
  963.                 request({
  964.                     Url = 'http://127.0.0.1:6463/rpc?v=1',
  965.                     Method = 'POST',
  966.                     Headers = {
  967.                         ['Content-Type'] = 'application/json',
  968.                         Origin = 'https://discord.com'
  969.                     },
  970.                     Body = HttpService:JSONEncode({
  971.                         cmd = 'INVITE_BROWSER',
  972.                         nonce = HttpService:GenerateGUID(false),
  973.                         args = {code = Settings.Discord.Invite}
  974.                     })
  975.                 })
  976.             end
  977.  
  978.             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
  979.                 writefile(RayfieldFolder.."/Discord Invites".."/"..Settings.Discord.Invite..ConfigurationExtension,"Rayfield RememberJoins is true for this invite, this invite will not ask you to join again")
  980.             end
  981.         else
  982.  
  983.         end
  984.     end
  985.  
  986.     if Settings.KeySystem then
  987.         if not Settings.KeySettings then
  988.             Passthrough = true
  989.             return
  990.         end
  991.  
  992.         if not isfolder(RayfieldFolder.."/Key System") then
  993.             makefolder(RayfieldFolder.."/Key System")
  994.         end
  995.  
  996.         if typeof(Settings.KeySettings.Key) == "string" then Settings.KeySettings.Key = {Settings.KeySettings.Key} end
  997.  
  998.         if Settings.KeySettings.GrabKeyFromSite then
  999.             for i, Key in ipairs(Settings.KeySettings.Key) do
  1000.                 local Success, Response = pcall(function()
  1001.                     Settings.KeySettings.Key[i] = tostring(game:HttpGet(Key):gsub("[\n\r]", " "))
  1002.                     Settings.KeySettings.Key[i] = string.gsub(Settings.KeySettings.Key[i], " ", "")
  1003.                 end)
  1004.                 if not Success then
  1005.                     print("Rayfield | "..Key.." Error " ..tostring(Response))
  1006.                 end
  1007.             end
  1008.         end
  1009.  
  1010.         if not Settings.KeySettings.FileName then
  1011.             Settings.KeySettings.FileName = "No file name specified"
  1012.         end
  1013.  
  1014.         if isfile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension) then
  1015.             for _, MKey in ipairs(Settings.KeySettings.Key) do
  1016.                 if string.find(readfile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension), MKey) then
  1017.                     Passthrough = true
  1018.                 end
  1019.             end
  1020.         end
  1021.  
  1022.         if not Passthrough then
  1023.             local AttemptsRemaining = math.random(2,6)
  1024.             Rayfield.Enabled = false
  1025.             local KeyUI = game:GetObjects("rbxassetid://11380036235")[1]
  1026.  
  1027.             if gethui then
  1028.                 KeyUI.Parent = gethui()
  1029.             elseif syn.protect_gui then
  1030.                 syn.protect_gui(Rayfield)
  1031.                 KeyUI.Parent = CoreGui
  1032.             else
  1033.                 KeyUI.Parent = CoreGui
  1034.             end
  1035.  
  1036.             if gethui then
  1037.                 for _, Interface in ipairs(gethui():GetChildren()) do
  1038.                     if Interface.Name == KeyUI.Name and Interface ~= KeyUI then
  1039.                         Interface.Enabled = false
  1040.                         Interface.Name = "KeyUI-Old"
  1041.                     end
  1042.                 end
  1043.             else
  1044.                 for _, Interface in ipairs(CoreGui:GetChildren()) do
  1045.                     if Interface.Name == KeyUI.Name and Interface ~= KeyUI then
  1046.                         Interface.Enabled = false
  1047.                         Interface.Name = "KeyUI-Old"
  1048.                     end
  1049.                 end
  1050.             end
  1051.  
  1052.             local KeyMain = KeyUI.Main
  1053.             KeyMain.Title.Text = Settings.KeySettings.Title or Settings.Name
  1054.             KeyMain.Subtitle.Text = Settings.KeySettings.Subtitle or "Key System"
  1055.             KeyMain.NoteMessage.Text = Settings.KeySettings.Note or "No instructions"
  1056.  
  1057.             KeyMain.Size = UDim2.new(0, 467, 0, 175)
  1058.             KeyMain.BackgroundTransparency = 1
  1059.             KeyMain.Shadow.Image.ImageTransparency = 1
  1060.             KeyMain.Title.TextTransparency = 1
  1061.             KeyMain.Subtitle.TextTransparency = 1
  1062.             KeyMain.KeyNote.TextTransparency = 1
  1063.             KeyMain.Input.BackgroundTransparency = 1
  1064.             KeyMain.Input.UIStroke.Transparency = 1
  1065.             KeyMain.Input.InputBox.TextTransparency = 1
  1066.             KeyMain.NoteTitle.TextTransparency = 1
  1067.             KeyMain.NoteMessage.TextTransparency = 1
  1068.             KeyMain.Hide.ImageTransparency = 1
  1069.  
  1070.             TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1071.             TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 187)}):Play()
  1072.             TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 0.5}):Play()
  1073.             wait(0.05)
  1074.             TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1075.             TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1076.             wait(0.05)
  1077.             TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1078.             TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1079.             TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1080.             TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1081.             wait(0.05)
  1082.             TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1083.             TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1084.             wait(0.15)
  1085.             TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {ImageTransparency = 0.3}):Play()
  1086.  
  1087.  
  1088.             KeyUI.Main.Input.InputBox.FocusLost:Connect(function()
  1089.                 if #KeyUI.Main.Input.InputBox.Text == 0 then return end
  1090.                 local KeyFound = false
  1091.                 local FoundKey = ''
  1092.                 for _, MKey in ipairs(Settings.KeySettings.Key) do
  1093.                     if string.find(KeyMain.Input.InputBox.Text, MKey) then
  1094.                         KeyFound = true
  1095.                         FoundKey = MKey
  1096.                     end
  1097.                 end
  1098.                 if KeyFound then
  1099.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1100.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1101.                     TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1102.                     TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1103.                     TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1104.                     TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1105.                     TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1106.                     TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1107.                     TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1108.                     TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1109.                     TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1110.                     TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1111.                     wait(0.51)
  1112.                     Passthrough = true
  1113.                     if Settings.KeySettings.SaveKey then
  1114.                         if writefile then
  1115.                             writefile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension, FoundKey)
  1116.                         end
  1117.                         RayfieldLibrary:Notify({Title = "Key System", Content = "The key for this script has been saved successfully"})
  1118.                     end
  1119.                 else
  1120.                     if AttemptsRemaining == 0 then
  1121.                         TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1122.                         TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1123.                         TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1124.                         TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1125.                         TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1126.                         TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1127.                         TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1128.                         TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1129.                         TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1130.                         TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1131.                         TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1132.                         TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1133.                         wait(0.45)
  1134.                         game.Players.LocalPlayer:Kick("No Attempts Remaining")
  1135.                         game:Shutdown()
  1136.                     end
  1137.                     KeyMain.Input.InputBox.Text = ""
  1138.                     AttemptsRemaining = AttemptsRemaining - 1
  1139.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1140.                     TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Elastic), {Position = UDim2.new(0.495,0,0.5,0)}):Play()
  1141.                     wait(0.1)
  1142.                     TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Elastic), {Position = UDim2.new(0.505,0,0.5,0)}):Play()
  1143.                     wait(0.1)
  1144.                     TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {Position = UDim2.new(0.5,0,0.5,0)}):Play()
  1145.                     TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 187)}):Play()
  1146.                 end
  1147.             end)
  1148.  
  1149.             KeyMain.Hide.MouseButton1Click:Connect(function()
  1150.                 TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1151.                 TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1152.                 TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1153.                 TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1154.                 TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1155.                 TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1156.                 TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1157.                 TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1158.                 TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1159.                 TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1160.                 TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1161.                 TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1162.                 wait(0.51)
  1163.                 RayfieldLibrary:Destroy()
  1164.                 KeyUI:Destroy()
  1165.             end)
  1166.         else
  1167.             Passthrough = true
  1168.         end
  1169.     end
  1170.     if Settings.KeySystem then
  1171.         repeat wait() until Passthrough
  1172.     end
  1173.  
  1174.     Notifications.Template.Visible = false
  1175.     Notifications.Visible = true
  1176.     Rayfield.Enabled = true
  1177.     wait(0.5)
  1178.     TweenService:Create(Main, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1179.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.55}):Play()
  1180.     wait(0.1)
  1181.     TweenService:Create(LoadingFrame.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1182.     wait(0.05)
  1183.     TweenService:Create(LoadingFrame.Subtitle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1184.     wait(0.05)
  1185.     TweenService:Create(LoadingFrame.Version, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1186.  
  1187.     Elements.Template.LayoutOrder = 100000
  1188.     Elements.Template.Visible = false
  1189.  
  1190.     Elements.UIPageLayout.FillDirection = Enum.FillDirection.Horizontal
  1191.     TabList.Template.Visible = false
  1192.  
  1193.     -- Tab
  1194.     local FirstTab = false
  1195.     local Window = {}
  1196.     function Window:CreateTab(Name,Image)
  1197.         local SDone = false
  1198.         local TabButton = TabList.Template:Clone()
  1199.         TabButton.Name = Name
  1200.         TabButton.Title.Text = Name
  1201.         TabButton.Parent = TabList
  1202.         TabButton.Title.TextWrapped = false
  1203.         TabButton.Size = UDim2.new(0, TabButton.Title.TextBounds.X + 30, 0, 30)
  1204.  
  1205.         if Image then
  1206.             TabButton.Title.AnchorPoint = Vector2.new(0, 0.5)
  1207.             TabButton.Title.Position = UDim2.new(0, 37, 0.5, 0)
  1208.             TabButton.Image.Image = "rbxassetid://"..Image
  1209.             TabButton.Image.Visible = true
  1210.             TabButton.Title.TextXAlignment = Enum.TextXAlignment.Left
  1211.             TabButton.Size = UDim2.new(0, TabButton.Title.TextBounds.X + 46, 0, 30)
  1212.         end
  1213.  
  1214.         TabButton.BackgroundTransparency = 1
  1215.         TabButton.Title.TextTransparency = 1
  1216.         TabButton.Shadow.ImageTransparency = 1
  1217.         TabButton.Image.ImageTransparency = 1
  1218.         TabButton.UIStroke.Transparency = 1
  1219.  
  1220.         TabButton.Visible = true
  1221.  
  1222.         -- Create Elements Page
  1223.         local TabPage = Elements.Template:Clone()
  1224.         TabPage.Name = Name
  1225.         TabPage.Visible = true
  1226.  
  1227.         TabPage.LayoutOrder = #Elements:GetChildren()
  1228.  
  1229.         for _, TemplateElement in ipairs(TabPage:GetChildren()) do
  1230.             if TemplateElement.ClassName == "Frame" and TemplateElement.Name ~= "Placeholder" then
  1231.                 TemplateElement:Destroy()
  1232.             end
  1233.         end
  1234.  
  1235.         TabPage.Parent = Elements
  1236.         if not FirstTab then
  1237.             Elements.UIPageLayout.Animated = false
  1238.             Elements.UIPageLayout:JumpTo(TabPage)
  1239.             Elements.UIPageLayout.Animated = true
  1240.         end
  1241.  
  1242.         if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  1243.             TabButton.Shadow.Visible = false
  1244.         end
  1245.         TabButton.UIStroke.Color = SelectedTheme.TabStroke
  1246.         -- Animate
  1247.         wait(0.1)
  1248.         if FirstTab then
  1249.             TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  1250.             TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  1251.             TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  1252.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.7}):Play()
  1253.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0.2}):Play()
  1254.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.2}):Play()
  1255.             TweenService:Create(TabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1256.  
  1257.             TweenService:Create(TabButton.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.7}):Play()
  1258.         else
  1259.             FirstTab = Name
  1260.             TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  1261.             TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  1262.             TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  1263.             TweenService:Create(TabButton.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.9}):Play()
  1264.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  1265.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1266.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1267.         end
  1268.  
  1269.  
  1270.         TabButton.Interact.MouseButton1Click:Connect(function()
  1271.             if Minimised then return end
  1272.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1273.             TweenService:Create(TabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1274.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1275.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  1276.             TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.TabBackgroundSelected}):Play()
  1277.             TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextColor3 = SelectedTheme.SelectedTabTextColor}):Play()
  1278.             TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageColor3 = SelectedTheme.SelectedTabTextColor}):Play()
  1279.             TweenService:Create(TabButton.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.9}):Play()
  1280.  
  1281.             for _, OtherTabButton in ipairs(TabList:GetChildren()) do
  1282.                 if OtherTabButton.Name ~= "Template" and OtherTabButton.ClassName == "Frame" and OtherTabButton ~= TabButton and OtherTabButton.Name ~= "Placeholder" then
  1283.                     TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.TabBackground}):Play()
  1284.                     TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextColor3 = SelectedTheme.TabTextColor}):Play()
  1285.                     TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageColor3 = SelectedTheme.TabTextColor}):Play()
  1286.                     TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.7}):Play()
  1287.                     TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0.2}):Play()
  1288.                     TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.2}):Play()
  1289.                     TweenService:Create(OtherTabButton.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.7}):Play()
  1290.                     TweenService:Create(OtherTabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1291.                 end
  1292.             end
  1293.             if Elements.UIPageLayout.CurrentPage ~= TabPage then
  1294.                 TweenService:Create(Elements, TweenInfo.new(1, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 460,0, 330)}):Play()
  1295.                 Elements.UIPageLayout:JumpTo(TabPage)
  1296.                 wait(0.2)
  1297.                 TweenService:Create(Elements, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 475,0, 366)}):Play()
  1298.             end
  1299.  
  1300.         end)
  1301.  
  1302.         local Tab = {}
  1303.  
  1304.         -- Button
  1305.         function Tab:CreateButton(ButtonSettings)
  1306.             local ButtonValue = {}
  1307.  
  1308.             local Button = Elements.Template.Button:Clone()
  1309.             Button.Name = ButtonSettings.Name
  1310.             Button.Title.Text = ButtonSettings.Name
  1311.             Button.Visible = true
  1312.             Button.Parent = TabPage
  1313.  
  1314.             Button.BackgroundTransparency = 1
  1315.             Button.UIStroke.Transparency = 1
  1316.             Button.Title.TextTransparency = 1
  1317.  
  1318.             TweenService:Create(Button, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1319.             TweenService:Create(Button.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1320.             TweenService:Create(Button.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()   
  1321.  
  1322.  
  1323.             Button.Interact.MouseButton1Click:Connect(function()
  1324.                 local Success, Response = pcall(ButtonSettings.Callback)
  1325.                 if not Success then
  1326.                     TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1327.                     TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1328.                     TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1329.                     Button.Title.Text = "Callback Error"
  1330.                     print("Rayfield | "..ButtonSettings.Name.." Callback Error " ..tostring(Response))
  1331.                     wait(0.5)
  1332.                     Button.Title.Text = ButtonSettings.Name
  1333.                     TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1334.                     TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.9}):Play()
  1335.                     TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1336.                 else
  1337.                     SaveConfiguration()
  1338.                     TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1339.                     TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1340.                     TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1341.                     wait(0.2)
  1342.                     TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1343.                     TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.9}):Play()
  1344.                     TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1345.                 end
  1346.             end)
  1347.  
  1348.             Button.MouseEnter:Connect(function()
  1349.                 TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1350.                 TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.7}):Play()
  1351.             end)
  1352.  
  1353.             Button.MouseLeave:Connect(function()
  1354.                 TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1355.                 TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.9}):Play()
  1356.             end)
  1357.  
  1358.             function ButtonValue:Set(NewButton)
  1359.                 Button.Title.Text = NewButton
  1360.                 Button.Name = NewButton
  1361.             end
  1362.  
  1363.             return ButtonValue
  1364.         end
  1365.  
  1366.         -- ColorPicker
  1367.         function Tab:CreateColorPicker(ColorPickerSettings) -- by Throit
  1368.             ColorPickerSettings.Type = "ColorPicker"
  1369.             local ColorPicker = Elements.Template.ColorPicker:Clone()
  1370.             local Background = ColorPicker.CPBackground
  1371.             local Display = Background.Display
  1372.             local Main = Background.MainCP
  1373.             local Slider = ColorPicker.ColorSlider
  1374.             ColorPicker.ClipsDescendants = true
  1375.             ColorPicker.Name = ColorPickerSettings.Name
  1376.             ColorPicker.Title.Text = ColorPickerSettings.Name
  1377.             ColorPicker.Visible = true
  1378.             ColorPicker.Parent = TabPage
  1379.             ColorPicker.Size = UDim2.new(1, -10, 0.028, 35)
  1380.             Background.Size = UDim2.new(0, 39, 0, 22)
  1381.             Display.BackgroundTransparency = 0
  1382.             Main.MainPoint.ImageTransparency = 1
  1383.             ColorPicker.Interact.Size = UDim2.new(1, 0, 1, 0)
  1384.             ColorPicker.Interact.Position = UDim2.new(0.5, 0, 0.5, 0)
  1385.             ColorPicker.RGB.Position = UDim2.new(0, 17, 0, 70)
  1386.             ColorPicker.HexInput.Position = UDim2.new(0, 17, 0, 90)
  1387.             Main.ImageTransparency = 1
  1388.             Background.BackgroundTransparency = 1
  1389.  
  1390.  
  1391.  
  1392.             local opened = false
  1393.             local mouse = game.Players.LocalPlayer:GetMouse()
  1394.             Main.Image = "http://www.roblox.com/asset/?id=11415645739"
  1395.             local mainDragging = false
  1396.             local sliderDragging = false
  1397.             ColorPicker.Interact.MouseButton1Down:Connect(function()
  1398.                 if not opened then
  1399.                     opened = true
  1400.                     TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0.224, 40)}):Play()
  1401.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 173, 0, 86)}):Play()
  1402.                     TweenService:Create(Display, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1403.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Position = UDim2.new(0.289, 0, 0.5, 0)}):Play()
  1404.                     TweenService:Create(ColorPicker.RGB, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {Position = UDim2.new(0, 17, 0, 40)}):Play()
  1405.                     TweenService:Create(ColorPicker.HexInput, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Position = UDim2.new(0, 17, 0, 73)}):Play()
  1406.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0.574, 0, 1, 0)}):Play()
  1407.                     TweenService:Create(Main.MainPoint, TweenInfo.new(0.2, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  1408.                     TweenService:Create(Main, TweenInfo.new(0.2, Enum.EasingStyle.Quint), {ImageTransparency = 0.1}):Play()
  1409.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1410.                 else
  1411.                     opened = false
  1412.                     TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0.028, 35)}):Play()
  1413.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 39, 0, 22)}):Play()
  1414.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(1, 0, 1, 0)}):Play()
  1415.                     TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Position = UDim2.new(0.5, 0, 0.5, 0)}):Play()
  1416.                     TweenService:Create(ColorPicker.RGB, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Position = UDim2.new(0, 17, 0, 70)}):Play()
  1417.                     TweenService:Create(ColorPicker.HexInput, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Position = UDim2.new(0, 17, 0, 90)}):Play()
  1418.                     TweenService:Create(Display, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1419.                     TweenService:Create(Main.MainPoint, TweenInfo.new(0.2, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1420.                     TweenService:Create(Main, TweenInfo.new(0.2, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1421.                     TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1422.                 end
  1423.             end)
  1424.            
  1425.            
  1426.  
  1427.  
  1428.             local h,s,v = ColorPickerSettings.Color:ToHSV()
  1429.             local color = Color3.fromHSV(h,s,v)
  1430.             local hex = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1431.             ColorPicker.HexInput.InputBox.Text = hex
  1432.             local function setDisplay()
  1433.                 --Main
  1434.                 Main.MainPoint.Position = UDim2.new(s,-Main.MainPoint.AbsoluteSize.X/2,1-v,-Main.MainPoint.AbsoluteSize.Y/2)
  1435.                 Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1436.                 Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1437.                 Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1438.                 --Slider
  1439.                 local x = h * Slider.AbsoluteSize.X
  1440.                 Slider.SliderPoint.Position = UDim2.new(0,x-Slider.SliderPoint.AbsoluteSize.X/2,0.5,0)
  1441.                 Slider.SliderPoint.ImageColor3 = Color3.fromHSV(h,1,1)
  1442.                 local color = Color3.fromHSV(h,s,v)
  1443.                 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)
  1444.                 ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1445.                 ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1446.                 ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1447.                 hex = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1448.                 ColorPicker.HexInput.InputBox.Text = hex
  1449.             end
  1450.             setDisplay()
  1451.             ColorPicker.HexInput.InputBox.FocusLost:Connect(function()
  1452.                 if not pcall(function()
  1453.                         local r, g, b = string.match(ColorPicker.HexInput.InputBox.Text, "^#?(%w%w)(%w%w)(%w%w)$")
  1454.                         local rgbColor = Color3.fromRGB(tonumber(r, 16),tonumber(g, 16), tonumber(b, 16))
  1455.                         h,s,v = rgbColor:ToHSV()
  1456.                         hex = ColorPicker.HexInput.InputBox.Text
  1457.                         setDisplay()
  1458.                         ColorPickerSettings.Color = rgbColor
  1459.                     end)
  1460.                 then
  1461.                     ColorPicker.HexInput.InputBox.Text = hex
  1462.                 end
  1463.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1464.                 local r,g,b = math.floor((h*255)+0.5),math.floor((s*255)+0.5),math.floor((v*255)+0.5)
  1465.                 ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1466.                 SaveConfiguration()
  1467.             end)
  1468.             --RGB
  1469.             local function rgbBoxes(box,toChange)
  1470.                 local value = tonumber(box.Text)
  1471.                 local color = Color3.fromHSV(h,s,v)
  1472.                 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)
  1473.                 local save
  1474.                 if toChange == "R" then save = oldR;oldR = value elseif toChange == "G" then save = oldG;oldG = value else save = oldB;oldB = value end
  1475.                 if value then
  1476.                     value = math.clamp(value,0,255)
  1477.                     h,s,v = Color3.fromRGB(oldR,oldG,oldB):ToHSV()
  1478.  
  1479.                     setDisplay()
  1480.                 else
  1481.                     box.Text = tostring(save)
  1482.                 end
  1483.                 local r,g,b = math.floor((h*255)+0.5),math.floor((s*255)+0.5),math.floor((v*255)+0.5)
  1484.                 ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1485.                 SaveConfiguration()
  1486.             end
  1487.             ColorPicker.RGB.RInput.InputBox.FocusLost:connect(function()
  1488.                 rgbBoxes(ColorPicker.RGB.RInput.InputBox,"R")
  1489.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1490.             end)
  1491.             ColorPicker.RGB.GInput.InputBox.FocusLost:connect(function()
  1492.                 rgbBoxes(ColorPicker.RGB.GInput.InputBox,"G")
  1493.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1494.             end)
  1495.             ColorPicker.RGB.BInput.InputBox.FocusLost:connect(function()
  1496.                 rgbBoxes(ColorPicker.RGB.BInput.InputBox,"B")
  1497.                 pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1498.             end)
  1499.  
  1500.             game:GetService("RunService").RenderStepped:connect(function()
  1501.                 if mainDragging then
  1502.                     local localX = math.clamp(mouse.X-Main.AbsolutePosition.X,0,Main.AbsoluteSize.X)
  1503.                     local localY = math.clamp(mouse.Y-Main.AbsolutePosition.Y,0,Main.AbsoluteSize.Y)
  1504.                     Main.MainPoint.Position = UDim2.new(0,localX-Main.MainPoint.AbsoluteSize.X/2,0,localY-Main.MainPoint.AbsoluteSize.Y/2)
  1505.                     s = localX / Main.AbsoluteSize.X
  1506.                     v = 1 - (localY / Main.AbsoluteSize.Y)
  1507.                     Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1508.                     Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1509.                     Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1510.                     local color = Color3.fromHSV(h,s,v)
  1511.                     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)
  1512.                     ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1513.                     ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1514.                     ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1515.                     ColorPicker.HexInput.InputBox.Text = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1516.                     pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1517.                     ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1518.                     SaveConfiguration()
  1519.                 end
  1520.                 if sliderDragging then
  1521.                     local localX = math.clamp(mouse.X-Slider.AbsolutePosition.X,0,Slider.AbsoluteSize.X)
  1522.                     h = localX / Slider.AbsoluteSize.X
  1523.                     Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1524.                     Slider.SliderPoint.Position = UDim2.new(0,localX-Slider.SliderPoint.AbsoluteSize.X/2,0.5,0)
  1525.                     Slider.SliderPoint.ImageColor3 = Color3.fromHSV(h,1,1)
  1526.                     Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1527.                     Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1528.                     local color = Color3.fromHSV(h,s,v)
  1529.                     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)
  1530.                     ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1531.                     ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1532.                     ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1533.                     ColorPicker.HexInput.InputBox.Text = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1534.                     pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1535.                     ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1536.                     SaveConfiguration()
  1537.                 end
  1538.             end)
  1539.  
  1540.             if Settings.ConfigurationSaving then
  1541.                 if Settings.ConfigurationSaving.Enabled and ColorPickerSettings.Flag then
  1542.                     RayfieldLibrary.Flags[ColorPickerSettings.Flag] = ColorPickerSettings
  1543.                 end
  1544.             end
  1545.  
  1546.             function ColorPickerSettings:Set(RGBColor)
  1547.                 ColorPickerSettings.Color = RGBColor
  1548.                 h,s,v = ColorPickerSettings.Color:ToHSV()
  1549.                 color = Color3.fromHSV(h,s,v)
  1550.                 setDisplay()
  1551.             end
  1552.  
  1553.             return ColorPickerSettings
  1554.         end
  1555.  
  1556.         -- Section
  1557.         function Tab:CreateSection(SectionName)
  1558.  
  1559.             local SectionValue = {}
  1560.  
  1561.             if SDone then
  1562.                 local SectionSpace = Elements.Template.SectionSpacing:Clone()
  1563.                 SectionSpace.Visible = true
  1564.                 SectionSpace.Parent = TabPage
  1565.             end
  1566.  
  1567.             local Section = Elements.Template.SectionTitle:Clone()
  1568.             Section.Title.Text = SectionName
  1569.             Section.Visible = true
  1570.             Section.Parent = TabPage
  1571.  
  1572.             Section.Title.TextTransparency = 1
  1573.             TweenService:Create(Section.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1574.  
  1575.             function SectionValue:Set(NewSection)
  1576.                 Section.Title.Text = NewSection
  1577.             end
  1578.  
  1579.             SDone = true
  1580.  
  1581.             return SectionValue
  1582.         end
  1583.  
  1584.         -- Label
  1585.         function Tab:CreateLabel(LabelText)
  1586.             local LabelValue = {}
  1587.  
  1588.             local Label = Elements.Template.Label:Clone()
  1589.             Label.Title.Text = LabelText
  1590.             Label.Visible = true
  1591.             Label.Parent = TabPage
  1592.  
  1593.             Label.BackgroundTransparency = 1
  1594.             Label.UIStroke.Transparency = 1
  1595.             Label.Title.TextTransparency = 1
  1596.  
  1597.             Label.BackgroundColor3 = SelectedTheme.SecondaryElementBackground
  1598.             Label.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  1599.  
  1600.             TweenService:Create(Label, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1601.             TweenService:Create(Label.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1602.             TweenService:Create(Label.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1603.  
  1604.             function LabelValue:Set(NewLabel)
  1605.                 Label.Title.Text = NewLabel
  1606.             end
  1607.  
  1608.             return LabelValue
  1609.         end
  1610.  
  1611.         -- Paragraph
  1612.         function Tab:CreateParagraph(ParagraphSettings)
  1613.             local ParagraphValue = {}
  1614.  
  1615.             local Paragraph = Elements.Template.Paragraph:Clone()
  1616.             Paragraph.Title.Text = ParagraphSettings.Title
  1617.             Paragraph.Content.Text = ParagraphSettings.Content
  1618.             Paragraph.Visible = true
  1619.             Paragraph.Parent = TabPage
  1620.  
  1621.             Paragraph.Content.Size = UDim2.new(0, 438, 0, Paragraph.Content.TextBounds.Y)
  1622.             Paragraph.Content.Position = UDim2.new(1, -10, 0.575,0 )
  1623.             Paragraph.Size = UDim2.new(1, -10, 0, Paragraph.Content.TextBounds.Y + 40)
  1624.  
  1625.             Paragraph.BackgroundTransparency = 1
  1626.             Paragraph.UIStroke.Transparency = 1
  1627.             Paragraph.Title.TextTransparency = 1
  1628.             Paragraph.Content.TextTransparency = 1
  1629.  
  1630.             Paragraph.BackgroundColor3 = SelectedTheme.SecondaryElementBackground
  1631.             Paragraph.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  1632.  
  1633.             TweenService:Create(Paragraph, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1634.             TweenService:Create(Paragraph.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1635.             TweenService:Create(Paragraph.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1636.             TweenService:Create(Paragraph.Content, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()  
  1637.  
  1638.             function ParagraphValue:Set(NewParagraphSettings)
  1639.                 Paragraph.Title.Text = NewParagraphSettings.Title
  1640.                 Paragraph.Content.Text = NewParagraphSettings.Content
  1641.             end
  1642.  
  1643.             return ParagraphValue
  1644.         end
  1645.  
  1646.         -- Input
  1647.         function Tab:CreateInput(InputSettings)
  1648.             local Input = Elements.Template.Input:Clone()
  1649.             Input.Name = InputSettings.Name
  1650.             Input.Title.Text = InputSettings.Name
  1651.             Input.Visible = true
  1652.             Input.Parent = TabPage
  1653.  
  1654.             Input.BackgroundTransparency = 1
  1655.             Input.UIStroke.Transparency = 1
  1656.             Input.Title.TextTransparency = 1
  1657.  
  1658.             Input.InputFrame.BackgroundColor3 = SelectedTheme.InputBackground
  1659.             Input.InputFrame.UIStroke.Color = SelectedTheme.InputStroke
  1660.  
  1661.             TweenService:Create(Input, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1662.             TweenService:Create(Input.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1663.             TweenService:Create(Input.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1664.  
  1665.             Input.InputFrame.InputBox.PlaceholderText = InputSettings.PlaceholderText
  1666.             Input.InputFrame.Size = UDim2.new(0, Input.InputFrame.InputBox.TextBounds.X + 24, 0, 30)
  1667.  
  1668.             Input.InputFrame.InputBox.FocusLost:Connect(function()
  1669.  
  1670.  
  1671.                 local Success, Response = pcall(function()
  1672.                     InputSettings.Callback(Input.InputFrame.InputBox.Text)
  1673.                 end)
  1674.                 if not Success then
  1675.                     TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1676.                     TweenService:Create(Input.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1677.                     Input.Title.Text = "Callback Error"
  1678.                     print("Rayfield | "..InputSettings.Name.." Callback Error " ..tostring(Response))
  1679.                     wait(0.5)
  1680.                     Input.Title.Text = InputSettings.Name
  1681.                     TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1682.                     TweenService:Create(Input.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1683.                 end
  1684.  
  1685.                 if InputSettings.RemoveTextAfterFocusLost then
  1686.                     Input.InputFrame.InputBox.Text = ""
  1687.                 end
  1688.                 SaveConfiguration()
  1689.             end)
  1690.  
  1691.             Input.MouseEnter:Connect(function()
  1692.                 TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1693.             end)
  1694.  
  1695.             Input.MouseLeave:Connect(function()
  1696.                 TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1697.             end)
  1698.  
  1699.             Input.InputFrame.InputBox:GetPropertyChangedSignal("Text"):Connect(function()
  1700.                 TweenService:Create(Input.InputFrame, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Size = UDim2.new(0, Input.InputFrame.InputBox.TextBounds.X + 24, 0, 30)}):Play()
  1701.             end)
  1702.  
  1703.             local InputSettings = {}
  1704.             function InputSettings:Set(text) --Doesnt fire the event
  1705.                 Input.InputFrame.InputBox.Text = text
  1706.             end
  1707.             return InputSettings
  1708.         end
  1709.  
  1710.         -- Dropdown
  1711.         function Tab:CreateDropdown(DropdownSettings)
  1712.             local Dropdown = Elements.Template.Dropdown:Clone()
  1713.             if string.find(DropdownSettings.Name,"closed") then
  1714.                 Dropdown.Name = "Dropdown"
  1715.             else
  1716.                 Dropdown.Name = DropdownSettings.Name
  1717.             end
  1718.             Dropdown.Title.Text = DropdownSettings.Name
  1719.             Dropdown.Visible = true
  1720.             Dropdown.Parent = TabPage
  1721.  
  1722.             Dropdown.List.Visible = false
  1723.  
  1724.             if typeof(DropdownSettings.CurrentOption) == "string" then
  1725.                 DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption}
  1726.             end
  1727.  
  1728.             if not DropdownSettings.MultipleOptions then
  1729.                 DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption[1]}
  1730.             end
  1731.  
  1732.             if DropdownSettings.MultipleOptions then
  1733.                 if #DropdownSettings.CurrentOption == 1 then
  1734.                     Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  1735.                 elseif #DropdownSettings.CurrentOption == 0 then
  1736.                     Dropdown.Selected.Text = "None"
  1737.                 else
  1738.                     Dropdown.Selected.Text = "Various"
  1739.                 end
  1740.             else
  1741.                 Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  1742.             end
  1743.  
  1744.  
  1745.             Dropdown.BackgroundTransparency = 1
  1746.             Dropdown.UIStroke.Transparency = 1
  1747.             Dropdown.Title.TextTransparency = 1
  1748.  
  1749.             Dropdown.Size = UDim2.new(1, -10, 0, 45)
  1750.  
  1751.             TweenService:Create(Dropdown, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1752.             TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1753.             TweenService:Create(Dropdown.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play() 
  1754.  
  1755.             for _, ununusedoption in ipairs(Dropdown.List:GetChildren()) do
  1756.                 if ununusedoption.ClassName == "Frame" and ununusedoption.Name ~= "Placeholder" then
  1757.                     ununusedoption:Destroy()
  1758.                 end
  1759.             end
  1760.  
  1761.             Dropdown.Toggle.Rotation = 180
  1762.  
  1763.             Dropdown.Interact.MouseButton1Click:Connect(function()
  1764.                 TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1765.                 TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1766.                 wait(0.1)
  1767.                 TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1768.                 TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1769.                 if Debounce then return end
  1770.                 if Dropdown.List.Visible then
  1771.                     Debounce = true
  1772.                     TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  1773.                     for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  1774.                         if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  1775.                             TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1776.                             TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1777.                             TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1778.                         end
  1779.                     end
  1780.                     TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ScrollBarImageTransparency = 1}):Play()
  1781.                     TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Rotation = 180}):Play()  
  1782.                     wait(0.35)
  1783.                     Dropdown.List.Visible = false
  1784.                     Debounce = false
  1785.                 else
  1786.                     TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0, 180)}):Play()
  1787.                     Dropdown.List.Visible = true
  1788.                     TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ScrollBarImageTransparency = 0.7}):Play()
  1789.                     TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Rotation = 0}):Play()
  1790.                     for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  1791.                         if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  1792.                             TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1793.                             TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1794.                             TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1795.                         end
  1796.                     end
  1797.                 end
  1798.             end)
  1799.  
  1800.             Dropdown.MouseEnter:Connect(function()
  1801.                 if not Dropdown.List.Visible then
  1802.                     TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1803.                 end
  1804.             end)
  1805.  
  1806.             Dropdown.MouseLeave:Connect(function()
  1807.                 TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1808.             end)
  1809.  
  1810.             for _, Option in ipairs(DropdownSettings.Options) do
  1811.                 local DropdownOption = Elements.Template.Dropdown.List.Template:Clone()
  1812.                 DropdownOption.Name = Option
  1813.                 DropdownOption.Title.Text = Option
  1814.                 DropdownOption.Parent = Dropdown.List
  1815.                 DropdownOption.Visible = true
  1816.  
  1817.                 if DropdownSettings.CurrentOption == Option then
  1818.                     DropdownOption.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  1819.                 end
  1820.  
  1821.                 DropdownOption.BackgroundTransparency = 1
  1822.                 DropdownOption.UIStroke.Transparency = 1
  1823.                 DropdownOption.Title.TextTransparency = 1
  1824.  
  1825.                 --local Dropdown = Tab:CreateDropdown({
  1826.                 --  Name = "Dropdown Example",
  1827.                 --  Options = {"Option 1","Option 2"},
  1828.                 --  CurrentOption = {"Option 1"},
  1829.                 --  MultipleOptions = true,
  1830.                 --  Flag = "Dropdown1",
  1831.                 --  Callback = function(TableOfOptions)
  1832.  
  1833.                 --  end,
  1834.                 --})
  1835.  
  1836.  
  1837.                 DropdownOption.Interact.ZIndex = 50
  1838.                 DropdownOption.Interact.MouseButton1Click:Connect(function()
  1839.                     if not DropdownSettings.MultipleOptions and table.find(DropdownSettings.CurrentOption, Option) then
  1840.                         return
  1841.                     end
  1842.  
  1843.                     if table.find(DropdownSettings.CurrentOption, Option) then
  1844.                         table.remove(DropdownSettings.CurrentOption, table.find(DropdownSettings.CurrentOption, Option))
  1845.                         if DropdownSettings.MultipleOptions then
  1846.  
  1847.                             if #DropdownSettings.CurrentOption == 1 then
  1848.                                 Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  1849.                             elseif #DropdownSettings.CurrentOption == 0 then
  1850.                                 Dropdown.Selected.Text = "None"
  1851.                             else
  1852.                                 Dropdown.Selected.Text = "Various"
  1853.                             end
  1854.                         else
  1855.                             Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  1856.                         end
  1857.                     else
  1858.                         if not DropdownSettings.MultipleOptions then
  1859.                             table.clear(DropdownSettings.CurrentOption)
  1860.                         end
  1861.                         table.insert(DropdownSettings.CurrentOption, Option)
  1862.                         if DropdownSettings.MultipleOptions then
  1863.                             if #DropdownSettings.CurrentOption == 1 then
  1864.                                 Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  1865.                             elseif #DropdownSettings.CurrentOption == 0 then
  1866.                                 Dropdown.Selected.Text = "None"
  1867.                             else
  1868.                                 Dropdown.Selected.Text = "Various"
  1869.                             end
  1870.                         else
  1871.                             Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  1872.                         end
  1873.                         TweenService:Create(DropdownOption.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1874.                         TweenService:Create(DropdownOption, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  1875.                         Debounce = true
  1876.                         wait(0.2)
  1877.                         TweenService:Create(DropdownOption.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1878.                     end
  1879.  
  1880.  
  1881.                     local Success, Response = pcall(function()
  1882.                         DropdownSettings.Callback(DropdownSettings.CurrentOption)
  1883.                     end)
  1884.  
  1885.                     if not Success then
  1886.                         TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1887.                         TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1888.                         Dropdown.Title.Text = "Callback Error"
  1889.                         print("Rayfield | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  1890.                         wait(0.5)
  1891.                         Dropdown.Title.Text = DropdownSettings.Name
  1892.                         TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1893.                         TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1894.                     end
  1895.  
  1896.                     for _, droption in ipairs(Dropdown.List:GetChildren()) do
  1897.                         if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" and not table.find(DropdownSettings.CurrentOption, droption.Name) then
  1898.                             TweenService:Create(droption, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(30, 30, 30)}):Play()
  1899.                         end
  1900.                     end
  1901.                     if not DropdownSettings.MultipleOptions then
  1902.                         wait(0.1)
  1903.                         TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  1904.                         for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  1905.                             if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  1906.                                 TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1907.                                 TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1908.                                 TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1909.                             end
  1910.                         end
  1911.                         TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ScrollBarImageTransparency = 1}):Play()
  1912.                         TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Rotation = 180}):Play()  
  1913.                         wait(0.35)
  1914.                         Dropdown.List.Visible = false
  1915.                     end
  1916.                     Debounce = false   
  1917.                     SaveConfiguration()
  1918.                 end)
  1919.             end
  1920.  
  1921.             for _, droption in ipairs(Dropdown.List:GetChildren()) do
  1922.                 if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" then
  1923.                     if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  1924.                         droption.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  1925.                     else
  1926.                         droption.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  1927.                     end
  1928.                 end
  1929.             end
  1930.  
  1931.             function DropdownSettings:Set(NewOption)
  1932.                 DropdownSettings.CurrentOption = NewOption
  1933.  
  1934.                 if typeof(DropdownSettings.CurrentOption) == "string" then
  1935.                     DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption}
  1936.                 end
  1937.  
  1938.                 if not DropdownSettings.MultipleOptions then
  1939.                     DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption[1]}
  1940.                 end
  1941.  
  1942.                 if DropdownSettings.MultipleOptions then
  1943.                     if #DropdownSettings.CurrentOption == 1 then
  1944.                         Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  1945.                     elseif #DropdownSettings.CurrentOption == 0 then
  1946.                         Dropdown.Selected.Text = "None"
  1947.                     else
  1948.                         Dropdown.Selected.Text = "Various"
  1949.                     end
  1950.                 else
  1951.                     Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  1952.                 end
  1953.  
  1954.  
  1955.                 local Success, Response = pcall(function()
  1956.                     DropdownSettings.Callback(NewOption)
  1957.                 end)
  1958.                 if not Success then
  1959.                     TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1960.                     TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1961.                     Dropdown.Title.Text = "Callback Error"
  1962.                     print("Rayfield | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  1963.                     wait(0.5)
  1964.                     Dropdown.Title.Text = DropdownSettings.Name
  1965.                     TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1966.                     TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1967.                 end
  1968.  
  1969.                 for _, droption in ipairs(Dropdown.List:GetChildren()) do
  1970.                     if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" then
  1971.                         if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  1972.                             droption.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  1973.                         else
  1974.                             droption.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  1975.                         end
  1976.                     end
  1977.                 end
  1978.                 --SaveConfiguration()
  1979.             end
  1980.  
  1981.             if Settings.ConfigurationSaving then
  1982.                 if Settings.ConfigurationSaving.Enabled and DropdownSettings.Flag then
  1983.                     RayfieldLibrary.Flags[DropdownSettings.Flag] = DropdownSettings
  1984.                 end
  1985.             end
  1986.  
  1987.             return DropdownSettings
  1988.         end
  1989.  
  1990.         -- Keybind
  1991.         function Tab:CreateKeybind(KeybindSettings)
  1992.             local CheckingForKey = false
  1993.             local Keybind = Elements.Template.Keybind:Clone()
  1994.             Keybind.Name = KeybindSettings.Name
  1995.             Keybind.Title.Text = KeybindSettings.Name
  1996.             Keybind.Visible = true
  1997.             Keybind.Parent = TabPage
  1998.  
  1999.             Keybind.BackgroundTransparency = 1
  2000.             Keybind.UIStroke.Transparency = 1
  2001.             Keybind.Title.TextTransparency = 1
  2002.  
  2003.             Keybind.KeybindFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2004.             Keybind.KeybindFrame.UIStroke.Color = SelectedTheme.InputStroke
  2005.  
  2006.             TweenService:Create(Keybind, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  2007.             TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2008.             TweenService:Create(Keybind.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()  
  2009.  
  2010.             Keybind.KeybindFrame.KeybindBox.Text = KeybindSettings.CurrentKeybind
  2011.             Keybind.KeybindFrame.Size = UDim2.new(0, Keybind.KeybindFrame.KeybindBox.TextBounds.X + 24, 0, 30)
  2012.  
  2013.             Keybind.KeybindFrame.KeybindBox.Focused:Connect(function()
  2014.                 CheckingForKey = true
  2015.                 Keybind.KeybindFrame.KeybindBox.Text = ""
  2016.             end)
  2017.             Keybind.KeybindFrame.KeybindBox.FocusLost:Connect(function()
  2018.                 CheckingForKey = false
  2019.                 if Keybind.KeybindFrame.KeybindBox.Text == nil or "" then
  2020.                     Keybind.KeybindFrame.KeybindBox.Text = KeybindSettings.CurrentKeybind
  2021.                     SaveConfiguration()
  2022.                 end
  2023.             end)
  2024.  
  2025.             Keybind.MouseEnter:Connect(function()
  2026.                 TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2027.             end)
  2028.  
  2029.             Keybind.MouseLeave:Connect(function()
  2030.                 TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2031.             end)
  2032.  
  2033.             UserInputService.InputBegan:Connect(function(input, processed)
  2034.  
  2035.                 if CheckingForKey then
  2036.                     if input.KeyCode ~= Enum.KeyCode.Unknown and input.KeyCode ~= Enum.KeyCode.K then
  2037.                         local SplitMessage = string.split(tostring(input.KeyCode), ".")
  2038.                         local NewKeyNoEnum = SplitMessage[3]
  2039.                         Keybind.KeybindFrame.KeybindBox.Text = tostring(NewKeyNoEnum)
  2040.                         KeybindSettings.CurrentKeybind = tostring(NewKeyNoEnum)
  2041.                         Keybind.KeybindFrame.KeybindBox:ReleaseFocus()
  2042.                         SaveConfiguration()
  2043.                     end
  2044.                 elseif KeybindSettings.CurrentKeybind ~= nil and (input.KeyCode == Enum.KeyCode[KeybindSettings.CurrentKeybind] and not processed) then -- Test
  2045.                     local Held = true
  2046.                     local Connection
  2047.                     Connection = input.Changed:Connect(function(prop)
  2048.                         if prop == "UserInputState" then
  2049.                             Connection:Disconnect()
  2050.                             Held = false
  2051.                         end
  2052.                     end)
  2053.  
  2054.                     if not KeybindSettings.HoldToInteract then
  2055.                         local Success, Response = pcall(KeybindSettings.Callback)
  2056.                         if not Success then
  2057.                             TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2058.                             TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2059.                             Keybind.Title.Text = "Callback Error"
  2060.                             print("Rayfield | "..KeybindSettings.Name.." Callback Error " ..tostring(Response))
  2061.                             wait(0.5)
  2062.                             Keybind.Title.Text = KeybindSettings.Name
  2063.                             TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2064.                             TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2065.                         end
  2066.                     else
  2067.                         wait(0.25)
  2068.                         if Held then
  2069.                             local Loop; Loop = RunService.Stepped:Connect(function()
  2070.                                 if not Held then
  2071.                                     KeybindSettings.Callback(false) -- maybe pcall this
  2072.                                     Loop:Disconnect()
  2073.                                 else
  2074.                                     KeybindSettings.Callback(true) -- maybe pcall this
  2075.                                 end
  2076.                             end)   
  2077.                         end
  2078.                     end
  2079.                 end
  2080.             end)
  2081.  
  2082.             Keybind.KeybindFrame.KeybindBox:GetPropertyChangedSignal("Text"):Connect(function()
  2083.                 TweenService:Create(Keybind.KeybindFrame, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Size = UDim2.new(0, Keybind.KeybindFrame.KeybindBox.TextBounds.X + 24, 0, 30)}):Play()
  2084.             end)
  2085.  
  2086.             function KeybindSettings:Set(NewKeybind)
  2087.                 Keybind.KeybindFrame.KeybindBox.Text = tostring(NewKeybind)
  2088.                 KeybindSettings.CurrentKeybind = tostring(NewKeybind)
  2089.                 Keybind.KeybindFrame.KeybindBox:ReleaseFocus()
  2090.                 SaveConfiguration()
  2091.             end
  2092.             if Settings.ConfigurationSaving then
  2093.                 if Settings.ConfigurationSaving.Enabled and KeybindSettings.Flag then
  2094.                     RayfieldLibrary.Flags[KeybindSettings.Flag] = KeybindSettings
  2095.                 end
  2096.             end
  2097.             return KeybindSettings
  2098.         end
  2099.  
  2100.         -- Toggle
  2101.         function Tab:CreateToggle(ToggleSettings)
  2102.             local ToggleValue = {}
  2103.  
  2104.             local Toggle = Elements.Template.Toggle:Clone()
  2105.             Toggle.Name = ToggleSettings.Name
  2106.             Toggle.Title.Text = ToggleSettings.Name
  2107.             Toggle.Visible = true
  2108.             Toggle.Parent = TabPage
  2109.  
  2110.             Toggle.BackgroundTransparency = 1
  2111.             Toggle.UIStroke.Transparency = 1
  2112.             Toggle.Title.TextTransparency = 1
  2113.             Toggle.Switch.BackgroundColor3 = SelectedTheme.ToggleBackground
  2114.  
  2115.             if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2116.                 Toggle.Switch.Shadow.Visible = false
  2117.             end
  2118.  
  2119.             TweenService:Create(Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  2120.             TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2121.             TweenService:Create(Toggle.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()   
  2122.  
  2123.             if not ToggleSettings.CurrentValue then
  2124.                 Toggle.Switch.Indicator.Position = UDim2.new(1, -40, 0.5, 0)
  2125.                 Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleDisabledStroke
  2126.                 Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleDisabled
  2127.                 Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleDisabledOuterStroke
  2128.             else
  2129.                 Toggle.Switch.Indicator.Position = UDim2.new(1, -20, 0.5, 0)
  2130.                 Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleEnabledStroke
  2131.                 Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleEnabled
  2132.                 Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleEnabledOuterStroke
  2133.             end
  2134.  
  2135.             Toggle.MouseEnter:Connect(function()
  2136.                 TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2137.             end)
  2138.  
  2139.             Toggle.MouseLeave:Connect(function()
  2140.                 TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2141.             end)
  2142.  
  2143.             Toggle.Interact.MouseButton1Click:Connect(function()
  2144.                 if ToggleSettings.CurrentValue then
  2145.                     ToggleSettings.CurrentValue = false
  2146.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2147.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2148.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -40, 0.5, 0)}):Play()
  2149.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2150.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledStroke}):Play()
  2151.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleDisabled}):Play()
  2152.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledOuterStroke}):Play()
  2153.                     wait(0.05)
  2154.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()
  2155.                     wait(0.15)
  2156.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2157.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2158.                 else
  2159.                     ToggleSettings.CurrentValue = true
  2160.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2161.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2162.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -20, 0.5, 0)}):Play()
  2163.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2164.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledStroke}):Play()
  2165.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleEnabled}):Play()
  2166.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledOuterStroke}):Play()
  2167.                     wait(0.05)
  2168.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()  
  2169.                     wait(0.15)
  2170.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2171.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()    
  2172.                 end
  2173.  
  2174.                 local Success, Response = pcall(function()
  2175.                     ToggleSettings.Callback(ToggleSettings.CurrentValue)
  2176.                 end)
  2177.                 if not Success then
  2178.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2179.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2180.                     Toggle.Title.Text = "Callback Error"
  2181.                     print("Rayfield | "..ToggleSettings.Name.." Callback Error " ..tostring(Response))
  2182.                     wait(0.5)
  2183.                     Toggle.Title.Text = ToggleSettings.Name
  2184.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2185.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2186.                 end
  2187.  
  2188.  
  2189.                 SaveConfiguration()
  2190.             end)
  2191.  
  2192.             function ToggleSettings:Set(NewToggleValue)
  2193.                 if NewToggleValue then
  2194.                     ToggleSettings.CurrentValue = true
  2195.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2196.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2197.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -20, 0.5, 0)}):Play()
  2198.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2199.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledStroke}):Play()
  2200.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleEnabled}):Play()
  2201.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = Color3.fromRGB(100,100,100)}):Play()
  2202.                     wait(0.05)
  2203.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()  
  2204.                     wait(0.15)
  2205.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2206.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2207.                 else
  2208.                     ToggleSettings.CurrentValue = false
  2209.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2210.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2211.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -40, 0.5, 0)}):Play()
  2212.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2213.                     TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledStroke}):Play()
  2214.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleDisabled}):Play()
  2215.                     TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = Color3.fromRGB(65,65,65)}):Play()
  2216.                     wait(0.05)
  2217.                     TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()
  2218.                     wait(0.15)
  2219.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2220.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2221.                 end
  2222.                 local Success, Response = pcall(function()
  2223.                     ToggleSettings.Callback(ToggleSettings.CurrentValue)
  2224.                 end)
  2225.                 if not Success then
  2226.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2227.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2228.                     Toggle.Title.Text = "Callback Error"
  2229.                     print("Rayfield | "..ToggleSettings.Name.." Callback Error " ..tostring(Response))
  2230.                     wait(0.5)
  2231.                     Toggle.Title.Text = ToggleSettings.Name
  2232.                     TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2233.                     TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2234.                 end
  2235.                 SaveConfiguration()
  2236.             end
  2237.  
  2238.             if Settings.ConfigurationSaving then
  2239.                 if Settings.ConfigurationSaving.Enabled and ToggleSettings.Flag then
  2240.                     RayfieldLibrary.Flags[ToggleSettings.Flag] = ToggleSettings
  2241.                 end
  2242.             end
  2243.  
  2244.             return ToggleSettings
  2245.         end
  2246.  
  2247.         -- Slider
  2248.         function Tab:CreateSlider(SliderSettings)
  2249.             local Dragging = false
  2250.             local Slider = Elements.Template.Slider:Clone()
  2251.             Slider.Name = SliderSettings.Name
  2252.             Slider.Title.Text = SliderSettings.Name
  2253.             Slider.Visible = true
  2254.             Slider.Parent = TabPage
  2255.  
  2256.             Slider.BackgroundTransparency = 1
  2257.             Slider.UIStroke.Transparency = 1
  2258.             Slider.Title.TextTransparency = 1
  2259.  
  2260.             if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2261.                 Slider.Main.Shadow.Visible = false
  2262.             end
  2263.  
  2264.             Slider.Main.BackgroundColor3 = SelectedTheme.SliderBackground
  2265.             Slider.Main.UIStroke.Color = SelectedTheme.SliderStroke
  2266.             Slider.Main.Progress.BackgroundColor3 = SelectedTheme.SliderProgress
  2267.  
  2268.             TweenService:Create(Slider, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  2269.             TweenService:Create(Slider.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2270.             TweenService:Create(Slider.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()   
  2271.  
  2272.             Slider.Main.Progress.Size = UDim2.fromScale(1, 1)
  2273.  
  2274.             if not SliderSettings.Suffix then
  2275.                 Slider.Main.Information.Text = tostring(SliderSettings.CurrentValue)
  2276.             else
  2277.                 Slider.Main.Information.Text = tostring(SliderSettings.CurrentValue) .. " " .. SliderSettings.Suffix
  2278.             end
  2279.  
  2280.  
  2281.             Slider.MouseEnter:Connect(function()
  2282.                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2283.             end)
  2284.  
  2285.             Slider.MouseLeave:Connect(function()
  2286.                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2287.             end)
  2288.  
  2289.             Slider.Main.Interact.InputBegan:Connect(function(Input)
  2290.                 if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  2291.                     Dragging = true
  2292.                    
  2293.                     local Connections
  2294.                     Connections = Input.Changed:Connect(function()
  2295.                         if Input.UserInputState == Enum.UserInputState.End and Dragging then
  2296.                             Dragging = false
  2297.                             Connections:Disconnect()
  2298.                         end
  2299.                     end)
  2300.                    
  2301.                 end
  2302.             end)
  2303.  
  2304.             Slider.Main.Interact.MouseButton1Down:Connect(function(X)
  2305.                 local Current = Slider.Main.Progress.AbsolutePosition.X + Slider.Main.Progress.AbsoluteSize.X
  2306.                 local Start = Current
  2307.                 local Location = X
  2308.                 local Loop; Loop = RunService.Stepped:Connect(function()
  2309.                     if Dragging then
  2310.                         Location = UserInputService:GetMouseLocation().X
  2311.                         Current = Current + 0.025 * (Location - Start)
  2312.  
  2313.                         if Location < Slider.Main.AbsolutePosition.X then
  2314.                             Location = Slider.Main.AbsolutePosition.X
  2315.                         elseif Location > Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X then
  2316.                             Location = Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X
  2317.                         end
  2318.  
  2319.                         if Current < Slider.Main.AbsolutePosition.X + 5 then
  2320.                             Current = Slider.Main.AbsolutePosition.X + 5
  2321.                         elseif Current > Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X then
  2322.                             Current = Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X
  2323.                         end
  2324.  
  2325.                         if Current <= Location and (Location - Start) < 0 then
  2326.                             Start = Location
  2327.                         elseif Current >= Location and (Location - Start) > 0 then
  2328.                             Start = Location
  2329.                         end
  2330.                         Slider.Main.Progress.Size = UDim2.new(0, Current - Slider.Main.AbsolutePosition.X, 1, 0)
  2331.                         local NewValue = SliderSettings.Range[1] + (Location - Slider.Main.AbsolutePosition.X) / Slider.Main.AbsoluteSize.X * (SliderSettings.Range[2] - SliderSettings.Range[1])
  2332.  
  2333.                         NewValue = math.floor(NewValue / SliderSettings.Increment + 0.5) * (SliderSettings.Increment * 10000000) / 10000000
  2334.                         if not SliderSettings.Suffix then
  2335.                             Slider.Main.Information.Text = tostring(NewValue)
  2336.                         else
  2337.                             Slider.Main.Information.Text = tostring(NewValue) .. " " .. SliderSettings.Suffix
  2338.                         end
  2339.  
  2340.                         if SliderSettings.CurrentValue ~= NewValue then
  2341.                             local Success, Response = pcall(function()
  2342.                                 SliderSettings.Callback(NewValue)
  2343.                             end)
  2344.                             if not Success then
  2345.                                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2346.                                 TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2347.                                 Slider.Title.Text = "Callback Error"
  2348.                                 print("Rayfield | "..SliderSettings.Name.." Callback Error " ..tostring(Response))
  2349.                                 Slider.Title.Text = SliderSettings.Name
  2350.                                 TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2351.                                 TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2352.                             end
  2353.  
  2354.                             SliderSettings.CurrentValue = NewValue
  2355.                             SaveConfiguration()
  2356.                         end
  2357.                     else
  2358.                         Slider.Main.Progress.Size = UDim2.new(0, Location - Slider.Main.AbsolutePosition.X > 5 and Location - Slider.Main.AbsolutePosition.X or 5, 1, 0)
  2359.                         Loop:Disconnect()
  2360.                     end
  2361.                 end)
  2362.             end)
  2363.            
  2364.             if Settings.ConfigurationSaving then
  2365.                 if Settings.ConfigurationSaving.Enabled and SliderSettings.Flag then
  2366.                     RayfieldLibrary.Flags[SliderSettings.Flag] = SliderSettings
  2367.                 end
  2368.             end
  2369.            
  2370.             return SliderSettings
  2371.         end
  2372.  
  2373.  
  2374.         return Tab
  2375.     end
  2376.  
  2377.     Elements.Visible = true
  2378.  
  2379.     wait(0.7)
  2380.     TweenService:Create(LoadingFrame.Title, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  2381.     TweenService:Create(LoadingFrame.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  2382.     TweenService:Create(LoadingFrame.Version, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  2383.     wait(0.2)
  2384.     TweenService:Create(Main, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 475)}):Play()
  2385.     TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.4}):Play()
  2386.  
  2387.     Topbar.BackgroundTransparency = 1
  2388.     Topbar.Divider.Size = UDim2.new(0, 0, 0, 1)
  2389.     Topbar.CornerRepair.BackgroundTransparency = 1
  2390.     Topbar.Title.TextTransparency = 1
  2391.     Topbar.Theme.ImageTransparency = 1
  2392.     Topbar.ChangeSize.ImageTransparency = 1
  2393.     Topbar.Hide.ImageTransparency = 1
  2394.  
  2395.     wait(0.5)
  2396.     Topbar.Visible = true
  2397.     TweenService:Create(Topbar, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  2398.     TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  2399.     wait(0.1)
  2400.     TweenService:Create(Topbar.Divider, TweenInfo.new(1, Enum.EasingStyle.Quint), {Size = UDim2.new(1, 0, 0, 1)}):Play()
  2401.     wait(0.1)
  2402.     TweenService:Create(Topbar.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  2403.     wait(0.1)
  2404.     TweenService:Create(Topbar.Theme, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  2405.     wait(0.1)
  2406.     TweenService:Create(Topbar.ChangeSize, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  2407.     wait(0.1)
  2408.     TweenService:Create(Topbar.Hide, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  2409.     wait(0.3)
  2410.  
  2411.     return Window
  2412. end
  2413.  
  2414.  
  2415. function RayfieldLibrary:Destroy()
  2416.     Rayfield:Destroy()
  2417. end
  2418.  
  2419. Topbar.ChangeSize.MouseButton1Click:Connect(function()
  2420.     if Debounce then return end
  2421.     if Minimised then
  2422.         Minimised = false
  2423.         Maximise()
  2424.     else
  2425.         Minimised = true
  2426.         Minimise()
  2427.     end
  2428. end)
  2429.  
  2430. Topbar.Hide.MouseButton1Click:Connect(function()
  2431.     if Debounce then return end
  2432.     if Hidden then
  2433.         Hidden = false
  2434.         Minimised = false
  2435.         Unhide()
  2436.     else
  2437.         Hidden = true
  2438.         Hide()
  2439.     end
  2440. end)
  2441.  
  2442. UserInputService.InputBegan:Connect(function(input, processed)
  2443.     if (input.KeyCode == Enum.KeyCode.K and not processed) then
  2444.         if Debounce then return end
  2445.         if Hidden then
  2446.             Hidden = false
  2447.             Unhide()
  2448.         else
  2449.             Hidden = true
  2450.             Hide()
  2451.         end
  2452.     end
  2453. end)
  2454.  
  2455. for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  2456.     if TopbarButton.ClassName == "ImageButton" then
  2457.         TopbarButton.MouseEnter:Connect(function()
  2458.             TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  2459.         end)
  2460.  
  2461.         TopbarButton.MouseLeave:Connect(function()
  2462.             TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  2463.         end)
  2464.  
  2465.         TopbarButton.MouseButton1Click:Connect(function()
  2466.             TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  2467.         end)
  2468.     end
  2469. end
  2470.  
  2471.  
  2472. function RayfieldLibrary:LoadConfiguration()
  2473.     if CEnabled then
  2474.         pcall(function()
  2475.             if isfile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension) then
  2476.                 LoadConfiguration(readfile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension))
  2477.                 RayfieldLibrary:Notify({Title = "Configuration Loaded", Content = "The configuration file for this script has been loaded from a previous session"})
  2478.             end
  2479.         end)
  2480.     end
  2481. end
  2482.  
  2483. task.delay(3.5, RayfieldLibrary.LoadConfiguration, RayfieldLibrary)
  2484.  
  2485. return RayfieldLibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement