Advertisement
OMANIAOZANIA

Rayfield UI Library - Modified

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