wghcbgfftgh

Untitled

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