King12255

Rayfield

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