Peluchecoman

Rayf Armin

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