Desolath

Untitled

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