Advertisement
jamkles

Rayfield

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