abagde

rayfield

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