Daozaaaa

Untitled

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