Advertisement
199123ghh

Untitled

Jan 20th, 2025 (edited)
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 155.75 KB | None | 0 0
  1. if debugX then
  2. warn('Initialising Rayfield')
  3. end
  4.  
  5. local requestsDisabled = getgenv and getgenv().DISABLE_RAYFIELD_REQUESTS
  6. local InterfaceBuild = '3K3W'
  7. local Release = "Build 1.671 [CUSTOM]"
  8. local RayfieldFolder = "Rayfield"
  9. local ConfigurationFolder = RayfieldFolder.."/Configurations"
  10. local ConfigurationExtension = ".rfld"
  11. local settingsTable = {
  12. General = {
  13. -- if needs be in order just make getSetting(name)
  14. rayfieldOpen = {Type = 'bind', Value = 'K', Name = 'Rayfield Keybind'},
  15. -- buildwarnings
  16. -- rayfieldprompts
  17.  
  18. },
  19. System = {
  20. usageAnalytics = {Type = 'toggle', Value = true, Name = 'Anonymised Analytics'},
  21. }
  22. }
  23.  
  24. local HttpService = game:GetService("HttpService")
  25. local RunService = game:GetService("RunService")
  26.  
  27. -- Environment Check
  28. local useStudio = RunService:IsStudio() or false
  29.  
  30. local settingsCreated = false
  31. local cachedSettings
  32. local prompt = useStudio and require(script.Parent.prompt) or loadstring(game:HttpGet('https://raw.githubusercontent.com/SiriusSoftwareLtd/Sirius/refs/heads/request/prompt.lua'))()
  33. local request = (syn and syn.request) or (fluxus and fluxus.request) or (http and http.request) or http_request or request
  34.  
  35.  
  36.  
  37. local function loadSettings()
  38. local file = nil
  39.  
  40. local success, result = pcall(function()
  41. task.spawn(function()
  42. if isfolder and isfolder(RayfieldFolder) then
  43. if isfile and isfile(RayfieldFolder..'/settings'..ConfigurationExtension) then
  44. file = readfile(RayfieldFolder..'/settings'..ConfigurationExtension)
  45. end
  46. end
  47.  
  48. -- for debug in studio
  49. if useStudio then
  50. file = [[
  51. {"General":{"rayfieldOpen":{"Value":"K","Type":"bind","Name":"Rayfield Keybind","Element":{"HoldToInteract":false,"Ext":true,"Name":"Rayfield Keybind","Set":null,"CallOnChange":true,"Callback":null,"CurrentKeybind":"K"}}},"System":{"usageAnalytics":{"Value":false,"Type":"toggle","Name":"Anonymised Analytics","Element":{"Ext":true,"Name":"Anonymised Analytics","Set":null,"CurrentValue":false,"Callback":null}}}}
  52. ]]
  53. end
  54.  
  55.  
  56. if file then
  57. local success, decodedFile = pcall(function() return HttpService:JSONDecode(file) end)
  58. if success then
  59. file = decodedFile
  60. else
  61. file = {}
  62. end
  63. else
  64. file = {}
  65. end
  66.  
  67.  
  68. if not settingsCreated then
  69. cachedSettings = file
  70. return
  71. end
  72.  
  73. if file ~= {} then
  74. for categoryName, settingCategory in pairs(settingsTable) do
  75. if file[categoryName] then
  76. for settingName, setting in pairs(settingCategory) do
  77. if file[categoryName][settingName] then
  78. setting.Value = file[categoryName][settingName].Value
  79. setting.Element:Set(setting.Value)
  80. end
  81. end
  82. end
  83. end
  84. end
  85. end)
  86. end)
  87.  
  88. if not success then
  89. if writefile then
  90. warn('Rayfield had an issue accessing configuration saving capability.')
  91. end
  92. end
  93. end
  94.  
  95. if debugX then
  96. warn('Now Loading Settings Configuration')
  97. end
  98.  
  99. loadSettings()
  100.  
  101. if debugX then
  102. warn('Settings Loaded')
  103. end
  104.  
  105. --if not cachedSettings or not cachedSettings.System or not cachedSettings.System.usageAnalytics then
  106. -- local fileFunctionsAvailable = isfile and writefile and readfile
  107.  
  108. -- if not fileFunctionsAvailable and not useStudio then
  109. -- warn('Rayfield Interface Suite | Sirius Analytics:\n\n\nAs you don\'t have file functionality with your executor, we are unable to save whether you want to opt in or out to analytics.\nIf you do not want to take part in anonymised usage statistics, let us know in our Discord at sirius.menu/discord and we will manually opt you out.')
  110. -- analytics = true
  111. -- else
  112. -- prompt.create(
  113. -- 'Help us improve',
  114. -- [[Would you like to allow Sirius to collect usage statistics?
  115.  
  116. --<font transparency='0.4'>No data is linked to you or your personal activity.</font>]],
  117. -- 'Continue',
  118. -- 'Cancel',
  119. -- function(result)
  120. -- settingsTable.System.usageAnalytics.Value = result
  121. -- analytics = result
  122. -- end
  123. -- )
  124. -- end
  125.  
  126. -- repeat task.wait() until analytics ~= nil
  127. --end
  128.  
  129. if not requestsDisabled then
  130. if debugX then
  131. warn('Querying Settings for Reporter Information')
  132. end
  133. local function sendReport()
  134. if useStudio then
  135. print('Sending Analytics')
  136. else
  137. if debugX then warn('Reporting Analytics') end
  138. task.spawn(function()
  139. local success, reporter = pcall(function()
  140. return loadstring(game:HttpGet("https://analytics.sirius.menu/reporter"))()
  141. end)
  142. if success and reporter then
  143. pcall(function()
  144. reporter.report("0193dbf8-7da1-79de-b399-2c0f68b0a9ad", Release, InterfaceBuild)
  145. end)
  146. else
  147. warn("Failed to load or execute the reporter. \nPlease notify Rayfield developers at sirius.menu/discord.")
  148. end
  149. end)
  150. if debugX then warn('Finished Report') end
  151. end
  152. end
  153. if cachedSettings and (#cachedSettings == 0 or (cachedSettings.System and cachedSettings.System.usageAnalytics and cachedSettings.System.usageAnalytics.Value)) then
  154. sendReport()
  155. elseif not cachedSettings then
  156. sendReport()
  157. end
  158. end
  159.  
  160. if debugX then
  161. warn('Moving on to continue initialisation')
  162. end
  163.  
  164. local RayfieldLibrary = {
  165. Flags = {},
  166. Theme = {
  167. Ocean = {
  168. TextColor = Color3.fromRGB(230, 240, 240),
  169.  
  170. Background = Color3.fromRGB(20, 30, 30),
  171. Topbar = Color3.fromRGB(25, 40, 40),
  172. Shadow = Color3.fromRGB(15, 20, 20),
  173.  
  174. NotificationBackground = Color3.fromRGB(25, 35, 35),
  175. NotificationActionsBackground = Color3.fromRGB(230, 240, 240),
  176.  
  177. TabBackground = Color3.fromRGB(40, 60, 60),
  178. TabStroke = Color3.fromRGB(50, 70, 70),
  179. TabBackgroundSelected = Color3.fromRGB(100, 180, 180),
  180. TabTextColor = Color3.fromRGB(210, 230, 230),
  181. SelectedTabTextColor = Color3.fromRGB(20, 50, 50),
  182.  
  183. ElementBackground = Color3.fromRGB(30, 50, 50),
  184. ElementBackgroundHover = Color3.fromRGB(40, 60, 60),
  185. SecondaryElementBackground = Color3.fromRGB(30, 45, 45),
  186. ElementStroke = Color3.fromRGB(45, 70, 70),
  187. SecondaryElementStroke = Color3.fromRGB(40, 65, 65),
  188.  
  189. SliderBackground = Color3.fromRGB(0, 110, 110),
  190. SliderProgress = Color3.fromRGB(0, 140, 140),
  191. SliderStroke = Color3.fromRGB(0, 160, 160),
  192.  
  193. ToggleBackground = Color3.fromRGB(30, 50, 50),
  194. ToggleEnabled = Color3.fromRGB(0, 130, 130),
  195. ToggleDisabled = Color3.fromRGB(70, 90, 90),
  196. ToggleEnabledStroke = Color3.fromRGB(0, 160, 160),
  197. ToggleDisabledStroke = Color3.fromRGB(85, 105, 105),
  198. ToggleEnabledOuterStroke = Color3.fromRGB(50, 100, 100),
  199. ToggleDisabledOuterStroke = Color3.fromRGB(45, 65, 65),
  200.  
  201. DropdownSelected = Color3.fromRGB(30, 60, 60),
  202. DropdownUnselected = Color3.fromRGB(25, 40, 40),
  203.  
  204. InputBackground = Color3.fromRGB(30, 50, 50),
  205. InputStroke = Color3.fromRGB(50, 70, 70),
  206. PlaceholderColor = Color3.fromRGB(140, 160, 160)
  207. },
  208. }
  209. }
  210.  
  211.  
  212. -- Services
  213. local UserInputService = game:GetService("UserInputService")
  214. local TweenService = game:GetService("TweenService")
  215. local Players = game:GetService("Players")
  216. local CoreGui = game:GetService("CoreGui")
  217.  
  218. -- Interface Management
  219.  
  220. local Rayfield = useStudio and script.Parent:FindFirstChild('Rayfield') or game:GetObjects("rbxassetid://10804731440")[1]
  221. local buildAttempts = 0
  222. local correctBuild = false
  223. local warned
  224. local globalLoaded
  225.  
  226. repeat
  227. if Rayfield:FindFirstChild('Build') and Rayfield.Build.Value == InterfaceBuild then
  228. correctBuild = true
  229. break
  230. end
  231.  
  232. correctBuild = false
  233.  
  234. if not warned then
  235. warn('Rayfield | Build Mismatch')
  236. print('Rayfield may encounter issues as you are running an incompatible interface version ('.. ((Rayfield:FindFirstChild('Build') and Rayfield.Build.Value) or 'No Build') ..').\n\nThis version of Rayfield is intended for interface build '..InterfaceBuild..'.')
  237. warned = true
  238. end
  239.  
  240. toDestroy, Rayfield = Rayfield, useStudio and script.Parent:FindFirstChild('Rayfield') or game:GetObjects("rbxassetid://10804731440")[1]
  241. if toDestroy and not useStudio then toDestroy:Destroy() end
  242.  
  243. buildAttempts = buildAttempts + 1
  244. until buildAttempts >= 2
  245.  
  246. Rayfield.Enabled = false
  247.  
  248. if gethui then
  249. Rayfield.Parent = gethui()
  250. elseif syn and syn.protect_gui then
  251. syn.protect_gui(Rayfield)
  252. Rayfield.Parent = CoreGui
  253. elseif not useStudio and CoreGui:FindFirstChild("RobloxGui") then
  254. Rayfield.Parent = CoreGui:FindFirstChild("RobloxGui")
  255. elseif not useStudio then
  256. Rayfield.Parent = CoreGui
  257. end
  258.  
  259. if gethui then
  260. for _, Interface in ipairs(gethui():GetChildren()) do
  261. if Interface.Name == Rayfield.Name and Interface ~= Rayfield then
  262. Interface.Enabled = false
  263. Interface.Name = "Rayfield-Old"
  264. end
  265. end
  266. elseif not useStudio then
  267. for _, Interface in ipairs(CoreGui:GetChildren()) do
  268. if Interface.Name == Rayfield.Name and Interface ~= Rayfield then
  269. Interface.Enabled = false
  270. Interface.Name = "Rayfield-Old"
  271. end
  272. end
  273. end
  274.  
  275.  
  276. local minSize = Vector2.new(1024, 768)
  277. local useMobileSizing
  278.  
  279. if Rayfield.AbsoluteSize.X < minSize.X and Rayfield.AbsoluteSize.Y < minSize.Y then
  280. useMobileSizing = true
  281. end
  282.  
  283. if UserInputService.TouchEnabled then
  284. useMobilePrompt = true
  285. end
  286.  
  287.  
  288. -- Object Variables
  289.  
  290. local Main = Rayfield.Main
  291. local MPrompt = Rayfield:FindFirstChild('Prompt')
  292. local Topbar = Main.Topbar
  293. local Elements = Main.Elements
  294. local LoadingFrame = Main.LoadingFrame
  295. local TabList = Main.TabList
  296. local dragBar = Rayfield:FindFirstChild('Drag')
  297. local dragInteract = dragBar and dragBar.Interact or nil
  298. local dragBarCosmetic = dragBar and dragBar.Drag or nil
  299.  
  300. local dragOffset = 255
  301. local dragOffsetMobile = 150
  302.  
  303. Rayfield.DisplayOrder = 100
  304. LoadingFrame.Version.Text = Release
  305.  
  306.  
  307. local Icons = useStudio and require(script.Parent.icons) or loadstring(game:HttpGet('https://raw.githubusercontent.com/SiriusSoftwareLtd/Rayfield/refs/heads/main/icons.lua'))()
  308.  
  309. -- Variables
  310.  
  311. local CFileName = nil
  312. local CEnabled = false
  313. local Minimised = false
  314. local Hidden = false
  315. local Debounce = false
  316. local searchOpen = false
  317. local Notifications = Rayfield.Notifications
  318.  
  319. local SelectedTheme = RayfieldLibrary.Theme.Default
  320.  
  321. local function ChangeTheme(Theme)
  322. if typeof(Theme) == 'string' then
  323. SelectedTheme = RayfieldLibrary.Theme[Theme]
  324. elseif typeof(Theme) == 'table' then
  325. SelectedTheme = Theme
  326. end
  327.  
  328. Rayfield.Main.BackgroundColor3 = SelectedTheme.Background
  329. Rayfield.Main.Topbar.BackgroundColor3 = SelectedTheme.Topbar
  330. Rayfield.Main.Topbar.CornerRepair.BackgroundColor3 = SelectedTheme.Topbar
  331. Rayfield.Main.Shadow.Image.ImageColor3 = SelectedTheme.Shadow
  332.  
  333. Rayfield.Main.Topbar.ChangeSize.ImageColor3 = SelectedTheme.TextColor
  334. Rayfield.Main.Topbar.Hide.ImageColor3 = SelectedTheme.TextColor
  335. Rayfield.Main.Topbar.Search.ImageColor3 = SelectedTheme.TextColor
  336. if Topbar:FindFirstChild('Settings') then
  337. Rayfield.Main.Topbar.Settings.ImageColor3 = SelectedTheme.TextColor
  338. Rayfield.Main.Topbar.Divider.BackgroundColor3 = SelectedTheme.ElementStroke
  339. end
  340.  
  341. Main.Search.BackgroundColor3 = SelectedTheme.TextColor
  342. Main.Search.Shadow.ImageColor3 = SelectedTheme.TextColor
  343. Main.Search.Search.ImageColor3 = SelectedTheme.TextColor
  344. Main.Search.Input.PlaceholderColor3 = SelectedTheme.TextColor
  345. Main.Search.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  346.  
  347. if Main:FindFirstChild('Notice') then
  348. Main.Notice.BackgroundColor3 = SelectedTheme.Background
  349. end
  350.  
  351. for _, text in ipairs(Rayfield:GetDescendants()) do
  352. if text.Parent.Parent ~= Notifications then
  353. if text:IsA('TextLabel') or text:IsA('TextBox') then text.TextColor3 = SelectedTheme.TextColor end
  354. end
  355. end
  356.  
  357. for _, TabPage in ipairs(Elements:GetChildren()) do
  358. for _, Element in ipairs(TabPage:GetChildren()) do
  359. if Element.ClassName == "Frame" and Element.Name ~= "Placeholder" and Element.Name ~= "SectionSpacing" and Element.Name ~= "Divider" and Element.Name ~= "SectionTitle" and Element.Name ~= "SearchTitle-fsefsefesfsefesfesfThanks" then
  360. Element.BackgroundColor3 = SelectedTheme.ElementBackground
  361. Element.UIStroke.Color = SelectedTheme.ElementStroke
  362. end
  363. end
  364. end
  365. end
  366.  
  367. local function getIcon(name : string)
  368. name = string.match(string.lower(name), "^%s*(.*)%s*$") :: string
  369. local sizedicons = Icons['48px']
  370.  
  371. local r = sizedicons[name]
  372. if not r then
  373. error(`Lucide Icons: Failed to find icon by the name of "{name}"`, 2)
  374. end
  375.  
  376. local rirs = r[2]
  377. local riro = r[3]
  378.  
  379. if type(r[1]) ~= "number" or type(rirs) ~= "table" or type(riro) ~= "table" then
  380. error("Lucide Icons: Internal error: Invalid auto-generated asset entry")
  381. end
  382.  
  383. local irs = Vector2.new(rirs[1], rirs[2])
  384. local iro = Vector2.new(riro[1], riro[2])
  385.  
  386. local asset = {
  387. id = r[1],
  388. imageRectSize = irs,
  389. imageRectOffset = iro,
  390. }
  391.  
  392. return asset
  393. end
  394.  
  395. local function makeDraggable(object, dragObject, enableTaptic, tapticOffset)
  396. local dragging = false
  397. local relative = nil
  398.  
  399. local offset = Vector2.zero
  400. local screenGui = object:FindFirstAncestorWhichIsA("ScreenGui")
  401. if screenGui and screenGui.IgnoreGuiInset then
  402. offset += game:GetService('GuiService'):GetGuiInset()
  403. end
  404.  
  405. local function connectFunctions()
  406. if dragBar and enableTaptic then
  407. dragBar.MouseEnter:Connect(function()
  408. if not dragging and not Hidden then
  409. TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.5, Size = UDim2.new(0, 120, 0, 4)}):Play()
  410. end
  411. end)
  412.  
  413. dragBar.MouseLeave:Connect(function()
  414. if not dragging and not Hidden then
  415. TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.7, Size = UDim2.new(0, 100, 0, 4)}):Play()
  416. end
  417. end)
  418. end
  419. end
  420.  
  421. connectFunctions()
  422.  
  423. dragObject.InputBegan:Connect(function(input, processed)
  424. if processed then return end
  425.  
  426. local inputType = input.UserInputType.Name
  427. if inputType == "MouseButton1" or inputType == "Touch" then
  428. dragging = true
  429.  
  430. relative = object.AbsolutePosition + object.AbsoluteSize * object.AnchorPoint - UserInputService:GetMouseLocation()
  431. if enableTaptic and not Hidden then
  432. TweenService:Create(dragBarCosmetic, TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Size = UDim2.new(0, 110, 0, 4), BackgroundTransparency = 0}):Play()
  433. end
  434. end
  435. end)
  436.  
  437. local inputEnded = UserInputService.InputEnded:Connect(function(input)
  438. if not dragging then return end
  439.  
  440. local inputType = input.UserInputType.Name
  441. if inputType == "MouseButton1" or inputType == "Touch" then
  442. dragging = false
  443.  
  444. connectFunctions()
  445.  
  446. if enableTaptic and not Hidden then
  447. TweenService:Create(dragBarCosmetic, TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {Size = UDim2.new(0, 100, 0, 4), BackgroundTransparency = 0.7}):Play()
  448. end
  449. end
  450. end)
  451.  
  452. local renderStepped = RunService.RenderStepped:Connect(function()
  453. if dragging and not Hidden then
  454. local position = UserInputService:GetMouseLocation() + relative + offset
  455. if enableTaptic and tapticOffset then
  456. TweenService:Create(object, TweenInfo.new(0.4, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Position = UDim2.fromOffset(position.X, position.Y)}):Play()
  457. TweenService:Create(dragObject.Parent, TweenInfo.new(0.05, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Position = UDim2.fromOffset(position.X, position.Y + ((useMobileSizing and tapticOffset[2]) or tapticOffset[1]))}):Play()
  458. else
  459. if dragBar and tapticOffset then
  460. dragBar.Position = UDim2.fromOffset(position.X, position.Y + ((useMobileSizing and tapticOffset[2]) or tapticOffset[1]))
  461. end
  462. object.Position = UDim2.fromOffset(position.X, position.Y)
  463. end
  464. end
  465. end)
  466.  
  467. object.Destroying:Connect(function()
  468. if inputEnded then inputEnded:Disconnect() end
  469. if renderStepped then renderStepped:Disconnect() end
  470. end)
  471. end
  472.  
  473.  
  474. local function PackColor(Color)
  475. return {R = Color.R * 255, G = Color.G * 255, B = Color.B * 255}
  476. end
  477.  
  478. local function UnpackColor(Color)
  479. return Color3.fromRGB(Color.R, Color.G, Color.B)
  480. end
  481.  
  482. local function LoadConfiguration(Configuration)
  483. local success, Data = pcall(function() return HttpService:JSONDecode(Configuration) end)
  484. local changed
  485.  
  486. if not success then warn('Rayfield had an issue decoding the configuration file, please try delete the file and reopen Rayfield.') return end
  487.  
  488. -- Iterate through current UI elements' flags
  489. for FlagName, Flag in pairs(RayfieldLibrary.Flags) do
  490. local FlagValue = Data[FlagName]
  491.  
  492. if (typeof(FlagValue) == 'boolean' and FlagValue == false) or FlagValue then
  493. task.spawn(function()
  494. if Flag.Type == "ColorPicker" then
  495. changed = true
  496. Flag:Set(UnpackColor(FlagValue))
  497. else
  498. if (Flag.CurrentValue or Flag.CurrentKeybind or Flag.CurrentOption or Flag.Color) ~= FlagValue then
  499. changed = true
  500. Flag:Set(FlagValue)
  501. end
  502. end
  503. end)
  504. else
  505. warn("Rayfield | Unable to find '"..FlagName.. "' in the save file.")
  506. print("The error above may not be an issue if new elements have been added or not been set values.")
  507. --RayfieldLibrary:Notify({Title = "Rayfield Flags", Content = "Rayfield was unable to find '"..FlagName.. "' in the save file. Check sirius.menu/discord for help.", Image = 3944688398})
  508. end
  509. end
  510.  
  511. return changed
  512. end
  513.  
  514. local function SaveConfiguration()
  515. if not CEnabled or not globalLoaded then return end
  516.  
  517. if debugX then
  518. print('Saving')
  519. end
  520.  
  521. local Data = {}
  522. for i, v in pairs(RayfieldLibrary.Flags) do
  523. if v.Type == "ColorPicker" then
  524. Data[i] = PackColor(v.Color)
  525. else
  526. if typeof(v.CurrentValue) == 'boolean' then
  527. if v.CurrentValue == false then
  528. Data[i] = false
  529. else
  530. Data[i] = v.CurrentValue or v.CurrentKeybind or v.CurrentOption or v.Color
  531. end
  532. else
  533. Data[i] = v.CurrentValue or v.CurrentKeybind or v.CurrentOption or v.Color
  534. end
  535. end
  536. end
  537.  
  538. if useStudio then
  539. if script.Parent:FindFirstChild('configuration') then script.Parent.configuration:Destroy() end
  540.  
  541. local ScreenGui = Instance.new("ScreenGui")
  542. ScreenGui.Parent = script.Parent
  543. ScreenGui.Name = 'configuration'
  544.  
  545. local TextBox = Instance.new("TextBox")
  546. TextBox.Parent = ScreenGui
  547. TextBox.Size = UDim2.new(0, 800, 0, 50)
  548. TextBox.AnchorPoint = Vector2.new(0.5, 0)
  549. TextBox.Position = UDim2.new(0.5, 0, 0, 30)
  550. TextBox.Text = HttpService:JSONEncode(Data)
  551. TextBox.ClearTextOnFocus = false
  552. end
  553.  
  554. if debugX then
  555. warn(HttpService:JSONEncode(Data))
  556. end
  557.  
  558. if writefile then
  559. writefile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension, tostring(HttpService:JSONEncode(Data)))
  560. end
  561. end
  562.  
  563. function RayfieldLibrary:Notify(data) -- action e.g open messages
  564. task.spawn(function()
  565.  
  566. -- Notification Object Creation
  567. local newNotification = Notifications.Template:Clone()
  568. newNotification.Name = data.Title or 'No Title Provided'
  569. newNotification.Parent = Notifications
  570. newNotification.LayoutOrder = #Notifications:GetChildren()
  571. newNotification.Visible = false
  572.  
  573. -- Set Data
  574. newNotification.Title.Text = data.Title or "Unknown Title"
  575. newNotification.Description.Text = data.Content or "Unknown Content"
  576.  
  577. if data.Image then
  578. if typeof(data.Image) == 'string' then
  579. local asset = getIcon(data.Image)
  580.  
  581. newNotification.Icon.Image = 'rbxassetid://'..asset.id
  582. newNotification.Icon.ImageRectOffset = asset.imageRectOffset
  583. newNotification.Icon.ImageRectSize = asset.imageRectSize
  584. else
  585. newNotification.Icon.Image = "rbxassetid://" .. (data.Image or 0)
  586. end
  587. else
  588. newNotification.Icon.Image = "rbxassetid://" .. 0
  589. end
  590.  
  591. -- Set initial transparency values
  592.  
  593. newNotification.Title.TextColor3 = SelectedTheme.TextColor
  594. newNotification.Description.TextColor3 = SelectedTheme.TextColor
  595. newNotification.BackgroundColor3 = SelectedTheme.Background
  596. newNotification.UIStroke.Color = SelectedTheme.TextColor
  597. newNotification.Icon.ImageColor3 = SelectedTheme.TextColor
  598.  
  599. newNotification.BackgroundTransparency = 1
  600. newNotification.Title.TextTransparency = 1
  601. newNotification.Description.TextTransparency = 1
  602. newNotification.UIStroke.Transparency = 1
  603. newNotification.Shadow.ImageTransparency = 1
  604. newNotification.Size = UDim2.new(1, 0, 0, 800)
  605. newNotification.Icon.ImageTransparency = 1
  606. newNotification.Icon.BackgroundTransparency = 1
  607.  
  608. task.wait()
  609.  
  610. newNotification.Visible = true
  611.  
  612. if data.Actions then
  613. warn('Rayfield | Not seeing your actions in notifications?')
  614. print("Notification Actions are being sunset for now, keep up to date on when they're back in the discord. (sirius.menu/discord)")
  615. end
  616.  
  617. -- Calculate textbounds and set initial values
  618. local bounds = {newNotification.Title.TextBounds.Y, newNotification.Description.TextBounds.Y}
  619. newNotification.Size = UDim2.new(1, -60, 0, -Notifications:FindFirstChild("UIListLayout").Padding.Offset)
  620.  
  621. newNotification.Icon.Size = UDim2.new(0, 32, 0, 32)
  622. newNotification.Icon.Position = UDim2.new(0, 20, 0.5, 0)
  623.  
  624. TweenService:Create(newNotification, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, 0, 0, math.max(bounds[1] + bounds[2] + 31, 60))}):Play()
  625.  
  626. task.wait(0.15)
  627. TweenService:Create(newNotification, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.45}):Play()
  628. TweenService:Create(newNotification.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  629.  
  630. task.wait(0.05)
  631.  
  632. TweenService:Create(newNotification.Icon, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  633.  
  634. task.wait(0.05)
  635. TweenService:Create(newNotification.Description, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.35}):Play()
  636. TweenService:Create(newNotification.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 0.95}):Play()
  637. TweenService:Create(newNotification.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.82}):Play()
  638.  
  639. local waitDuration = math.min(math.max((#newNotification.Description.Text * 0.1) + 2.5, 3), 10)
  640. task.wait(data.Duration or waitDuration)
  641.  
  642. newNotification.Icon.Visible = false
  643. TweenService:Create(newNotification, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  644. TweenService:Create(newNotification.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  645. TweenService:Create(newNotification.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  646. TweenService:Create(newNotification.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  647. TweenService:Create(newNotification.Description, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  648.  
  649. TweenService:Create(newNotification, TweenInfo.new(1, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -90, 0, 0)}):Play()
  650.  
  651. task.wait(1)
  652.  
  653. TweenService:Create(newNotification, TweenInfo.new(1, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -90, 0, -Notifications:FindFirstChild("UIListLayout").Padding.Offset)}):Play()
  654.  
  655. newNotification.Visible = false
  656. newNotification:Destroy()
  657. end)
  658. end
  659.  
  660. local function openSearch()
  661. searchOpen = true
  662.  
  663. Main.Search.BackgroundTransparency = 1
  664. Main.Search.Shadow.ImageTransparency = 1
  665. Main.Search.Input.TextTransparency = 1
  666. Main.Search.Search.ImageTransparency = 1
  667. Main.Search.UIStroke.Transparency = 1
  668. Main.Search.Size = UDim2.new(1, 0, 0, 80)
  669. Main.Search.Position = UDim2.new(0.5, 0, 0, 70)
  670.  
  671. Main.Search.Input.Interactable = true
  672.  
  673. Main.Search.Visible = true
  674.  
  675. for _, tabbtn in ipairs(TabList:GetChildren()) do
  676. if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  677. tabbtn.Interact.Visible = false
  678. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  679. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  680. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  681. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  682. end
  683. end
  684.  
  685. Main.Search.Input:CaptureFocus()
  686. TweenService:Create(Main.Search.Shadow, TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0.95}):Play()
  687. TweenService:Create(Main.Search, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.5, 0, 0, 57), BackgroundTransparency = 0.9}):Play()
  688. TweenService:Create(Main.Search.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.8}):Play()
  689. TweenService:Create(Main.Search.Input, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  690. TweenService:Create(Main.Search.Search, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.5}):Play()
  691. TweenService:Create(Main.Search, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -35, 0, 35)}):Play()
  692. end
  693.  
  694. local function closeSearch()
  695. searchOpen = false
  696.  
  697. TweenService:Create(Main.Search, TweenInfo.new(0.35, Enum.EasingStyle.Quint), {BackgroundTransparency = 1, Size = UDim2.new(1, -55, 0, 30)}):Play()
  698. TweenService:Create(Main.Search.Search, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  699. TweenService:Create(Main.Search.Shadow, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  700. TweenService:Create(Main.Search.UIStroke, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  701. TweenService:Create(Main.Search.Input, TweenInfo.new(0.15, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  702.  
  703. for _, tabbtn in ipairs(TabList:GetChildren()) do
  704. if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  705. tabbtn.Interact.Visible = true
  706. if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  707. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  708. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  709. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  710. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  711. else
  712. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  713. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  714. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  715. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  716. end
  717. end
  718. end
  719.  
  720. Main.Search.Input.Text = ''
  721. Main.Search.Input.Interactable = false
  722. end
  723.  
  724. local function Hide(notify: boolean?)
  725. if MPrompt then
  726. MPrompt.Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  727. MPrompt.Position = UDim2.new(0.5, 0, 0, -50)
  728. MPrompt.Size = UDim2.new(0, 40, 0, 10)
  729. MPrompt.BackgroundTransparency = 1
  730. MPrompt.Title.TextTransparency = 1
  731. MPrompt.Visible = true
  732. end
  733.  
  734. task.spawn(closeSearch)
  735.  
  736. Debounce = true
  737. if notify then
  738. if useMobilePrompt then
  739. RayfieldLibrary:Notify({Title = "Interface Hidden", Content = "The interface has been hidden, you can unhide the interface by tapping 'Show Rayfield'.", Duration = 7, Image = 4400697855})
  740. else
  741. RayfieldLibrary:Notify({Title = "Interface Hidden", Content = `The interface has been hidden, you can unhide the interface by tapping {settingsTable.General.rayfieldOpen.Value or 'K'}.`, Duration = 7, Image = 4400697855})
  742. end
  743. end
  744.  
  745. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 470, 0, 0)}):Play()
  746. TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 470, 0, 45)}):Play()
  747. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  748. TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  749. TweenService:Create(Main.Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  750. TweenService:Create(Main.Topbar.CornerRepair, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  751. TweenService:Create(Main.Topbar.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  752. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  753. TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  754. TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  755.  
  756. if useMobilePrompt and MPrompt then
  757. TweenService:Create(MPrompt, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 120, 0, 30), Position = UDim2.new(0.5, 0, 0, 20), BackgroundTransparency = 0.3}):Play()
  758. TweenService:Create(MPrompt.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0.3}):Play()
  759. end
  760.  
  761. for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  762. if TopbarButton.ClassName == "ImageButton" then
  763. TweenService:Create(TopbarButton, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  764. end
  765. end
  766.  
  767. for _, tabbtn in ipairs(TabList:GetChildren()) do
  768. if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  769. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  770. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  771. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  772. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  773. end
  774. end
  775.  
  776. dragInteract.Visible = false
  777.  
  778. for _, tab in ipairs(Elements:GetChildren()) do
  779. if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  780. for _, element in ipairs(tab:GetChildren()) do
  781. if element.ClassName == "Frame" then
  782. if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  783. if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  784. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  785. elseif element.Name == 'Divider' then
  786. TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  787. else
  788. TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  789. TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  790. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  791. end
  792. for _, child in ipairs(element:GetChildren()) do
  793. if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  794. child.Visible = false
  795. end
  796. end
  797. end
  798. end
  799. end
  800. end
  801. end
  802.  
  803. task.wait(0.5)
  804. Main.Visible = false
  805. Debounce = false
  806. end
  807.  
  808. local function Maximise()
  809. Debounce = true
  810. Topbar.ChangeSize.Image = "rbxassetid://"..10137941941
  811.  
  812. TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  813. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  814. TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  815. TweenService:Create(Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  816. TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.7}):Play()
  817. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = useMobileSizing and UDim2.new(0, 500, 0, 275) or UDim2.new(0, 500, 0, 475)}):Play()
  818. TweenService:Create(Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 45)}):Play()
  819. TabList.Visible = true
  820. task.wait(0.2)
  821.  
  822. Elements.Visible = true
  823.  
  824. for _, tab in ipairs(Elements:GetChildren()) do
  825. if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  826. for _, element in ipairs(tab:GetChildren()) do
  827. if element.ClassName == "Frame" then
  828. if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  829. if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  830. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.4}):Play()
  831. elseif element.Name == 'Divider' then
  832. TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.85}):Play()
  833. else
  834. TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  835. TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  836. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  837. end
  838. for _, child in ipairs(element:GetChildren()) do
  839. if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  840. child.Visible = true
  841. end
  842. end
  843. end
  844. end
  845. end
  846. end
  847. end
  848.  
  849. task.wait(0.1)
  850.  
  851. for _, tabbtn in ipairs(TabList:GetChildren()) do
  852. if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  853. if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  854. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  855. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  856. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  857. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  858. else
  859. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  860. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  861. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  862. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  863. end
  864.  
  865. end
  866. end
  867.  
  868. task.wait(0.5)
  869. Debounce = false
  870. end
  871.  
  872.  
  873. local function Unhide()
  874. Debounce = true
  875. Main.Position = UDim2.new(0.5, 0, 0.5, 0)
  876. Main.Visible = true
  877. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = useMobileSizing and UDim2.new(0, 500, 0, 275) or UDim2.new(0, 500, 0, 475)}):Play()
  878. TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 45)}):Play()
  879. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  880. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  881. TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  882. TweenService:Create(Main.Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  883. TweenService:Create(Main.Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  884. TweenService:Create(Main.Topbar.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  885.  
  886. if MPrompt then
  887. TweenService:Create(MPrompt, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 40, 0, 10), Position = UDim2.new(0.5, 0, 0, -50), BackgroundTransparency = 1}):Play()
  888. TweenService:Create(MPrompt.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  889.  
  890. task.spawn(function()
  891. task.wait(0.5)
  892. MPrompt.Visible = false
  893. end)
  894. end
  895.  
  896. if Minimised then
  897. task.spawn(Maximise)
  898. end
  899.  
  900. dragBar.Position = useMobileSizing and UDim2.new(0.5, 0, 0.5, dragOffsetMobile) or UDim2.new(0.5, 0, 0.5, dragOffset)
  901.  
  902. dragInteract.Visible = true
  903.  
  904. for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  905. if TopbarButton.ClassName == "ImageButton" then
  906. if TopbarButton.Name == 'Icon' then
  907. TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  908. else
  909. TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  910. end
  911.  
  912. end
  913. end
  914.  
  915. for _, tabbtn in ipairs(TabList:GetChildren()) do
  916. if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  917. if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  918. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  919. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  920. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  921. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  922. else
  923. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  924. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  925. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  926. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  927. end
  928. end
  929. end
  930.  
  931. for _, tab in ipairs(Elements:GetChildren()) do
  932. if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  933. for _, element in ipairs(tab:GetChildren()) do
  934. if element.ClassName == "Frame" then
  935. if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  936. if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  937. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0.4}):Play()
  938. elseif element.Name == 'Divider' then
  939. TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.85}):Play()
  940. else
  941. TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  942. TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  943. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  944. end
  945. for _, child in ipairs(element:GetChildren()) do
  946. if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  947. child.Visible = true
  948. end
  949. end
  950. end
  951. end
  952. end
  953. end
  954. end
  955.  
  956. TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 0.5}):Play()
  957.  
  958. task.wait(0.5)
  959. Minimised = false
  960. Debounce = false
  961. end
  962.  
  963. local function Minimise()
  964. Debounce = true
  965. Topbar.ChangeSize.Image = "rbxassetid://"..11036884234
  966.  
  967. Topbar.UIStroke.Color = SelectedTheme.ElementStroke
  968.  
  969. task.spawn(closeSearch)
  970.  
  971. for _, tabbtn in ipairs(TabList:GetChildren()) do
  972. if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  973. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  974. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  975. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  976. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  977. end
  978. end
  979.  
  980. for _, tab in ipairs(Elements:GetChildren()) do
  981. if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  982. for _, element in ipairs(tab:GetChildren()) do
  983. if element.ClassName == "Frame" then
  984. if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  985. if element.Name == "SectionTitle" or element.Name == 'SearchTitle-fsefsefesfsefesfesfThanks' then
  986. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  987. elseif element.Name == 'Divider' then
  988. TweenService:Create(element.Divider, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  989. else
  990. TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  991. TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  992. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  993. end
  994. for _, child in ipairs(element:GetChildren()) do
  995. if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  996. child.Visible = false
  997. end
  998. end
  999. end
  1000. end
  1001. end
  1002. end
  1003. end
  1004.  
  1005. TweenService:Create(dragBarCosmetic, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), {BackgroundTransparency = 1}):Play()
  1006. TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1007. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1008. TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1009. TweenService:Create(Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1010. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 495, 0, 45)}):Play()
  1011. TweenService:Create(Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 495, 0, 45)}):Play()
  1012.  
  1013. task.wait(0.3)
  1014.  
  1015. Elements.Visible = false
  1016. TabList.Visible = false
  1017.  
  1018. task.wait(0.2)
  1019. Debounce = false
  1020. end
  1021.  
  1022. local function updateSettings()
  1023. local encoded
  1024. local success, err = pcall(function()
  1025. encoded = HttpService:JSONEncode(settingsTable)
  1026. end)
  1027.  
  1028. if success then
  1029. if useStudio then
  1030. if script.Parent['get.val'] then
  1031. script.Parent['get.val'].Value = encoded
  1032. end
  1033. end
  1034. if writefile then
  1035. writefile(RayfieldFolder..'/settings'..ConfigurationExtension, encoded)
  1036. end
  1037. end
  1038. end
  1039.  
  1040. local function createSettings(window)
  1041. if not (writefile and isfile and readfile and isfolder and makefolder) and not useStudio then
  1042. if Topbar['Settings'] then Topbar.Settings.Visible = false end
  1043. Topbar['Search'].Position = UDim2.new(1, -75, 0.5, 0)
  1044. warn('Can\'t create settings as no file-saving functionality is available.')
  1045. return
  1046. end
  1047.  
  1048. local newTab = window:CreateTab('Rayfield Settings', 0, true)
  1049.  
  1050. if TabList['Rayfield Settings'] then
  1051. TabList['Rayfield Settings'].LayoutOrder = 1000
  1052. end
  1053.  
  1054. if Elements['Rayfield Settings'] then
  1055. Elements['Rayfield Settings'].LayoutOrder = 1000
  1056. end
  1057.  
  1058. -- Create sections and elements
  1059. for categoryName, settingCategory in pairs(settingsTable) do
  1060. newTab:CreateSection(categoryName)
  1061.  
  1062. for _, setting in pairs(settingCategory) do
  1063. if setting.Type == 'input' then
  1064. setting.Element = newTab:CreateInput({
  1065. Name = setting.Name,
  1066. CurrentValue = setting.Value,
  1067. PlaceholderText = setting.Placeholder,
  1068. Ext = true,
  1069. RemoveTextAfterFocusLost = setting.ClearOnFocus,
  1070. Callback = function(Value)
  1071. setting.Value = Value
  1072. updateSettings()
  1073. end,
  1074. })
  1075. elseif setting.Type == 'toggle' then
  1076. setting.Element = newTab:CreateToggle({
  1077. Name = setting.Name,
  1078. CurrentValue = setting.Value,
  1079. Ext = true,
  1080. Callback = function(Value)
  1081. setting.Value = Value
  1082. updateSettings()
  1083. end,
  1084. })
  1085. elseif setting.Type == 'bind' then
  1086. setting.Element = newTab:CreateKeybind({
  1087. Name = setting.Name,
  1088. CurrentKeybind = setting.Value,
  1089. HoldToInteract = false,
  1090. Ext = true,
  1091. CallOnChange = true,
  1092. Callback = function(Value)
  1093. setting.Value = Value
  1094. updateSettings()
  1095. end,
  1096. })
  1097. end
  1098. end
  1099. end
  1100.  
  1101. settingsCreated = true
  1102. loadSettings()
  1103. updateSettings()
  1104. end
  1105.  
  1106.  
  1107.  
  1108. function RayfieldLibrary:CreateWindow(Settings)
  1109. if Rayfield:FindFirstChild('Loading') then
  1110. if getgenv and not getgenv().rayfieldCached then
  1111. Rayfield.Enabled = true
  1112. Rayfield.Loading.Visible = true
  1113.  
  1114. task.wait(1.4)
  1115. Rayfield.Loading.Visible = false
  1116. end
  1117. end
  1118.  
  1119. if getgenv then getgenv().rayfieldCached = true end
  1120.  
  1121. if not correctBuild and not Settings.DisableBuildWarnings then
  1122. task.delay(3,
  1123. function()
  1124. RayfieldLibrary:Notify({Title = 'Build Mismatch', Content = 'Rayfield may encounter issues as you are running an incompatible interface version ('.. ((Rayfield:FindFirstChild('Build') and Rayfield.Build.Value) or 'No Build') ..').\n\nThis version of Rayfield is intended for interface build '..InterfaceBuild..'.\n\nTry rejoining and then run the script twice.', Image = 4335487866, Duration = 15})
  1125. end)
  1126. end
  1127.  
  1128. if isfolder and not isfolder(RayfieldFolder) then
  1129. makefolder(RayfieldFolder)
  1130. end
  1131.  
  1132. local Passthrough = false
  1133. Topbar.Title.Text = Settings.Name
  1134.  
  1135. Main.Size = UDim2.new(0, 420, 0, 100)
  1136. Main.Visible = true
  1137. Main.BackgroundTransparency = 1
  1138. if Main:FindFirstChild('Notice') then Main.Notice.Visible = false end
  1139. Main.Shadow.Image.ImageTransparency = 1
  1140.  
  1141. LoadingFrame.Title.TextTransparency = 1
  1142. LoadingFrame.Subtitle.TextTransparency = 1
  1143.  
  1144. LoadingFrame.Version.TextTransparency = 1
  1145. LoadingFrame.Title.Text = Settings.LoadingTitle or "Rayfield"
  1146. LoadingFrame.Subtitle.Text = Settings.LoadingSubtitle or "Interface Suite"
  1147.  
  1148. if Settings.LoadingTitle ~= "Rayfield Interface Suite" then
  1149. LoadingFrame.Version.Text = "Rayfield UI"
  1150. end
  1151.  
  1152. if Settings.Icon and Settings.Icon ~= 0 and Topbar:FindFirstChild('Icon') then
  1153. Topbar.Icon.Visible = true
  1154. Topbar.Title.Position = UDim2.new(0, 47, 0.5, 0)
  1155.  
  1156. if Settings.Icon then
  1157. if typeof(Settings.Icon) == 'string' then
  1158. local asset = getIcon(Settings.Icon)
  1159.  
  1160. Topbar.Icon.Image = 'rbxassetid://'..asset.id
  1161. Topbar.Icon.ImageRectOffset = asset.imageRectOffset
  1162. Topbar.Icon.ImageRectSize = asset.imageRectSize
  1163. else
  1164. Topbar.Icon.Image = "rbxassetid://" .. (Settings.Icon or 0)
  1165. end
  1166. else
  1167. Topbar.Icon.Image = "rbxassetid://" .. 0
  1168. end
  1169. end
  1170.  
  1171. if dragBar then
  1172. dragBar.Visible = false
  1173. dragBarCosmetic.BackgroundTransparency = 1
  1174. dragBar.Visible = true
  1175. end
  1176.  
  1177. if Settings.Theme then
  1178. local success, result = pcall(ChangeTheme, Settings.Theme)
  1179. if not success then
  1180. local success, result2 = pcall(ChangeTheme, 'Default')
  1181. if not success then
  1182. warn('CRITICAL ERROR - NO DEFAULT THEME')
  1183. print(result2)
  1184. end
  1185. warn('issue rendering theme. no theme on file')
  1186. print(result)
  1187. end
  1188. end
  1189.  
  1190. Topbar.Visible = false
  1191. Elements.Visible = false
  1192. LoadingFrame.Visible = true
  1193.  
  1194. if not Settings.DisableRayfieldPrompts then
  1195. task.spawn(function()
  1196. while true do
  1197. task.wait(math.random(180, 600))
  1198. RayfieldLibrary:Notify({
  1199. Title = "Rayfield Interface",
  1200. Content = "Enjoying this UI library? Find it at sirius.menu/discord",
  1201. Duration = 7,
  1202. Image = 4370033185,
  1203. })
  1204. end
  1205. end)
  1206. end
  1207.  
  1208. pcall(function()
  1209. if not Settings.ConfigurationSaving.FileName then
  1210. Settings.ConfigurationSaving.FileName = tostring(game.PlaceId)
  1211. end
  1212.  
  1213. if Settings.ConfigurationSaving.Enabled == nil then
  1214. Settings.ConfigurationSaving.Enabled = false
  1215. end
  1216.  
  1217. CFileName = Settings.ConfigurationSaving.FileName
  1218. ConfigurationFolder = Settings.ConfigurationSaving.FolderName or ConfigurationFolder
  1219. CEnabled = Settings.ConfigurationSaving.Enabled
  1220.  
  1221. if Settings.ConfigurationSaving.Enabled then
  1222. if not isfolder(ConfigurationFolder) then
  1223. makefolder(ConfigurationFolder)
  1224. end
  1225. end
  1226. end)
  1227.  
  1228.  
  1229. makeDraggable(Main, Topbar, false, {dragOffset, dragOffsetMobile})
  1230. if dragBar then dragBar.Position = useMobileSizing and UDim2.new(0.5, 0, 0.5, dragOffsetMobile) or UDim2.new(0.5, 0, 0.5, dragOffset) makeDraggable(Main, dragInteract, true, {dragOffset, dragOffsetMobile}) end
  1231.  
  1232. for _, TabButton in ipairs(TabList:GetChildren()) do
  1233. if TabButton.ClassName == "Frame" and TabButton.Name ~= "Placeholder" then
  1234. TabButton.BackgroundTransparency = 1
  1235. TabButton.Title.TextTransparency = 1
  1236. TabButton.Image.ImageTransparency = 1
  1237. TabButton.UIStroke.Transparency = 1
  1238. end
  1239. end
  1240.  
  1241. if Settings.Discord and not useStudio then
  1242. if isfolder and not isfolder(RayfieldFolder.."/Discord Invites") then
  1243. makefolder(RayfieldFolder.."/Discord Invites")
  1244. end
  1245.  
  1246. if isfile and not isfile(RayfieldFolder.."/Discord Invites".."/"..Settings.Discord.Invite..ConfigurationExtension) then
  1247. if request then
  1248. pcall(function()
  1249. request({
  1250. Url = 'http://127.0.0.1:6463/rpc?v=1',
  1251. Method = 'POST',
  1252. Headers = {
  1253. ['Content-Type'] = 'application/json',
  1254. Origin = 'https://discord.com'
  1255. },
  1256. Body = HttpService:JSONEncode({
  1257. cmd = 'INVITE_BROWSER',
  1258. nonce = HttpService:GenerateGUID(false),
  1259. args = {code = Settings.Discord.Invite}
  1260. })
  1261. })
  1262. end)
  1263. end
  1264.  
  1265. 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
  1266. writefile(RayfieldFolder.."/Discord Invites".."/"..Settings.Discord.Invite..ConfigurationExtension,"Rayfield RememberJoins is true for this invite, this invite will not ask you to join again")
  1267. end
  1268. end
  1269. end
  1270.  
  1271. if (Settings.KeySystem) then
  1272. if not Settings.KeySettings then
  1273. Passthrough = true
  1274. return
  1275. end
  1276.  
  1277. if isfolder and not isfolder(RayfieldFolder.."/Key System") then
  1278. makefolder(RayfieldFolder.."/Key System")
  1279. end
  1280.  
  1281. if typeof(Settings.KeySettings.Key) == "string" then Settings.KeySettings.Key = {Settings.KeySettings.Key} end
  1282.  
  1283. if Settings.KeySettings.GrabKeyFromSite then
  1284. for i, Key in ipairs(Settings.KeySettings.Key) do
  1285. local Success, Response = pcall(function()
  1286. Settings.KeySettings.Key[i] = tostring(game:HttpGet(Key):gsub("[\n\r]", " "))
  1287. Settings.KeySettings.Key[i] = string.gsub(Settings.KeySettings.Key[i], " ", "")
  1288. end)
  1289. if not Success then
  1290. print("Rayfield | "..Key.." Error " ..tostring(Response))
  1291. warn('Check docs.sirius.menu for help with Rayfield specific development.')
  1292. end
  1293. end
  1294. end
  1295.  
  1296. if not Settings.KeySettings.FileName then
  1297. Settings.KeySettings.FileName = "No file name specified"
  1298. end
  1299.  
  1300. if isfile and isfile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension) then
  1301. for _, MKey in ipairs(Settings.KeySettings.Key) do
  1302. if string.find(readfile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension), MKey) then
  1303. Passthrough = true
  1304. end
  1305. end
  1306. end
  1307.  
  1308. if not Passthrough then
  1309. local AttemptsRemaining = math.random(2, 5)
  1310. Rayfield.Enabled = false
  1311. local KeyUI = useStudio and script.Parent:FindFirstChild('Key') or game:GetObjects("rbxassetid://11380036235")[1]
  1312.  
  1313. KeyUI.Enabled = true
  1314.  
  1315. if gethui then
  1316. KeyUI.Parent = gethui()
  1317. elseif syn and syn.protect_gui then
  1318. syn.protect_gui(KeyUI)
  1319. KeyUI.Parent = CoreGui
  1320. elseif not useStudio and CoreGui:FindFirstChild("RobloxGui") then
  1321. KeyUI.Parent = CoreGui:FindFirstChild("RobloxGui")
  1322. elseif not useStudio then
  1323. KeyUI.Parent = CoreGui
  1324. end
  1325.  
  1326. if gethui then
  1327. for _, Interface in ipairs(gethui():GetChildren()) do
  1328. if Interface.Name == KeyUI.Name and Interface ~= KeyUI then
  1329. Interface.Enabled = false
  1330. Interface.Name = "KeyUI-Old"
  1331. end
  1332. end
  1333. elseif not useStudio then
  1334. for _, Interface in ipairs(CoreGui:GetChildren()) do
  1335. if Interface.Name == KeyUI.Name and Interface ~= KeyUI then
  1336. Interface.Enabled = false
  1337. Interface.Name = "KeyUI-Old"
  1338. end
  1339. end
  1340. end
  1341.  
  1342. local KeyMain = KeyUI.Main
  1343. KeyMain.Title.Text = Settings.KeySettings.Title or Settings.Name
  1344. KeyMain.Subtitle.Text = Settings.KeySettings.Subtitle or "Key System"
  1345. KeyMain.NoteMessage.Text = Settings.KeySettings.Note or "No instructions"
  1346.  
  1347. KeyMain.Size = UDim2.new(0, 467, 0, 175)
  1348. KeyMain.BackgroundTransparency = 1
  1349. KeyMain.Shadow.Image.ImageTransparency = 1
  1350. KeyMain.Title.TextTransparency = 1
  1351. KeyMain.Subtitle.TextTransparency = 1
  1352. KeyMain.KeyNote.TextTransparency = 1
  1353. KeyMain.Input.BackgroundTransparency = 1
  1354. KeyMain.Input.UIStroke.Transparency = 1
  1355. KeyMain.Input.InputBox.TextTransparency = 1
  1356. KeyMain.NoteTitle.TextTransparency = 1
  1357. KeyMain.NoteMessage.TextTransparency = 1
  1358. KeyMain.Hide.ImageTransparency = 1
  1359.  
  1360. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1361. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 187)}):Play()
  1362. TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 0.5}):Play()
  1363. task.wait(0.05)
  1364. TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1365. TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1366. task.wait(0.05)
  1367. TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1368. TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1369. TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1370. TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1371. task.wait(0.05)
  1372. TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1373. TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1374. task.wait(0.15)
  1375. TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 0.3}):Play()
  1376.  
  1377.  
  1378. KeyUI.Main.Input.InputBox.FocusLost:Connect(function()
  1379. if #KeyUI.Main.Input.InputBox.Text == 0 then return end
  1380. local KeyFound = false
  1381. local FoundKey = ''
  1382. for _, MKey in ipairs(Settings.KeySettings.Key) do
  1383. --if string.find(KeyMain.Input.InputBox.Text, MKey) then
  1384. -- KeyFound = true
  1385. -- FoundKey = MKey
  1386. --end
  1387.  
  1388.  
  1389. -- stricter key check
  1390. if KeyMain.Input.InputBox.Text == MKey then
  1391. KeyFound = true
  1392. FoundKey = MKey
  1393. end
  1394. end
  1395. if KeyFound then
  1396. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1397. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1398. TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1399. TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1400. TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1401. TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1402. TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1403. TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1404. TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1405. TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1406. TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1407. TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1408. task.wait(0.51)
  1409. Passthrough = true
  1410. KeyMain.Visible = false
  1411. if Settings.KeySettings.SaveKey then
  1412. if writefile then
  1413. writefile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension, FoundKey)
  1414. end
  1415. RayfieldLibrary:Notify({Title = "Key System", Content = "The key for this script has been saved successfully.", Image = 3605522284})
  1416. end
  1417. else
  1418. if AttemptsRemaining == 0 then
  1419. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1420. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1421. TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1422. TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1423. TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1424. TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1425. TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1426. TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1427. TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1428. TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1429. TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1430. TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1431. task.wait(0.45)
  1432. Players.LocalPlayer:Kick("No Attempts Remaining")
  1433. game:Shutdown()
  1434. end
  1435. KeyMain.Input.InputBox.Text = ""
  1436. AttemptsRemaining = AttemptsRemaining - 1
  1437. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1438. TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Elastic), {Position = UDim2.new(0.495,0,0.5,0)}):Play()
  1439. task.wait(0.1)
  1440. TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Elastic), {Position = UDim2.new(0.505,0,0.5,0)}):Play()
  1441. task.wait(0.1)
  1442. TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.5,0,0.5,0)}):Play()
  1443. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 500, 0, 187)}):Play()
  1444. end
  1445. end)
  1446.  
  1447. KeyMain.Hide.MouseButton1Click:Connect(function()
  1448. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1449. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1450. TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1451. TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1452. TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1453. TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1454. TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1455. TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1456. TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1457. TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1458. TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1459. TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1460. task.wait(0.51)
  1461. RayfieldLibrary:Destroy()
  1462. KeyUI:Destroy()
  1463. end)
  1464. else
  1465. Passthrough = true
  1466. end
  1467. end
  1468. if Settings.KeySystem then
  1469. repeat task.wait() until Passthrough
  1470. end
  1471.  
  1472. Notifications.Template.Visible = false
  1473. Notifications.Visible = true
  1474. Rayfield.Enabled = true
  1475.  
  1476. task.wait(0.5)
  1477. TweenService:Create(Main, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1478. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  1479. task.wait(0.1)
  1480. TweenService:Create(LoadingFrame.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1481. task.wait(0.05)
  1482. TweenService:Create(LoadingFrame.Subtitle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1483. task.wait(0.05)
  1484. TweenService:Create(LoadingFrame.Version, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1485.  
  1486.  
  1487. Elements.Template.LayoutOrder = 100000
  1488. Elements.Template.Visible = false
  1489.  
  1490. Elements.UIPageLayout.FillDirection = Enum.FillDirection.Horizontal
  1491. TabList.Template.Visible = false
  1492.  
  1493. -- Tab
  1494. local FirstTab = false
  1495. local Window = {}
  1496. function Window:CreateTab(Name, Image, Ext)
  1497. local SDone = false
  1498. local TabButton = TabList.Template:Clone()
  1499. TabButton.Name = Name
  1500. TabButton.Title.Text = Name
  1501. TabButton.Parent = TabList
  1502. TabButton.Title.TextWrapped = false
  1503. TabButton.Size = UDim2.new(0, TabButton.Title.TextBounds.X + 30, 0, 30)
  1504.  
  1505. if Image and Image ~= 0 then
  1506. if typeof(Image) == 'string' then
  1507. local asset = getIcon(Image)
  1508.  
  1509. TabButton.Image.Image = 'rbxassetid://'..asset.id
  1510. TabButton.Image.ImageRectOffset = asset.imageRectOffset
  1511. TabButton.Image.ImageRectSize = asset.imageRectSize
  1512. else
  1513. TabButton.Image.Image = "rbxassetid://"..Image
  1514. end
  1515.  
  1516. TabButton.Title.AnchorPoint = Vector2.new(0, 0.5)
  1517. TabButton.Title.Position = UDim2.new(0, 37, 0.5, 0)
  1518. TabButton.Image.Visible = true
  1519. TabButton.Title.TextXAlignment = Enum.TextXAlignment.Left
  1520. TabButton.Size = UDim2.new(0, TabButton.Title.TextBounds.X + 52, 0, 30)
  1521. end
  1522.  
  1523.  
  1524.  
  1525. TabButton.BackgroundTransparency = 1
  1526. TabButton.Title.TextTransparency = 1
  1527. TabButton.Image.ImageTransparency = 1
  1528. TabButton.UIStroke.Transparency = 1
  1529.  
  1530. TabButton.Visible = not Ext or false
  1531.  
  1532. -- Create Elements Page
  1533. local TabPage = Elements.Template:Clone()
  1534. TabPage.Name = Name
  1535. TabPage.Visible = true
  1536.  
  1537. TabPage.LayoutOrder = #Elements:GetChildren() or Ext and 10000
  1538.  
  1539. for _, TemplateElement in ipairs(TabPage:GetChildren()) do
  1540. if TemplateElement.ClassName == "Frame" and TemplateElement.Name ~= "Placeholder" then
  1541. TemplateElement:Destroy()
  1542. end
  1543. end
  1544.  
  1545. TabPage.Parent = Elements
  1546. if not FirstTab and not Ext then
  1547. Elements.UIPageLayout.Animated = false
  1548. Elements.UIPageLayout:JumpTo(TabPage)
  1549. Elements.UIPageLayout.Animated = true
  1550. end
  1551.  
  1552. TabButton.UIStroke.Color = SelectedTheme.TabStroke
  1553.  
  1554. if Elements.UIPageLayout.CurrentPage == TabPage then
  1555. TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  1556. TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  1557. TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  1558. else
  1559. TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  1560. TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  1561. TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  1562. end
  1563.  
  1564.  
  1565. -- Animate
  1566. task.wait(0.1)
  1567. if FirstTab or Ext then
  1568. TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  1569. TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  1570. TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  1571. TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  1572. TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  1573. TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  1574. TweenService:Create(TabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  1575. elseif not Ext then
  1576. FirstTab = Name
  1577. TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  1578. TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  1579. TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  1580. TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  1581. TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1582. TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1583. end
  1584.  
  1585.  
  1586. TabButton.Interact.MouseButton1Click:Connect(function()
  1587. if Minimised then return end
  1588. TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1589. TweenService:Create(TabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1590. TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1591. TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  1592. TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.TabBackgroundSelected}):Play()
  1593. TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextColor3 = SelectedTheme.SelectedTabTextColor}):Play()
  1594. TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageColor3 = SelectedTheme.SelectedTabTextColor}):Play()
  1595.  
  1596. for _, OtherTabButton in ipairs(TabList:GetChildren()) do
  1597. if OtherTabButton.Name ~= "Template" and OtherTabButton.ClassName == "Frame" and OtherTabButton ~= TabButton and OtherTabButton.Name ~= "Placeholder" then
  1598. TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.TabBackground}):Play()
  1599. TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextColor3 = SelectedTheme.TabTextColor}):Play()
  1600. TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageColor3 = SelectedTheme.TabTextColor}):Play()
  1601. TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  1602. TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  1603. TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  1604. TweenService:Create(OtherTabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  1605. end
  1606. end
  1607.  
  1608. if Elements.UIPageLayout.CurrentPage ~= TabPage then
  1609. Elements.UIPageLayout:JumpTo(TabPage)
  1610. end
  1611. end)
  1612.  
  1613. local Tab = {}
  1614.  
  1615. -- Button
  1616. function Tab:CreateButton(ButtonSettings)
  1617. local ButtonValue = {}
  1618.  
  1619. local Button = Elements.Template.Button:Clone()
  1620. Button.Name = ButtonSettings.Name
  1621. Button.Title.Text = ButtonSettings.Name
  1622. Button.Visible = true
  1623. Button.Parent = TabPage
  1624.  
  1625. Button.BackgroundTransparency = 1
  1626. Button.UIStroke.Transparency = 1
  1627. Button.Title.TextTransparency = 1
  1628.  
  1629. TweenService:Create(Button, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1630. TweenService:Create(Button.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1631. TweenService:Create(Button.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  1632.  
  1633.  
  1634. Button.Interact.MouseButton1Click:Connect(function()
  1635. local Success, Response = pcall(ButtonSettings.Callback)
  1636. if not Success then
  1637. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1638. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1639. TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1640. Button.Title.Text = "Callback Error"
  1641. print("Rayfield | "..ButtonSettings.Name.." Callback Error " ..tostring(Response))
  1642. warn('Check docs.sirius.menu for help with Rayfield specific development.')
  1643. task.wait(0.5)
  1644. Button.Title.Text = ButtonSettings.Name
  1645. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1646. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.9}):Play()
  1647. TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1648. else
  1649. if not ButtonSettings.Ext then
  1650. SaveConfiguration(ButtonSettings.Name..'\n')
  1651. end
  1652. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1653. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  1654. TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1655. task.wait(0.2)
  1656. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1657. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.9}):Play()
  1658. TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1659. end
  1660. end)
  1661.  
  1662. Button.MouseEnter:Connect(function()
  1663. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1664. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.7}):Play()
  1665. end)
  1666.  
  1667. Button.MouseLeave:Connect(function()
  1668. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1669. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0.9}):Play()
  1670. end)
  1671.  
  1672. function ButtonValue:Set(NewButton)
  1673. Button.Title.Text = NewButton
  1674. Button.Name = NewButton
  1675. end
  1676.  
  1677. return ButtonValue
  1678. end
  1679.  
  1680. -- ColorPicker
  1681. function Tab:CreateColorPicker(ColorPickerSettings) -- by Throit
  1682. ColorPickerSettings.Type = "ColorPicker"
  1683. local ColorPicker = Elements.Template.ColorPicker:Clone()
  1684. local Background = ColorPicker.CPBackground
  1685. local Display = Background.Display
  1686. local Main = Background.MainCP
  1687. local Slider = ColorPicker.ColorSlider
  1688. ColorPicker.ClipsDescendants = true
  1689. ColorPicker.Name = ColorPickerSettings.Name
  1690. ColorPicker.Title.Text = ColorPickerSettings.Name
  1691. ColorPicker.Visible = true
  1692. ColorPicker.Parent = TabPage
  1693. ColorPicker.Size = UDim2.new(1, -10, 0, 45)
  1694. Background.Size = UDim2.new(0, 39, 0, 22)
  1695. Display.BackgroundTransparency = 0
  1696. Main.MainPoint.ImageTransparency = 1
  1697. ColorPicker.Interact.Size = UDim2.new(1, 0, 1, 0)
  1698. ColorPicker.Interact.Position = UDim2.new(0.5, 0, 0.5, 0)
  1699. ColorPicker.RGB.Position = UDim2.new(0, 17, 0, 70)
  1700. ColorPicker.HexInput.Position = UDim2.new(0, 17, 0, 90)
  1701. Main.ImageTransparency = 1
  1702. Background.BackgroundTransparency = 1
  1703.  
  1704. for _, rgbinput in ipairs(ColorPicker.RGB:GetChildren()) do
  1705. if rgbinput:IsA("Frame") then
  1706. rgbinput.BackgroundColor3 = SelectedTheme.InputBackground
  1707. rgbinput.UIStroke.Color = SelectedTheme.InputStroke
  1708. end
  1709. end
  1710.  
  1711. ColorPicker.HexInput.BackgroundColor3 = SelectedTheme.InputBackground
  1712. ColorPicker.HexInput.UIStroke.Color = SelectedTheme.InputStroke
  1713.  
  1714. local opened = false
  1715. local mouse = Players.LocalPlayer:GetMouse()
  1716. Main.Image = "http://www.roblox.com/asset/?id=11415645739"
  1717. local mainDragging = false
  1718. local sliderDragging = false
  1719. ColorPicker.Interact.MouseButton1Down:Connect(function()
  1720. task.spawn(function()
  1721. TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1722. TweenService:Create(ColorPicker.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  1723. task.wait(0.2)
  1724. TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1725. TweenService:Create(ColorPicker.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  1726. end)
  1727.  
  1728. if not opened then
  1729. opened = true
  1730. TweenService:Create(Background, TweenInfo.new(0.45, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 18, 0, 15)}):Play()
  1731. task.wait(0.1)
  1732. TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 120)}):Play()
  1733. TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 173, 0, 86)}):Play()
  1734. TweenService:Create(Display, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1735. TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.289, 0, 0.5, 0)}):Play()
  1736. TweenService:Create(ColorPicker.RGB, TweenInfo.new(0.8, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 40)}):Play()
  1737. TweenService:Create(ColorPicker.HexInput, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 73)}):Play()
  1738. TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0.574, 0, 1, 0)}):Play()
  1739. TweenService:Create(Main.MainPoint, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  1740. TweenService:Create(Main, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = SelectedTheme ~= RayfieldLibrary.Theme.Default and 0.25 or 0.1}):Play()
  1741. TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1742. else
  1743. opened = false
  1744. TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  1745. TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(0, 39, 0, 22)}):Play()
  1746. TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, 0, 1, 0)}):Play()
  1747. TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Position = UDim2.new(0.5, 0, 0.5, 0)}):Play()
  1748. TweenService:Create(ColorPicker.RGB, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 70)}):Play()
  1749. TweenService:Create(ColorPicker.HexInput, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Position = UDim2.new(0, 17, 0, 90)}):Play()
  1750. TweenService:Create(Display, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  1751. TweenService:Create(Main.MainPoint, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1752. TweenService:Create(Main, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {ImageTransparency = 1}):Play()
  1753. TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  1754. end
  1755.  
  1756. end)
  1757.  
  1758. UserInputService.InputEnded:Connect(function(input, gameProcessed) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  1759. mainDragging = false
  1760. sliderDragging = false
  1761. end end)
  1762. Main.MouseButton1Down:Connect(function()
  1763. if opened then
  1764. mainDragging = true
  1765. end
  1766. end)
  1767. Main.MainPoint.MouseButton1Down:Connect(function()
  1768. if opened then
  1769. mainDragging = true
  1770. end
  1771. end)
  1772. Slider.MouseButton1Down:Connect(function()
  1773. sliderDragging = true
  1774. end)
  1775. Slider.SliderPoint.MouseButton1Down:Connect(function()
  1776. sliderDragging = true
  1777. end)
  1778. local h,s,v = ColorPickerSettings.Color:ToHSV()
  1779. local color = Color3.fromHSV(h,s,v)
  1780. local hex = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1781. ColorPicker.HexInput.InputBox.Text = hex
  1782. local function setDisplay()
  1783. --Main
  1784. Main.MainPoint.Position = UDim2.new(s,-Main.MainPoint.AbsoluteSize.X/2,1-v,-Main.MainPoint.AbsoluteSize.Y/2)
  1785. Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1786. Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1787. Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1788. --Slider
  1789. local x = h * Slider.AbsoluteSize.X
  1790. Slider.SliderPoint.Position = UDim2.new(0,x-Slider.SliderPoint.AbsoluteSize.X/2,0.5,0)
  1791. Slider.SliderPoint.ImageColor3 = Color3.fromHSV(h,1,1)
  1792. local color = Color3.fromHSV(h,s,v)
  1793. 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)
  1794. ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1795. ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1796. ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1797. hex = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1798. ColorPicker.HexInput.InputBox.Text = hex
  1799. end
  1800. setDisplay()
  1801. ColorPicker.HexInput.InputBox.FocusLost:Connect(function()
  1802. if not pcall(function()
  1803. local r, g, b = string.match(ColorPicker.HexInput.InputBox.Text, "^#?(%w%w)(%w%w)(%w%w)$")
  1804. local rgbColor = Color3.fromRGB(tonumber(r, 16),tonumber(g, 16), tonumber(b, 16))
  1805. h,s,v = rgbColor:ToHSV()
  1806. hex = ColorPicker.HexInput.InputBox.Text
  1807. setDisplay()
  1808. ColorPickerSettings.Color = rgbColor
  1809. end)
  1810. then
  1811. ColorPicker.HexInput.InputBox.Text = hex
  1812. end
  1813. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1814. local r,g,b = math.floor((h*255)+0.5),math.floor((s*255)+0.5),math.floor((v*255)+0.5)
  1815. ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1816. if not ColorPickerSettings.Ext then
  1817. SaveConfiguration(ColorPickerSettings.Flag..'\n'..tostring(ColorPickerSettings.Color))
  1818. end
  1819. end)
  1820. --RGB
  1821. local function rgbBoxes(box,toChange)
  1822. local value = tonumber(box.Text)
  1823. local color = Color3.fromHSV(h,s,v)
  1824. 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)
  1825. local save
  1826. if toChange == "R" then save = oldR;oldR = value elseif toChange == "G" then save = oldG;oldG = value else save = oldB;oldB = value end
  1827. if value then
  1828. value = math.clamp(value,0,255)
  1829. h,s,v = Color3.fromRGB(oldR,oldG,oldB):ToHSV()
  1830.  
  1831. setDisplay()
  1832. else
  1833. box.Text = tostring(save)
  1834. end
  1835. local r,g,b = math.floor((h*255)+0.5),math.floor((s*255)+0.5),math.floor((v*255)+0.5)
  1836. ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1837. if not ColorPickerSettings.Ext then
  1838. SaveConfiguration()
  1839. end
  1840. end
  1841. ColorPicker.RGB.RInput.InputBox.FocusLost:connect(function()
  1842. rgbBoxes(ColorPicker.RGB.RInput.InputBox,"R")
  1843. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1844. end)
  1845. ColorPicker.RGB.GInput.InputBox.FocusLost:connect(function()
  1846. rgbBoxes(ColorPicker.RGB.GInput.InputBox,"G")
  1847. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1848. end)
  1849. ColorPicker.RGB.BInput.InputBox.FocusLost:connect(function()
  1850. rgbBoxes(ColorPicker.RGB.BInput.InputBox,"B")
  1851. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1852. end)
  1853.  
  1854. RunService.RenderStepped:connect(function()
  1855. if mainDragging then
  1856. local localX = math.clamp(mouse.X-Main.AbsolutePosition.X,0,Main.AbsoluteSize.X)
  1857. local localY = math.clamp(mouse.Y-Main.AbsolutePosition.Y,0,Main.AbsoluteSize.Y)
  1858. Main.MainPoint.Position = UDim2.new(0,localX-Main.MainPoint.AbsoluteSize.X/2,0,localY-Main.MainPoint.AbsoluteSize.Y/2)
  1859. s = localX / Main.AbsoluteSize.X
  1860. v = 1 - (localY / Main.AbsoluteSize.Y)
  1861. Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1862. Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1863. Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1864. local color = Color3.fromHSV(h,s,v)
  1865. 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)
  1866. ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1867. ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1868. ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1869. ColorPicker.HexInput.InputBox.Text = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1870. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1871. ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1872. if not ColorPickerSettings.Ext then
  1873. SaveConfiguration()
  1874. end
  1875. end
  1876. if sliderDragging then
  1877. local localX = math.clamp(mouse.X-Slider.AbsolutePosition.X,0,Slider.AbsoluteSize.X)
  1878. h = localX / Slider.AbsoluteSize.X
  1879. Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1880. Slider.SliderPoint.Position = UDim2.new(0,localX-Slider.SliderPoint.AbsoluteSize.X/2,0.5,0)
  1881. Slider.SliderPoint.ImageColor3 = Color3.fromHSV(h,1,1)
  1882. Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1883. Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1884. local color = Color3.fromHSV(h,s,v)
  1885. 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)
  1886. ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1887. ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1888. ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1889. ColorPicker.HexInput.InputBox.Text = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1890. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1891. ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1892. if not ColorPickerSettings.Ext then
  1893. SaveConfiguration()
  1894. end
  1895. end
  1896. end)
  1897.  
  1898. if Settings.ConfigurationSaving then
  1899. if Settings.ConfigurationSaving.Enabled and ColorPickerSettings.Flag then
  1900. RayfieldLibrary.Flags[ColorPickerSettings.Flag] = ColorPickerSettings
  1901. end
  1902. end
  1903.  
  1904. function ColorPickerSettings:Set(RGBColor)
  1905. ColorPickerSettings.Color = RGBColor
  1906. h,s,v = ColorPickerSettings.Color:ToHSV()
  1907. color = Color3.fromHSV(h,s,v)
  1908. setDisplay()
  1909. end
  1910.  
  1911. ColorPicker.MouseEnter:Connect(function()
  1912. TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1913. end)
  1914.  
  1915. ColorPicker.MouseLeave:Connect(function()
  1916. TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1917. end)
  1918.  
  1919. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  1920. for _, rgbinput in ipairs(ColorPicker.RGB:GetChildren()) do
  1921. if rgbinput:IsA("Frame") then
  1922. rgbinput.BackgroundColor3 = SelectedTheme.InputBackground
  1923. rgbinput.UIStroke.Color = SelectedTheme.InputStroke
  1924. end
  1925. end
  1926.  
  1927. ColorPicker.HexInput.BackgroundColor3 = SelectedTheme.InputBackground
  1928. ColorPicker.HexInput.UIStroke.Color = SelectedTheme.InputStroke
  1929. end)
  1930.  
  1931. return ColorPickerSettings
  1932. end
  1933.  
  1934. -- Section
  1935. function Tab:CreateSection(SectionName)
  1936.  
  1937. local SectionValue = {}
  1938.  
  1939. if SDone then
  1940. local SectionSpace = Elements.Template.SectionSpacing:Clone()
  1941. SectionSpace.Visible = true
  1942. SectionSpace.Parent = TabPage
  1943. end
  1944.  
  1945. local Section = Elements.Template.SectionTitle:Clone()
  1946. Section.Title.Text = SectionName
  1947. Section.Visible = true
  1948. Section.Parent = TabPage
  1949.  
  1950. Section.Title.TextTransparency = 1
  1951. TweenService:Create(Section.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.4}):Play()
  1952.  
  1953. function SectionValue:Set(NewSection)
  1954. Section.Title.Text = NewSection
  1955. end
  1956.  
  1957. SDone = true
  1958.  
  1959. return SectionValue
  1960. end
  1961.  
  1962. -- Divider
  1963. function Tab:CreateDivider()
  1964. local DividerValue = {}
  1965.  
  1966. local Divider = Elements.Template.Divider:Clone()
  1967. Divider.Visible = true
  1968. Divider.Parent = TabPage
  1969.  
  1970. Divider.Divider.BackgroundTransparency = 1
  1971. TweenService:Create(Divider.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.85}):Play()
  1972.  
  1973. function DividerValue:Set(Value)
  1974. Divider.Visible = Value
  1975. end
  1976.  
  1977. return DividerValue
  1978. end
  1979.  
  1980. -- Label
  1981. function Tab:CreateLabel(LabelText : string, Icon: number, Color : Color3, IgnoreTheme : boolean)
  1982. local LabelValue = {}
  1983.  
  1984. local Label = Elements.Template.Label:Clone()
  1985. Label.Title.Text = LabelText
  1986. Label.Visible = true
  1987. Label.Parent = TabPage
  1988.  
  1989. Label.BackgroundColor3 = Color or SelectedTheme.SecondaryElementBackground
  1990. Label.UIStroke.Color = Color or SelectedTheme.SecondaryElementStroke
  1991.  
  1992. if Icon then
  1993. if typeof(Icon) == 'string' then
  1994. local asset = getIcon(Icon)
  1995.  
  1996. Label.Icon.Image = 'rbxassetid://'..asset.id
  1997. Label.Icon.ImageRectOffset = asset.imageRectOffset
  1998. Label.Icon.ImageRectSize = asset.imageRectSize
  1999. else
  2000. Label.Icon.Image = "rbxassetid://" .. (Icon or 0)
  2001. end
  2002. else
  2003. Label.Icon.Image = "rbxassetid://" .. 0
  2004. end
  2005.  
  2006. if Icon and Label:FindFirstChild('Icon') then
  2007. Label.Title.Position = UDim2.new(0, 45, 0.5, 0)
  2008. Label.Title.Size = UDim2.new(1, -100, 0, 14)
  2009.  
  2010. if Icon then
  2011. if typeof(Icon) == 'string' then
  2012. local asset = getIcon(Icon)
  2013.  
  2014. Label.Icon.Image = 'rbxassetid://'..asset.id
  2015. Label.Icon.ImageRectOffset = asset.imageRectOffset
  2016. Label.Icon.ImageRectSize = asset.imageRectSize
  2017. else
  2018. Label.Icon.Image = "rbxassetid://" .. (Icon or 0)
  2019. end
  2020. else
  2021. Label.Icon.Image = "rbxassetid://" .. 0
  2022. end
  2023.  
  2024. Label.Icon.Visible = true
  2025. end
  2026.  
  2027. Label.Icon.ImageTransparency = 1
  2028. Label.BackgroundTransparency = 1
  2029. Label.UIStroke.Transparency = 1
  2030. Label.Title.TextTransparency = 1
  2031.  
  2032. TweenService:Create(Label, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = Color and 0.8 or 0}):Play()
  2033. TweenService:Create(Label.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = Color and 0.7 or 0}):Play()
  2034. TweenService:Create(Label.Icon, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  2035. TweenService:Create(Label.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = Color and 0.2 or 0}):Play()
  2036.  
  2037. function LabelValue:Set(NewLabel, Icon, Color)
  2038. Label.Title.Text = NewLabel
  2039.  
  2040. if Color then
  2041. Label.BackgroundColor3 = Color or SelectedTheme.SecondaryElementBackground
  2042. Label.UIStroke.Color = Color or SelectedTheme.SecondaryElementStroke
  2043. end
  2044.  
  2045. if Icon and Label:FindFirstChild('Icon') then
  2046. Label.Title.Position = UDim2.new(0, 45, 0.5, 0)
  2047. Label.Title.Size = UDim2.new(1, -100, 0, 14)
  2048.  
  2049. if Icon then
  2050. if typeof(Icon) == 'string' then
  2051. local asset = getIcon(Icon)
  2052.  
  2053. Label.Icon.Image = 'rbxassetid://'..asset.id
  2054. Label.Icon.ImageRectOffset = asset.imageRectOffset
  2055. Label.Icon.ImageRectSize = asset.imageRectSize
  2056. else
  2057. Label.Icon.Image = "rbxassetid://" .. (Icon or 0)
  2058. end
  2059. else
  2060. Label.Icon.Image = "rbxassetid://" .. 0
  2061. end
  2062.  
  2063. Label.Icon.Visible = true
  2064. end
  2065. end
  2066.  
  2067. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2068. Label.BackgroundColor3 = IgnoreTheme and (Color or Label.BackgroundColor3) or SelectedTheme.SecondaryElementBackground
  2069. Label.UIStroke.Color = IgnoreTheme and (Color or Label.BackgroundColor3) or SelectedTheme.SecondaryElementStroke
  2070. end)
  2071.  
  2072. return LabelValue
  2073. end
  2074.  
  2075. -- Paragraph
  2076. function Tab:CreateParagraph(ParagraphSettings)
  2077. local ParagraphValue = {}
  2078.  
  2079. local Paragraph = Elements.Template.Paragraph:Clone()
  2080. Paragraph.Title.Text = ParagraphSettings.Title
  2081. Paragraph.Content.Text = ParagraphSettings.Content
  2082. Paragraph.Visible = true
  2083. Paragraph.Parent = TabPage
  2084.  
  2085. Paragraph.BackgroundTransparency = 1
  2086. Paragraph.UIStroke.Transparency = 1
  2087. Paragraph.Title.TextTransparency = 1
  2088. Paragraph.Content.TextTransparency = 1
  2089.  
  2090. Paragraph.BackgroundColor3 = SelectedTheme.SecondaryElementBackground
  2091. Paragraph.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  2092.  
  2093. TweenService:Create(Paragraph, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2094. TweenService:Create(Paragraph.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2095. TweenService:Create(Paragraph.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2096. TweenService:Create(Paragraph.Content, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2097.  
  2098. function ParagraphValue:Set(NewParagraphSettings)
  2099. Paragraph.Title.Text = NewParagraphSettings.Title
  2100. Paragraph.Content.Text = NewParagraphSettings.Content
  2101. end
  2102.  
  2103. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2104. Paragraph.BackgroundColor3 = SelectedTheme.SecondaryElementBackground
  2105. Paragraph.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  2106. end)
  2107.  
  2108. return ParagraphValue
  2109. end
  2110.  
  2111. -- Input
  2112. function Tab:CreateInput(InputSettings)
  2113. local Input = Elements.Template.Input:Clone()
  2114. Input.Name = InputSettings.Name
  2115. Input.Title.Text = InputSettings.Name
  2116. Input.Visible = true
  2117. Input.Parent = TabPage
  2118.  
  2119. Input.BackgroundTransparency = 1
  2120. Input.UIStroke.Transparency = 1
  2121. Input.Title.TextTransparency = 1
  2122.  
  2123. Input.InputFrame.InputBox.Text = InputSettings.CurrentValue or ''
  2124.  
  2125. Input.InputFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2126. Input.InputFrame.UIStroke.Color = SelectedTheme.InputStroke
  2127.  
  2128. TweenService:Create(Input, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2129. TweenService:Create(Input.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2130. TweenService:Create(Input.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2131.  
  2132. Input.InputFrame.InputBox.PlaceholderText = InputSettings.PlaceholderText
  2133. Input.InputFrame.Size = UDim2.new(0, Input.InputFrame.InputBox.TextBounds.X + 24, 0, 30)
  2134.  
  2135. Input.InputFrame.InputBox.FocusLost:Connect(function()
  2136. local Success, Response = pcall(function()
  2137. InputSettings.Callback(Input.InputFrame.InputBox.Text)
  2138. InputSettings.CurrentValue = Input.InputFrame.InputBox.Text
  2139. end)
  2140.  
  2141. if not Success then
  2142. TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2143. TweenService:Create(Input.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2144. Input.Title.Text = "Callback Error"
  2145. print("Rayfield | "..InputSettings.Name.." Callback Error " ..tostring(Response))
  2146. warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2147. task.wait(0.5)
  2148. Input.Title.Text = InputSettings.Name
  2149. TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2150. TweenService:Create(Input.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2151. end
  2152.  
  2153. if InputSettings.RemoveTextAfterFocusLost then
  2154. Input.InputFrame.InputBox.Text = ""
  2155. end
  2156.  
  2157. if not InputSettings.Ext then
  2158. SaveConfiguration()
  2159. end
  2160. end)
  2161.  
  2162. Input.MouseEnter:Connect(function()
  2163. TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2164. end)
  2165.  
  2166. Input.MouseLeave:Connect(function()
  2167. TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2168. end)
  2169.  
  2170. Input.InputFrame.InputBox:GetPropertyChangedSignal("Text"):Connect(function()
  2171. TweenService:Create(Input.InputFrame, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Input.InputFrame.InputBox.TextBounds.X + 24, 0, 30)}):Play()
  2172. end)
  2173.  
  2174. function InputSettings:Set(text)
  2175. Input.InputFrame.InputBox.Text = text
  2176. InputSettings.CurrentValue = text
  2177.  
  2178. local Success, Response = pcall(function()
  2179. InputSettings.Callback(text)
  2180. end)
  2181.  
  2182. if not InputSettings.Ext then
  2183. SaveConfiguration()
  2184. end
  2185. end
  2186.  
  2187. if Settings.ConfigurationSaving then
  2188. if Settings.ConfigurationSaving.Enabled and InputSettings.Flag then
  2189. RayfieldLibrary.Flags[InputSettings.Flag] = InputSettings
  2190. end
  2191. end
  2192.  
  2193. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2194. Input.InputFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2195. Input.InputFrame.UIStroke.Color = SelectedTheme.InputStroke
  2196. end)
  2197.  
  2198. return InputSettings
  2199. end
  2200.  
  2201. -- Dropdown
  2202. function Tab:CreateDropdown(DropdownSettings)
  2203. local Dropdown = Elements.Template.Dropdown:Clone()
  2204. if string.find(DropdownSettings.Name,"closed") then
  2205. Dropdown.Name = "Dropdown"
  2206. else
  2207. Dropdown.Name = DropdownSettings.Name
  2208. end
  2209. Dropdown.Title.Text = DropdownSettings.Name
  2210. Dropdown.Visible = true
  2211. Dropdown.Parent = TabPage
  2212.  
  2213. Dropdown.List.Visible = false
  2214. if DropdownSettings.CurrentOption then
  2215. if type(DropdownSettings.CurrentOption) == "string" then
  2216. DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption}
  2217. end
  2218. if not DropdownSettings.MultipleOptions and type(DropdownSettings.CurrentOption) == "table" then
  2219. DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption[1]}
  2220. end
  2221. else
  2222. DropdownSettings.CurrentOption = {}
  2223. end
  2224.  
  2225. if DropdownSettings.MultipleOptions then
  2226. if DropdownSettings.CurrentOption and type(DropdownSettings.CurrentOption) == "table" then
  2227. if #DropdownSettings.CurrentOption == 1 then
  2228. Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2229. elseif #DropdownSettings.CurrentOption == 0 then
  2230. Dropdown.Selected.Text = "None"
  2231. else
  2232. Dropdown.Selected.Text = "Various"
  2233. end
  2234. else
  2235. DropdownSettings.CurrentOption = {}
  2236. Dropdown.Selected.Text = "None"
  2237. end
  2238. else
  2239. Dropdown.Selected.Text = DropdownSettings.CurrentOption[1] or "None"
  2240. end
  2241.  
  2242. Dropdown.Toggle.ImageColor3 = SelectedTheme.TextColor
  2243. TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2244.  
  2245. Dropdown.BackgroundTransparency = 1
  2246. Dropdown.UIStroke.Transparency = 1
  2247. Dropdown.Title.TextTransparency = 1
  2248.  
  2249. Dropdown.Size = UDim2.new(1, -10, 0, 45)
  2250.  
  2251. TweenService:Create(Dropdown, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2252. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2253. TweenService:Create(Dropdown.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2254.  
  2255. for _, ununusedoption in ipairs(Dropdown.List:GetChildren()) do
  2256. if ununusedoption.ClassName == "Frame" and ununusedoption.Name ~= "Placeholder" then
  2257. ununusedoption:Destroy()
  2258. end
  2259. end
  2260.  
  2261. Dropdown.Toggle.Rotation = 180
  2262.  
  2263. Dropdown.Interact.MouseButton1Click:Connect(function()
  2264. TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2265. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2266. task.wait(0.1)
  2267. TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2268. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2269. if Debounce then return end
  2270. if Dropdown.List.Visible then
  2271. Debounce = true
  2272. TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  2273. for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  2274. if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  2275. TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  2276. TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2277. TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  2278. end
  2279. end
  2280. TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ScrollBarImageTransparency = 1}):Play()
  2281. TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Rotation = 180}):Play()
  2282. task.wait(0.35)
  2283. Dropdown.List.Visible = false
  2284. Debounce = false
  2285. else
  2286. TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 180)}):Play()
  2287. Dropdown.List.Visible = true
  2288. TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ScrollBarImageTransparency = 0.7}):Play()
  2289. TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Rotation = 0}):Play()
  2290. for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  2291. if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  2292. if DropdownOpt.Name ~= Dropdown.Selected.Text then
  2293. TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2294. end
  2295. TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2296. TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2297. end
  2298. end
  2299. end
  2300. end)
  2301.  
  2302. Dropdown.MouseEnter:Connect(function()
  2303. if not Dropdown.List.Visible then
  2304. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2305. end
  2306. end)
  2307.  
  2308. Dropdown.MouseLeave:Connect(function()
  2309. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2310. end)
  2311.  
  2312. local function SetDropdownOptions()
  2313. for _, Option in ipairs(DropdownSettings.Options) do
  2314. local DropdownOption = Elements.Template.Dropdown.List.Template:Clone()
  2315. DropdownOption.Name = Option
  2316. DropdownOption.Title.Text = Option
  2317. DropdownOption.Parent = Dropdown.List
  2318. DropdownOption.Visible = true
  2319.  
  2320. DropdownOption.BackgroundTransparency = 1
  2321. DropdownOption.UIStroke.Transparency = 1
  2322. DropdownOption.Title.TextTransparency = 1
  2323.  
  2324. --local Dropdown = Tab:CreateDropdown({
  2325. -- Name = "Dropdown Example",
  2326. -- Options = {"Option 1","Option 2"},
  2327. -- CurrentOption = {"Option 1"},
  2328. -- MultipleOptions = true,
  2329. -- Flag = "Dropdown1",
  2330. -- Callback = function(TableOfOptions)
  2331.  
  2332. -- end,
  2333. --})
  2334.  
  2335.  
  2336. DropdownOption.Interact.ZIndex = 50
  2337. DropdownOption.Interact.MouseButton1Click:Connect(function()
  2338. if not DropdownSettings.MultipleOptions and table.find(DropdownSettings.CurrentOption, Option) then
  2339. return
  2340. end
  2341.  
  2342. if table.find(DropdownSettings.CurrentOption, Option) then
  2343. table.remove(DropdownSettings.CurrentOption, table.find(DropdownSettings.CurrentOption, Option))
  2344. if DropdownSettings.MultipleOptions then
  2345. if #DropdownSettings.CurrentOption == 1 then
  2346. Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2347. elseif #DropdownSettings.CurrentOption == 0 then
  2348. Dropdown.Selected.Text = "None"
  2349. else
  2350. Dropdown.Selected.Text = "Various"
  2351. end
  2352. else
  2353. Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2354. end
  2355. else
  2356. if not DropdownSettings.MultipleOptions then
  2357. table.clear(DropdownSettings.CurrentOption)
  2358. end
  2359. table.insert(DropdownSettings.CurrentOption, Option)
  2360. if DropdownSettings.MultipleOptions then
  2361. if #DropdownSettings.CurrentOption == 1 then
  2362. Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2363. elseif #DropdownSettings.CurrentOption == 0 then
  2364. Dropdown.Selected.Text = "None"
  2365. else
  2366. Dropdown.Selected.Text = "Various"
  2367. end
  2368. else
  2369. Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2370. end
  2371. TweenService:Create(DropdownOption.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2372. TweenService:Create(DropdownOption, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.DropdownSelected}):Play()
  2373. Debounce = true
  2374. end
  2375.  
  2376.  
  2377. local Success, Response = pcall(function()
  2378. DropdownSettings.Callback(DropdownSettings.CurrentOption)
  2379. end)
  2380.  
  2381. if not Success then
  2382. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2383. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2384. Dropdown.Title.Text = "Callback Error"
  2385. print("Rayfield | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  2386. warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2387. task.wait(0.5)
  2388. Dropdown.Title.Text = DropdownSettings.Name
  2389. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2390. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2391. end
  2392.  
  2393. for _, droption in ipairs(Dropdown.List:GetChildren()) do
  2394. if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" and not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2395. TweenService:Create(droption, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.DropdownUnselected}):Play()
  2396. end
  2397. end
  2398. if not DropdownSettings.MultipleOptions then
  2399. task.wait(0.1)
  2400. TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  2401. for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  2402. if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  2403. TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {BackgroundTransparency = 1}):Play()
  2404. TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2405. TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  2406. end
  2407. end
  2408. TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {ScrollBarImageTransparency = 1}):Play()
  2409. TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Rotation = 180}):Play()
  2410. task.wait(0.35)
  2411. Dropdown.List.Visible = false
  2412. end
  2413. Debounce = false
  2414. if not DropdownSettings.Ext then
  2415. SaveConfiguration()
  2416. end
  2417. end)
  2418.  
  2419. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2420. DropdownOption.UIStroke.Color = SelectedTheme.ElementStroke
  2421. end)
  2422. end
  2423. end
  2424. SetDropdownOptions()
  2425.  
  2426. for _, droption in ipairs(Dropdown.List:GetChildren()) do
  2427. if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" then
  2428. if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2429. droption.BackgroundColor3 = SelectedTheme.DropdownUnselected
  2430. else
  2431. droption.BackgroundColor3 = SelectedTheme.DropdownSelected
  2432. end
  2433.  
  2434. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2435. if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2436. droption.BackgroundColor3 = SelectedTheme.DropdownUnselected
  2437. else
  2438. droption.BackgroundColor3 = SelectedTheme.DropdownSelected
  2439. end
  2440. end)
  2441. end
  2442. end
  2443.  
  2444. function DropdownSettings:Set(NewOption)
  2445. DropdownSettings.CurrentOption = NewOption
  2446.  
  2447. if typeof(DropdownSettings.CurrentOption) == "string" then
  2448. DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption}
  2449. end
  2450.  
  2451. if not DropdownSettings.MultipleOptions then
  2452. DropdownSettings.CurrentOption = {DropdownSettings.CurrentOption[1]}
  2453. end
  2454.  
  2455. if DropdownSettings.MultipleOptions then
  2456. if #DropdownSettings.CurrentOption == 1 then
  2457. Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2458. elseif #DropdownSettings.CurrentOption == 0 then
  2459. Dropdown.Selected.Text = "None"
  2460. else
  2461. Dropdown.Selected.Text = "Various"
  2462. end
  2463. else
  2464. Dropdown.Selected.Text = DropdownSettings.CurrentOption[1]
  2465. end
  2466.  
  2467.  
  2468. local Success, Response = pcall(function()
  2469. DropdownSettings.Callback(NewOption)
  2470. end)
  2471. if not Success then
  2472. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2473. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2474. Dropdown.Title.Text = "Callback Error"
  2475. print("Rayfield | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  2476. warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2477. task.wait(0.5)
  2478. Dropdown.Title.Text = DropdownSettings.Name
  2479. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2480. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2481. end
  2482.  
  2483. for _, droption in ipairs(Dropdown.List:GetChildren()) do
  2484. if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" then
  2485. if not table.find(DropdownSettings.CurrentOption, droption.Name) then
  2486. droption.BackgroundColor3 = SelectedTheme.DropdownUnselected
  2487. else
  2488. droption.BackgroundColor3 = SelectedTheme.DropdownSelected
  2489. end
  2490. end
  2491. end
  2492. --SaveConfiguration()
  2493. end
  2494.  
  2495. function DropdownSettings:Refresh(optionsTable: table) -- updates a dropdown with new options from optionsTable
  2496. DropdownSettings.Options = optionsTable
  2497. for _, option in Dropdown.List:GetChildren() do
  2498. if option.ClassName == "Frame" and option.Name ~= "Placeholder" then
  2499. option:Destroy()
  2500. end
  2501. end
  2502. SetDropdownOptions()
  2503. end
  2504.  
  2505. if Settings.ConfigurationSaving then
  2506. if Settings.ConfigurationSaving.Enabled and DropdownSettings.Flag then
  2507. RayfieldLibrary.Flags[DropdownSettings.Flag] = DropdownSettings
  2508. end
  2509. end
  2510.  
  2511. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2512. Dropdown.Toggle.ImageColor3 = SelectedTheme.TextColor
  2513. TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2514. end)
  2515.  
  2516. return DropdownSettings
  2517. end
  2518.  
  2519. -- Keybind
  2520. function Tab:CreateKeybind(KeybindSettings)
  2521. local CheckingForKey = false
  2522. local Keybind = Elements.Template.Keybind:Clone()
  2523. Keybind.Name = KeybindSettings.Name
  2524. Keybind.Title.Text = KeybindSettings.Name
  2525. Keybind.Visible = true
  2526. Keybind.Parent = TabPage
  2527.  
  2528. Keybind.BackgroundTransparency = 1
  2529. Keybind.UIStroke.Transparency = 1
  2530. Keybind.Title.TextTransparency = 1
  2531.  
  2532. Keybind.KeybindFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2533. Keybind.KeybindFrame.UIStroke.Color = SelectedTheme.InputStroke
  2534.  
  2535. TweenService:Create(Keybind, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2536. TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2537. TweenService:Create(Keybind.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2538.  
  2539. Keybind.KeybindFrame.KeybindBox.Text = KeybindSettings.CurrentKeybind
  2540. Keybind.KeybindFrame.Size = UDim2.new(0, Keybind.KeybindFrame.KeybindBox.TextBounds.X + 24, 0, 30)
  2541.  
  2542. Keybind.KeybindFrame.KeybindBox.Focused:Connect(function()
  2543. CheckingForKey = true
  2544. Keybind.KeybindFrame.KeybindBox.Text = ""
  2545. end)
  2546. Keybind.KeybindFrame.KeybindBox.FocusLost:Connect(function()
  2547. CheckingForKey = false
  2548. if Keybind.KeybindFrame.KeybindBox.Text == nil or "" then
  2549. Keybind.KeybindFrame.KeybindBox.Text = KeybindSettings.CurrentKeybind
  2550. if not KeybindSettings.Ext then
  2551. SaveConfiguration()
  2552. end
  2553. end
  2554. end)
  2555.  
  2556. Keybind.MouseEnter:Connect(function()
  2557. TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2558. end)
  2559.  
  2560. Keybind.MouseLeave:Connect(function()
  2561. TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2562. end)
  2563.  
  2564. UserInputService.InputBegan:Connect(function(input, processed)
  2565. if CheckingForKey then
  2566. if input.KeyCode ~= Enum.KeyCode.Unknown then
  2567. local SplitMessage = string.split(tostring(input.KeyCode), ".")
  2568. local NewKeyNoEnum = SplitMessage[3]
  2569. Keybind.KeybindFrame.KeybindBox.Text = tostring(NewKeyNoEnum)
  2570. KeybindSettings.CurrentKeybind = tostring(NewKeyNoEnum)
  2571. Keybind.KeybindFrame.KeybindBox:ReleaseFocus()
  2572. if not KeybindSettings.Ext then
  2573. SaveConfiguration()
  2574. end
  2575.  
  2576. if KeybindSettings.CallOnChange then
  2577. KeybindSettings.Callback(tostring(NewKeyNoEnum))
  2578. end
  2579. end
  2580. elseif not KeybindSettings.CallOnChange and KeybindSettings.CurrentKeybind ~= nil and (input.KeyCode == Enum.KeyCode[KeybindSettings.CurrentKeybind] and not processed) then -- Test
  2581. local Held = true
  2582. local Connection
  2583. Connection = input.Changed:Connect(function(prop)
  2584. if prop == "UserInputState" then
  2585. Connection:Disconnect()
  2586. Held = false
  2587. end
  2588. end)
  2589.  
  2590. if not KeybindSettings.HoldToInteract then
  2591. local Success, Response = pcall(KeybindSettings.Callback)
  2592. if not Success then
  2593. TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2594. TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2595. Keybind.Title.Text = "Callback Error"
  2596. print("Rayfield | "..KeybindSettings.Name.." Callback Error " ..tostring(Response))
  2597. warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2598. task.wait(0.5)
  2599. Keybind.Title.Text = KeybindSettings.Name
  2600. TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2601. TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2602. end
  2603. else
  2604. task.wait(0.25)
  2605. if Held then
  2606. local Loop; Loop = RunService.Stepped:Connect(function()
  2607. if not Held then
  2608. KeybindSettings.Callback(false) -- maybe pcall this
  2609. Loop:Disconnect()
  2610. else
  2611. KeybindSettings.Callback(true) -- maybe pcall this
  2612. end
  2613. end)
  2614. end
  2615. end
  2616. end
  2617. end)
  2618.  
  2619. Keybind.KeybindFrame.KeybindBox:GetPropertyChangedSignal("Text"):Connect(function()
  2620. TweenService:Create(Keybind.KeybindFrame, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Keybind.KeybindFrame.KeybindBox.TextBounds.X + 24, 0, 30)}):Play()
  2621. end)
  2622.  
  2623. function KeybindSettings:Set(NewKeybind)
  2624. Keybind.KeybindFrame.KeybindBox.Text = tostring(NewKeybind)
  2625. KeybindSettings.CurrentKeybind = tostring(NewKeybind)
  2626. Keybind.KeybindFrame.KeybindBox:ReleaseFocus()
  2627. if not KeybindSettings.Ext then
  2628. SaveConfiguration()
  2629. end
  2630.  
  2631. if KeybindSettings.CallOnChange then
  2632. KeybindSettings.Callback(tostring(NewKeybind))
  2633. end
  2634. end
  2635.  
  2636. if Settings.ConfigurationSaving then
  2637. if Settings.ConfigurationSaving.Enabled and KeybindSettings.Flag then
  2638. RayfieldLibrary.Flags[KeybindSettings.Flag] = KeybindSettings
  2639. end
  2640. end
  2641.  
  2642. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2643. Keybind.KeybindFrame.BackgroundColor3 = SelectedTheme.InputBackground
  2644. Keybind.KeybindFrame.UIStroke.Color = SelectedTheme.InputStroke
  2645. end)
  2646.  
  2647. return KeybindSettings
  2648. end
  2649.  
  2650. -- Toggle
  2651. function Tab:CreateToggle(ToggleSettings)
  2652. local ToggleValue = {}
  2653.  
  2654. local Toggle = Elements.Template.Toggle:Clone()
  2655. Toggle.Name = ToggleSettings.Name
  2656. Toggle.Title.Text = ToggleSettings.Name
  2657. Toggle.Visible = true
  2658. Toggle.Parent = TabPage
  2659.  
  2660. Toggle.BackgroundTransparency = 1
  2661. Toggle.UIStroke.Transparency = 1
  2662. Toggle.Title.TextTransparency = 1
  2663. Toggle.Switch.BackgroundColor3 = SelectedTheme.ToggleBackground
  2664.  
  2665. if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2666. Toggle.Switch.Shadow.Visible = false
  2667. end
  2668.  
  2669. TweenService:Create(Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2670. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2671. TweenService:Create(Toggle.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2672.  
  2673. if ToggleSettings.CurrentValue == true then
  2674. Toggle.Switch.Indicator.Position = UDim2.new(1, -20, 0.5, 0)
  2675. Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleEnabledStroke
  2676. Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleEnabled
  2677. Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleEnabledOuterStroke
  2678. else
  2679. Toggle.Switch.Indicator.Position = UDim2.new(1, -40, 0.5, 0)
  2680. Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleDisabledStroke
  2681. Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleDisabled
  2682. Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleDisabledOuterStroke
  2683. end
  2684.  
  2685. Toggle.MouseEnter:Connect(function()
  2686. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2687. end)
  2688.  
  2689. Toggle.MouseLeave:Connect(function()
  2690. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2691. end)
  2692.  
  2693. Toggle.Interact.MouseButton1Click:Connect(function()
  2694. if ToggleSettings.CurrentValue == true then
  2695. ToggleSettings.CurrentValue = false
  2696. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2697. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2698. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -40, 0.5, 0)}):Play()
  2699. TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledStroke}):Play()
  2700. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleDisabled}):Play()
  2701. TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledOuterStroke}):Play()
  2702. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2703. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2704. else
  2705. ToggleSettings.CurrentValue = true
  2706. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2707. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2708. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -20, 0.5, 0)}):Play()
  2709. TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledStroke}):Play()
  2710. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleEnabled}):Play()
  2711. TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledOuterStroke}):Play()
  2712. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2713. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2714. end
  2715.  
  2716. local Success, Response = pcall(function()
  2717. if debugX then warn('Running toggle \''..ToggleSettings.Name..'\' (Interact)') end
  2718.  
  2719. ToggleSettings.Callback(ToggleSettings.CurrentValue)
  2720. end)
  2721.  
  2722. if not Success then
  2723. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2724. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2725. Toggle.Title.Text = "Callback Error"
  2726. print("Rayfield | "..ToggleSettings.Name.." Callback Error " ..tostring(Response))
  2727. warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2728. task.wait(0.5)
  2729. Toggle.Title.Text = ToggleSettings.Name
  2730. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2731. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2732. end
  2733.  
  2734. if not ToggleSettings.Ext then
  2735. SaveConfiguration()
  2736. end
  2737. end)
  2738.  
  2739. function ToggleSettings:Set(NewToggleValue)
  2740. if NewToggleValue == true then
  2741. ToggleSettings.CurrentValue = true
  2742. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2743. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2744. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -20, 0.5, 0)}):Play()
  2745. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2746. TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledStroke}):Play()
  2747. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleEnabled}):Play()
  2748. TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledOuterStroke}):Play()
  2749. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()
  2750. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2751. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2752. else
  2753. ToggleSettings.CurrentValue = false
  2754. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2755. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2756. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -40, 0.5, 0)}):Play()
  2757. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2758. TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledStroke}):Play()
  2759. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleDisabled}):Play()
  2760. TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledOuterStroke}):Play()
  2761. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()
  2762. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2763. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2764. end
  2765.  
  2766. local Success, Response = pcall(function()
  2767. if debugX then warn('Running toggle \''..ToggleSettings.Name..'\' (:Set)') end
  2768.  
  2769. ToggleSettings.Callback(ToggleSettings.CurrentValue)
  2770. end)
  2771.  
  2772. if not Success then
  2773. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2774. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2775. Toggle.Title.Text = "Callback Error"
  2776. print("Rayfield | "..ToggleSettings.Name.." Callback Error " ..tostring(Response))
  2777. warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2778. task.wait(0.5)
  2779. Toggle.Title.Text = ToggleSettings.Name
  2780. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2781. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2782. end
  2783.  
  2784. if not ToggleSettings.Ext then
  2785. SaveConfiguration()
  2786. end
  2787. end
  2788.  
  2789. if not ToggleSettings.Ext then
  2790. if Settings.ConfigurationSaving then
  2791. if Settings.ConfigurationSaving.Enabled and ToggleSettings.Flag then
  2792. RayfieldLibrary.Flags[ToggleSettings.Flag] = ToggleSettings
  2793. end
  2794. end
  2795. end
  2796.  
  2797.  
  2798. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2799. Toggle.Switch.BackgroundColor3 = SelectedTheme.ToggleBackground
  2800.  
  2801. if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2802. Toggle.Switch.Shadow.Visible = false
  2803. end
  2804.  
  2805. task.wait()
  2806.  
  2807. if not ToggleSettings.CurrentValue then
  2808. Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleDisabledStroke
  2809. Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleDisabled
  2810. Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleDisabledOuterStroke
  2811. else
  2812. Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleEnabledStroke
  2813. Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleEnabled
  2814. Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleEnabledOuterStroke
  2815. end
  2816. end)
  2817.  
  2818. return ToggleSettings
  2819. end
  2820.  
  2821. -- Slider
  2822. function Tab:CreateSlider(SliderSettings)
  2823. local SLDragging = false
  2824. local Slider = Elements.Template.Slider:Clone()
  2825. Slider.Name = SliderSettings.Name
  2826. Slider.Title.Text = SliderSettings.Name
  2827. Slider.Visible = true
  2828. Slider.Parent = TabPage
  2829.  
  2830. Slider.BackgroundTransparency = 1
  2831. Slider.UIStroke.Transparency = 1
  2832. Slider.Title.TextTransparency = 1
  2833.  
  2834. if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2835. Slider.Main.Shadow.Visible = false
  2836. end
  2837.  
  2838. Slider.Main.BackgroundColor3 = SelectedTheme.SliderBackground
  2839. Slider.Main.UIStroke.Color = SelectedTheme.SliderStroke
  2840. Slider.Main.Progress.UIStroke.Color = SelectedTheme.SliderStroke
  2841. Slider.Main.Progress.BackgroundColor3 = SelectedTheme.SliderProgress
  2842.  
  2843. TweenService:Create(Slider, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  2844. TweenService:Create(Slider.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2845. TweenService:Create(Slider.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  2846.  
  2847. 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)
  2848.  
  2849. if not SliderSettings.Suffix then
  2850. Slider.Main.Information.Text = tostring(SliderSettings.CurrentValue)
  2851. else
  2852. Slider.Main.Information.Text = tostring(SliderSettings.CurrentValue) .. " " .. SliderSettings.Suffix
  2853. end
  2854.  
  2855. Slider.MouseEnter:Connect(function()
  2856. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2857. end)
  2858.  
  2859. Slider.MouseLeave:Connect(function()
  2860. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2861. end)
  2862.  
  2863. Slider.Main.Interact.InputBegan:Connect(function(Input)
  2864. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  2865. TweenService:Create(Slider.Main.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2866. TweenService:Create(Slider.Main.Progress.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2867. SLDragging = true
  2868. end
  2869. end)
  2870.  
  2871. Slider.Main.Interact.InputEnded:Connect(function(Input)
  2872. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  2873. TweenService:Create(Slider.Main.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0.4}):Play()
  2874. TweenService:Create(Slider.Main.Progress.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0.3}):Play()
  2875. SLDragging = false
  2876. end
  2877. end)
  2878.  
  2879. Slider.Main.Interact.MouseButton1Down:Connect(function(X)
  2880. local Current = Slider.Main.Progress.AbsolutePosition.X + Slider.Main.Progress.AbsoluteSize.X
  2881. local Start = Current
  2882. local Location = X
  2883. local Loop; Loop = RunService.Stepped:Connect(function()
  2884. if SLDragging then
  2885. Location = UserInputService:GetMouseLocation().X
  2886. Current = Current + 0.025 * (Location - Start)
  2887.  
  2888. if Location < Slider.Main.AbsolutePosition.X then
  2889. Location = Slider.Main.AbsolutePosition.X
  2890. elseif Location > Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X then
  2891. Location = Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X
  2892. end
  2893.  
  2894. if Current < Slider.Main.AbsolutePosition.X + 5 then
  2895. Current = Slider.Main.AbsolutePosition.X + 5
  2896. elseif Current > Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X then
  2897. Current = Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X
  2898. end
  2899.  
  2900. if Current <= Location and (Location - Start) < 0 then
  2901. Start = Location
  2902. elseif Current >= Location and (Location - Start) > 0 then
  2903. Start = Location
  2904. end
  2905. TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.45, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Current - Slider.Main.AbsolutePosition.X, 1, 0)}):Play()
  2906. local NewValue = SliderSettings.Range[1] + (Location - Slider.Main.AbsolutePosition.X) / Slider.Main.AbsoluteSize.X * (SliderSettings.Range[2] - SliderSettings.Range[1])
  2907.  
  2908. NewValue = math.floor(NewValue / SliderSettings.Increment + 0.5) * (SliderSettings.Increment * 10000000) / 10000000
  2909. NewValue = math.clamp(NewValue, SliderSettings.Range[1], SliderSettings.Range[2])
  2910.  
  2911. if not SliderSettings.Suffix then
  2912. Slider.Main.Information.Text = tostring(NewValue)
  2913. else
  2914. Slider.Main.Information.Text = tostring(NewValue) .. " " .. SliderSettings.Suffix
  2915. end
  2916.  
  2917. if SliderSettings.CurrentValue ~= NewValue then
  2918. local Success, Response = pcall(function()
  2919. SliderSettings.Callback(NewValue)
  2920. end)
  2921. if not Success then
  2922. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2923. TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2924. Slider.Title.Text = "Callback Error"
  2925. print("Rayfield | "..SliderSettings.Name.." Callback Error " ..tostring(Response))
  2926. warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2927. task.wait(0.5)
  2928. Slider.Title.Text = SliderSettings.Name
  2929. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2930. TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2931. end
  2932.  
  2933. SliderSettings.CurrentValue = NewValue
  2934. if not SliderSettings.Ext then
  2935. SaveConfiguration()
  2936. end
  2937. end
  2938. else
  2939. TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.3, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = UDim2.new(0, Location - Slider.Main.AbsolutePosition.X > 5 and Location - Slider.Main.AbsolutePosition.X or 5, 1, 0)}):Play()
  2940. Loop:Disconnect()
  2941. end
  2942. end)
  2943. end)
  2944.  
  2945. function SliderSettings:Set(NewVal)
  2946. local NewVal = math.clamp(NewVal, SliderSettings.Range[1], SliderSettings.Range[2])
  2947.  
  2948. TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.45, Enum.EasingStyle.Exponential, 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()
  2949. Slider.Main.Information.Text = tostring(NewVal) .. " " .. (SliderSettings.Suffix or "")
  2950.  
  2951. local Success, Response = pcall(function()
  2952. SliderSettings.Callback(NewVal)
  2953. end)
  2954.  
  2955. if not Success then
  2956. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2957. TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 1}):Play()
  2958. Slider.Title.Text = "Callback Error"
  2959. print("Rayfield | "..SliderSettings.Name.." Callback Error " ..tostring(Response))
  2960. warn('Check docs.sirius.menu for help with Rayfield specific development.')
  2961. task.wait(0.5)
  2962. Slider.Title.Text = SliderSettings.Name
  2963. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2964. TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {Transparency = 0}):Play()
  2965. end
  2966.  
  2967. SliderSettings.CurrentValue = NewVal
  2968. if not SliderSettings.Ext then
  2969. SaveConfiguration()
  2970. end
  2971. end
  2972.  
  2973. if Settings.ConfigurationSaving then
  2974. if Settings.ConfigurationSaving.Enabled and SliderSettings.Flag then
  2975. RayfieldLibrary.Flags[SliderSettings.Flag] = SliderSettings
  2976. end
  2977. end
  2978.  
  2979. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2980. if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2981. Slider.Main.Shadow.Visible = false
  2982. end
  2983.  
  2984. Slider.Main.BackgroundColor3 = SelectedTheme.SliderBackground
  2985. Slider.Main.UIStroke.Color = SelectedTheme.SliderStroke
  2986. Slider.Main.Progress.UIStroke.Color = SelectedTheme.SliderStroke
  2987. Slider.Main.Progress.BackgroundColor3 = SelectedTheme.SliderProgress
  2988. end)
  2989.  
  2990. return SliderSettings
  2991. end
  2992.  
  2993. Rayfield.Main:GetPropertyChangedSignal('BackgroundColor3'):Connect(function()
  2994. TabButton.UIStroke.Color = SelectedTheme.TabStroke
  2995.  
  2996. if Elements.UIPageLayout.CurrentPage == TabPage then
  2997. TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  2998. TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  2999. TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  3000. else
  3001. TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  3002. TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  3003. TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  3004. end
  3005. end)
  3006.  
  3007. return Tab
  3008. end
  3009.  
  3010. Elements.Visible = true
  3011.  
  3012.  
  3013. task.wait(1.1)
  3014. TweenService:Create(Main, TweenInfo.new(0.7, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Size = UDim2.new(0, 390, 0, 90)}):Play()
  3015. task.wait(0.3)
  3016. TweenService:Create(LoadingFrame.Title, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  3017. TweenService:Create(LoadingFrame.Subtitle, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  3018. TweenService:Create(LoadingFrame.Version, TweenInfo.new(0.2, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  3019. task.wait(0.1)
  3020. TweenService:Create(Main, TweenInfo.new(0.6, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = useMobileSizing and UDim2.new(0, 500, 0, 275) or UDim2.new(0, 500, 0, 475)}):Play()
  3021. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {ImageTransparency = 0.6}):Play()
  3022.  
  3023. Topbar.BackgroundTransparency = 1
  3024. Topbar.Divider.Size = UDim2.new(0, 0, 0, 1)
  3025. Topbar.Divider.BackgroundColor3 = SelectedTheme.ElementStroke
  3026. Topbar.CornerRepair.BackgroundTransparency = 1
  3027. Topbar.Title.TextTransparency = 1
  3028. Topbar.Search.ImageTransparency = 1
  3029. if Topbar:FindFirstChild('Settings') then
  3030. Topbar.Settings.ImageTransparency = 1
  3031. end
  3032. Topbar.ChangeSize.ImageTransparency = 1
  3033. Topbar.Hide.ImageTransparency = 1
  3034.  
  3035.  
  3036. task.wait(0.5)
  3037. Topbar.Visible = true
  3038. TweenService:Create(Topbar, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  3039. TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0}):Play()
  3040. task.wait(0.1)
  3041. TweenService:Create(Topbar.Divider, TweenInfo.new(1, Enum.EasingStyle.Exponential), {Size = UDim2.new(1, 0, 0, 1)}):Play()
  3042. TweenService:Create(Topbar.Title, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {TextTransparency = 0}):Play()
  3043. task.wait(0.05)
  3044. TweenService:Create(Topbar.Search, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  3045. task.wait(0.05)
  3046. if Topbar:FindFirstChild('Settings') then
  3047. TweenService:Create(Topbar.Settings, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  3048. task.wait(0.05)
  3049. end
  3050. TweenService:Create(Topbar.ChangeSize, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  3051. task.wait(0.05)
  3052. TweenService:Create(Topbar.Hide, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  3053. task.wait(0.3)
  3054.  
  3055. if dragBar then
  3056. TweenService:Create(dragBarCosmetic, TweenInfo.new(0.6, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  3057. end
  3058.  
  3059. function Window.ModifyTheme(NewTheme)
  3060. local success = pcall(ChangeTheme, NewTheme)
  3061. if not success then
  3062. RayfieldLibrary:Notify({Title = 'Unable to Change Theme', Content = 'We are unable find a theme on file.', Image = 4400704299})
  3063. else
  3064. RayfieldLibrary:Notify({Title = 'Theme Changed', Content = 'Successfully changed theme to '..(typeof(NewTheme) == 'string' and NewTheme or 'Custom Theme')..'.', Image = 4483362748})
  3065. end
  3066. end
  3067.  
  3068. local success, result = pcall(function()
  3069. createSettings(Window)
  3070. end)
  3071.  
  3072. if not success then warn('Rayfield had an issue creating settings.') end
  3073.  
  3074. return Window
  3075. end
  3076.  
  3077. local function setVisibility(visibility: boolean, notify: boolean?)
  3078. if Debounce then return end
  3079. if visibility then
  3080. Hidden = false
  3081. Unhide()
  3082. else
  3083. Hidden = true
  3084. Hide(notify)
  3085. end
  3086. end
  3087.  
  3088. function RayfieldLibrary:SetVisibility(visibility: boolean)
  3089. setVisibility(visibility, false)
  3090. end
  3091.  
  3092. function RayfieldLibrary:IsVisible(): boolean
  3093. return not Hidden
  3094. end
  3095.  
  3096. local hideHotkeyConnection -- Has to be initialized here since the connection is made later in the script
  3097. function RayfieldLibrary:Destroy()
  3098. hideHotkeyConnection:Disconnect()
  3099. Rayfield:Destroy()
  3100. end
  3101.  
  3102. Topbar.ChangeSize.MouseButton1Click:Connect(function()
  3103. if Debounce then return end
  3104. if Minimised then
  3105. Minimised = false
  3106. Maximise()
  3107. else
  3108. Minimised = true
  3109. Minimise()
  3110. end
  3111. end)
  3112.  
  3113. Main.Search.Input:GetPropertyChangedSignal('Text'):Connect(function()
  3114. if #Main.Search.Input.Text > 0 then
  3115. if not Elements.UIPageLayout.CurrentPage:FindFirstChild('SearchTitle-fsefsefesfsefesfesfThanks') then
  3116. local searchTitle = Elements.Template.SectionTitle:Clone()
  3117. searchTitle.Parent = Elements.UIPageLayout.CurrentPage
  3118. searchTitle.Name = 'SearchTitle-fsefsefesfsefesfesfThanks'
  3119. searchTitle.LayoutOrder = -100
  3120. searchTitle.Title.Text = "Results from '"..Elements.UIPageLayout.CurrentPage.Name.."'"
  3121. searchTitle.Visible = true
  3122. end
  3123. else
  3124. local searchTitle = Elements.UIPageLayout.CurrentPage:FindFirstChild('SearchTitle-fsefsefesfsefesfesfThanks')
  3125.  
  3126. if searchTitle then
  3127. searchTitle:Destroy()
  3128. end
  3129. end
  3130.  
  3131. for _, element in ipairs(Elements.UIPageLayout.CurrentPage:GetChildren()) do
  3132. if element.ClassName ~= 'UIListLayout' and element.Name ~= 'Placeholder' and element.Name ~= 'SearchTitle-fsefsefesfsefesfesfThanks' then
  3133. if element.Name == 'SectionTitle' then
  3134. if #Main.Search.Input.Text == 0 then
  3135. element.Visible = true
  3136. else
  3137. element.Visible = false
  3138. end
  3139. else
  3140. if string.lower(element.Name):find(string.lower(Main.Search.Input.Text), 1, true) then
  3141. element.Visible = true
  3142. else
  3143. element.Visible = false
  3144. end
  3145. end
  3146. end
  3147. end
  3148. end)
  3149.  
  3150. Main.Search.Input.FocusLost:Connect(function(enterPressed)
  3151. if #Main.Search.Input.Text == 0 and searchOpen then
  3152. task.wait(0.12)
  3153. closeSearch()
  3154. end
  3155. end)
  3156.  
  3157. Topbar.Search.MouseButton1Click:Connect(function()
  3158. task.spawn(function()
  3159. if searchOpen then
  3160. closeSearch()
  3161. else
  3162. openSearch()
  3163. end
  3164. end)
  3165. end)
  3166.  
  3167. if Topbar:FindFirstChild('Settings') then
  3168. Topbar.Settings.MouseButton1Click:Connect(function()
  3169. task.spawn(function()
  3170. for _, OtherTabButton in ipairs(TabList:GetChildren()) do
  3171. if OtherTabButton.Name ~= "Template" and OtherTabButton.ClassName == "Frame" and OtherTabButton ~= TabButton and OtherTabButton.Name ~= "Placeholder" then
  3172. TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundColor3 = SelectedTheme.TabBackground}):Play()
  3173. TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextColor3 = SelectedTheme.TabTextColor}):Play()
  3174. TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageColor3 = SelectedTheme.TabTextColor}):Play()
  3175. TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {BackgroundTransparency = 0.7}):Play()
  3176. TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {TextTransparency = 0.2}):Play()
  3177. TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.2}):Play()
  3178. TweenService:Create(OtherTabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {Transparency = 0.5}):Play()
  3179. end
  3180. end
  3181.  
  3182. Elements.UIPageLayout:JumpTo(Elements['Rayfield Settings'])
  3183. end)
  3184. end)
  3185.  
  3186. end
  3187.  
  3188.  
  3189. Topbar.Hide.MouseButton1Click:Connect(function()
  3190. setVisibility(Hidden, not useMobileSizing)
  3191. end)
  3192.  
  3193. hideHotkeyConnection = UserInputService.InputBegan:Connect(function(input, processed)
  3194. if (input.KeyCode == Enum.KeyCode[settingsTable.General.rayfieldOpen.Value or 'K'] and not processed) then
  3195. if Debounce then return end
  3196. if Hidden then
  3197. Hidden = false
  3198. Unhide()
  3199. else
  3200. Hidden = true
  3201. Hide()
  3202. end
  3203. end
  3204. end)
  3205.  
  3206. if MPrompt then
  3207. MPrompt.Interact.MouseButton1Click:Connect(function()
  3208. if Debounce then return end
  3209. if Hidden then
  3210. Hidden = false
  3211. Unhide()
  3212. end
  3213. end)
  3214. end
  3215.  
  3216. for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  3217. if TopbarButton.ClassName == "ImageButton" and TopbarButton.Name ~= 'Icon' then
  3218. TopbarButton.MouseEnter:Connect(function()
  3219. TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0}):Play()
  3220. end)
  3221.  
  3222. TopbarButton.MouseLeave:Connect(function()
  3223. TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Exponential), {ImageTransparency = 0.8}):Play()
  3224. end)
  3225. end
  3226. end
  3227.  
  3228.  
  3229. function RayfieldLibrary:LoadConfiguration()
  3230. local config
  3231.  
  3232. if debugX then
  3233. warn('Loading Configuration')
  3234. end
  3235.  
  3236. if useStudio then
  3237. config = [[{"Toggle1adwawd":true,"ColorPicker1awd":{"B":255,"G":255,"R":255},"Slider1dawd":100,"ColorPicfsefker1":{"B":255,"G":255,"R":255},"Slidefefsr1":80,"dawdawd":"","Input1":"hh","Keybind1":"B","Dropdown1":["Ocean"]}]]
  3238. end
  3239.  
  3240. if CEnabled then
  3241. local notified
  3242. local loaded
  3243.  
  3244. local success, result = pcall(function()
  3245. if useStudio and config then
  3246. loaded = LoadConfiguration(config)
  3247. return
  3248. end
  3249.  
  3250. if isfile then
  3251. if isfile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension) then
  3252. loaded = LoadConfiguration(readfile(ConfigurationFolder .. "/" .. CFileName .. ConfigurationExtension))
  3253. end
  3254. else
  3255. notified = true
  3256. RayfieldLibrary:Notify({Title = "Rayfield Configurations", Content = "We couldn't enable Configuration Saving as you are not using software with filesystem support.", Image = 4384402990})
  3257. end
  3258. end)
  3259.  
  3260. if success and loaded and not notified then
  3261. RayfieldLibrary:Notify({Title = "Rayfield Configurations", Content = "The configuration file for this script has been loaded from a previous session.", Image = 4384403532})
  3262. elseif not success and not notified then
  3263. warn('Rayfield Configurations Error | '..tostring(result))
  3264. RayfieldLibrary:Notify({Title = "Rayfield Configurations", Content = "We've encountered an issue loading your configuration correctly.\n\nCheck the Developer Console for more information.", Image = 4384402990})
  3265. end
  3266. end
  3267.  
  3268. globalLoaded = true
  3269. end
  3270.  
  3271.  
  3272.  
  3273. if useStudio then
  3274. -- run w/ studio
  3275. -- Feel free to place your own script here to see how it'd work in Roblox Studio before running it on your execution software.
  3276.  
  3277.  
  3278. local Window = RayfieldLibrary:CreateWindow({
  3279. Name = "Rayfield Example Window",
  3280. LoadingTitle = "Rayfield Interface Suite",
  3281. Theme = 'Default',
  3282. Icon = 0,
  3283. LoadingSubtitle = "by Sirius",
  3284. ConfigurationSaving = {
  3285. Enabled = true,
  3286. FolderName = nil, -- Create a custom folder for your hub/game
  3287. FileName = "Big Hub52"
  3288. },
  3289. Discord = {
  3290. Enabled = false,
  3291. Invite = "noinvitelink", -- The Discord invite code, do not include discord.gg/. E.g. discord.gg/ABCD would be ABCD
  3292. RememberJoins = true -- Set this to false to make them join the discord every time they load it up
  3293. },
  3294. KeySystem = false, -- Set this to true to use our key system
  3295. KeySettings = {
  3296. Title = "Untitled",
  3297. Subtitle = "Key System",
  3298. Note = "No method of obtaining the key is provided",
  3299. FileName = "Key", -- It is recommended to use something unique as other scripts using Rayfield may overwrite your key file
  3300. SaveKey = true, -- The user's key will be saved, but if you change the key, they will be unable to use your script
  3301. GrabKeyFromSite = false, -- If this is true, set Key below to the RAW site you would like Rayfield to get the key from
  3302. Key = {"Hello"} -- List of keys that will be accepted by the system, can be RAW file links (pastebin, github etc) or simple strings ("hello","key22")
  3303. }
  3304. })
  3305.  
  3306. local Tab = Window:CreateTab("Tab Example", 'key-round') -- Title, Image
  3307. local Tab2 = Window:CreateTab("Tab Example 2", 4483362458) -- Title, Image
  3308.  
  3309. local Section = Tab2:CreateSection("Section")
  3310.  
  3311.  
  3312. local ColorPicker = Tab2:CreateColorPicker({
  3313. Name = "Color Picker",
  3314. Color = Color3.fromRGB(255,255,255),
  3315. Flag = "ColorPicfsefker1", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3316. Callback = function(Value)
  3317. -- The function that takes place every time the color picker is moved/changed
  3318. -- The variable (Value) is a Color3fromRGB value based on which color is selected
  3319. end
  3320. })
  3321.  
  3322. local Slider = Tab2:CreateSlider({
  3323. Name = "Slider Example",
  3324. Range = {0, 100},
  3325. Increment = 10,
  3326. Suffix = "Bananas",
  3327. CurrentValue = 40,
  3328. Flag = "Slidefefsr1", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3329. Callback = function(Value)
  3330. -- The function that takes place when the slider changes
  3331. -- The variable (Value) is a number which correlates to the value the slider is currently at
  3332. end,
  3333. })
  3334.  
  3335. local Input = Tab2:CreateInput({
  3336. Name = "Input Example",
  3337. CurrentValue = '',
  3338. PlaceholderText = "Input Placeholder",
  3339. Flag = 'dawdawd',
  3340. RemoveTextAfterFocusLost = false,
  3341. Callback = function(Text)
  3342. -- The function that takes place when the input is changed
  3343. -- The variable (Text) is a string for the value in the text box
  3344. end,
  3345. })
  3346.  
  3347.  
  3348. --RayfieldLibrary:Notify({Title = "Rayfield Interface", Content = "Welcome to Rayfield. These - are the brand new notification design for Rayfield, with custom sizing and Rayfield calculated wait times.", Image = 4483362458})
  3349.  
  3350. local Section = Tab:CreateSection("Section Example")
  3351.  
  3352. local Button = Tab:CreateButton({
  3353. Name = "Change Theme",
  3354. Callback = function()
  3355. -- The function that takes place when the button is pressed
  3356. Window.ModifyTheme('DarkBlue')
  3357. end,
  3358. })
  3359.  
  3360. local Toggle = Tab:CreateToggle({
  3361. Name = "Toggle Example",
  3362. CurrentValue = false,
  3363. Flag = "Toggle1adwawd", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3364. Callback = function(Value)
  3365. -- The function that takes place when the toggle is pressed
  3366. -- The variable (Value) is a boolean on whether the toggle is true or false
  3367. end,
  3368. })
  3369.  
  3370. local ColorPicker = Tab:CreateColorPicker({
  3371. Name = "Color Picker",
  3372. Color = Color3.fromRGB(255,255,255),
  3373. Flag = "ColorPicker1awd", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3374. Callback = function(Value)
  3375. -- The function that takes place every time the color picker is moved/changed
  3376. -- The variable (Value) is a Color3fromRGB value based on which color is selected
  3377. end
  3378. })
  3379.  
  3380. local Slider = Tab:CreateSlider({
  3381. Name = "Slider Example",
  3382. Range = {0, 100},
  3383. Increment = 10,
  3384. Suffix = "Bananas",
  3385. CurrentValue = 40,
  3386. Flag = "Slider1dawd", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3387. Callback = function(Value)
  3388. -- The function that takes place when the slider changes
  3389. -- The variable (Value) is a number which correlates to the value the slider is currently at
  3390. end,
  3391. })
  3392.  
  3393. local Input = Tab:CreateInput({
  3394. Name = "Input Example",
  3395. CurrentValue = "Helo",
  3396. PlaceholderText = "Adaptive Input",
  3397. RemoveTextAfterFocusLost = false,
  3398. Flag = 'Input1',
  3399. Callback = function(Text)
  3400. -- The function that takes place when the input is changed
  3401. -- The variable (Text) is a string for the value in the text box
  3402. end,
  3403. })
  3404.  
  3405. local thoptions = {}
  3406. for themename, theme in pairs(RayfieldLibrary.Theme) do
  3407. table.insert(thoptions, themename)
  3408. end
  3409.  
  3410. local Dropdown = Tab:CreateDropdown({
  3411. Name = "Theme",
  3412. Options = thoptions,
  3413. CurrentOption = {"Default"},
  3414. MultipleOptions = false,
  3415. Flag = "Dropdown1", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3416. Callback = function(Options)
  3417. --Window.ModifyTheme(Options[1])
  3418. -- The function that takes place when the selected option is changed
  3419. -- The variable (Options) is a table of strings for the current selected options
  3420. end,
  3421. })
  3422.  
  3423.  
  3424. --Window.ModifyTheme({
  3425. -- TextColor = Color3.fromRGB(50, 55, 60),
  3426. -- Background = Color3.fromRGB(240, 245, 250),
  3427. -- Topbar = Color3.fromRGB(215, 225, 235),
  3428. -- Shadow = Color3.fromRGB(200, 210, 220),
  3429.  
  3430. -- NotificationBackground = Color3.fromRGB(210, 220, 230),
  3431. -- NotificationActionsBackground = Color3.fromRGB(225, 230, 240),
  3432.  
  3433. -- TabBackground = Color3.fromRGB(200, 210, 220),
  3434. -- TabStroke = Color3.fromRGB(180, 190, 200),
  3435. -- TabBackgroundSelected = Color3.fromRGB(175, 185, 200),
  3436. -- TabTextColor = Color3.fromRGB(50, 55, 60),
  3437. -- SelectedTabTextColor = Color3.fromRGB(30, 35, 40),
  3438.  
  3439. -- ElementBackground = Color3.fromRGB(210, 220, 230),
  3440. -- ElementBackgroundHover = Color3.fromRGB(220, 230, 240),
  3441. -- SecondaryElementBackground = Color3.fromRGB(200, 210, 220),
  3442. -- ElementStroke = Color3.fromRGB(190, 200, 210),
  3443. -- SecondaryElementStroke = Color3.fromRGB(180, 190, 200),
  3444.  
  3445. -- SliderBackground = Color3.fromRGB(200, 220, 235), -- Lighter shade
  3446. -- SliderProgress = Color3.fromRGB(70, 130, 180),
  3447. -- SliderStroke = Color3.fromRGB(150, 180, 220),
  3448.  
  3449. -- ToggleBackground = Color3.fromRGB(210, 220, 230),
  3450. -- ToggleEnabled = Color3.fromRGB(70, 160, 210),
  3451. -- ToggleDisabled = Color3.fromRGB(180, 180, 180),
  3452. -- ToggleEnabledStroke = Color3.fromRGB(60, 150, 200),
  3453. -- ToggleDisabledStroke = Color3.fromRGB(140, 140, 140),
  3454. -- ToggleEnabledOuterStroke = Color3.fromRGB(100, 120, 140),
  3455. -- ToggleDisabledOuterStroke = Color3.fromRGB(120, 120, 130),
  3456.  
  3457. -- DropdownSelected = Color3.fromRGB(220, 230, 240),
  3458. -- DropdownUnselected = Color3.fromRGB(200, 210, 220),
  3459.  
  3460. -- InputBackground = Color3.fromRGB(220, 230, 240),
  3461. -- InputStroke = Color3.fromRGB(180, 190, 200),
  3462. -- PlaceholderColor = Color3.fromRGB(150, 150, 150)
  3463. --})
  3464.  
  3465. local Keybind = Tab:CreateKeybind({
  3466. Name = "Keybind Example",
  3467. CurrentKeybind = "Q",
  3468. HoldToInteract = false,
  3469. Flag = "Keybind1", -- A flag is the identifier for the configuration file, make sure every element has a different flag if you're using configuration saving to ensure no overlaps
  3470. Callback = function(Keybind)
  3471. -- The function that takes place when the keybind is pressed
  3472. -- The variable (Keybind) is a boolean for whether the keybind is being held or not (HoldToInteract needs to be true)
  3473. end,
  3474. })
  3475.  
  3476. local Label = Tab:CreateLabel("Label Example")
  3477.  
  3478. local Label2 = Tab:CreateLabel("Warning", 4483362458, Color3.fromRGB(255, 159, 49), true)
  3479.  
  3480. local Paragraph = Tab:CreateParagraph({Title = "Paragraph Example", Content = "Paragraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph ExampleParagraph Example"})
  3481. end
  3482.  
  3483. if CEnabled and Main:FindFirstChild('Notice') then
  3484. Main.Notice.BackgroundTransparency = 1
  3485. Main.Notice.Title.TextTransparency = 1
  3486. Main.Notice.Size = UDim2.new(0, 0, 0, 0)
  3487. Main.Notice.Position = UDim2.new(0.5, 0, 0, -100)
  3488. Main.Notice.Visible = true
  3489.  
  3490.  
  3491. TweenService:Create(Main.Notice, TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Size = UDim2.new(0, 280, 0, 35), Position = UDim2.new(0.5, 0, 0, -50), BackgroundTransparency = 0.5}):Play()
  3492. TweenService:Create(Main.Notice.Title, TweenInfo.new(0.5, Enum.EasingStyle.Exponential), {TextTransparency = 0.1}):Play()
  3493. end
  3494.  
  3495. if not useStudio then
  3496. local success, result = pcall(function()
  3497. loadstring(game:HttpGet('https://raw.githubusercontent.com/SiriusSoftwareLtd/Sirius/refs/heads/request/boost.lua'))()
  3498. end)
  3499.  
  3500. if not success then
  3501. print('Error with boost file.')
  3502. print(result)
  3503. end
  3504. end
  3505.  
  3506. task.delay(4, function()
  3507. RayfieldLibrary.LoadConfiguration()
  3508. if Main:FindFirstChild('Notice') and Main.Notice.Visible then
  3509. TweenService:Create(Main.Notice, TweenInfo.new(0.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {Size = UDim2.new(0, 100, 0, 25), Position = UDim2.new(0.5, 0, 0, -100), BackgroundTransparency = 1}):Play()
  3510. TweenService:Create(Main.Notice.Title, TweenInfo.new(0.3, Enum.EasingStyle.Exponential), {TextTransparency = 1}):Play()
  3511.  
  3512. task.wait(0.5)
  3513. Main.Notice.Visible = false
  3514. end
  3515. end)
  3516.  
  3517. return RayfieldLibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement