mohamedselhanafy

reyfeild clean

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