Advertisement
vxste

rayfield no key sys

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