Earlyday-hackhack

Untitled

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