Advertisement
ScriptingCat

UI Lib

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