Skip to main content

Create a window

Rayfield:CreateWindow() is the entry point for your UI. Call it once after loading the library.
local Window = Rayfield:CreateWindow({
   Name = "Rayfield Example Window",
   Icon = 0, -- Icon in Topbar. Can use Lucide Icons (string) or Roblox Image (number). 0 to use no icon (default).
   LoadingTitle = "Rayfield Interface Suite",
   LoadingSubtitle = "by Sirius",
   ShowText = "Rayfield", -- for mobile users to unhide Rayfield, change if you'd like
   Theme = "Default", -- Check https://docs.sirius.menu/rayfield/configuration/themes

   ToggleUIKeybind = "K", -- The keybind to toggle the UI visibility (string like "K" or Enum.KeyCode)

   DisableRayfieldPrompts = false,
   DisableBuildWarnings = false, -- Prevents Rayfield from emitting warnings when the script has a version mismatch with the interface.

   ConfigurationSaving = {
      Enabled = true,
      FolderName = nil, -- Create a custom folder for your hub/game
      FileName = "Big Hub"
   },

   Discord = {
      Enabled = false, -- Prompt the user to join your Discord server if their executor supports it
      Invite = "noinvitelink", -- The Discord invite code, do not include Discord.gg/. E.g. Discord.gg/ABCD would be ABCD
      RememberJoins = true -- Set this to false to make them join the Discord every time they load it up
   },

   KeySystem = false, -- Set this to true to use our key system
   KeySettings = {
      Title = "Untitled",
      Subtitle = "Key System",
      Note = "No method of obtaining the key is provided", -- Use this to tell the user how to get a key
      FileName = "Key", -- It is recommended to use something unique, as other scripts using Rayfield may overwrite your key file
      SaveKey = true, -- The user's key will be saved, but if you change the key, they will be unable to use your script
      GrabKeyFromSite = false, -- If this is true, set Key below to the RAW site you would like Rayfield to get the key from
      Key = {"Hello"} -- List of keys that the system will accept, can be RAW file links (pastebin, github, etc.) or simple strings ("hello", "key22")
   }
})

Options

Name
string
required
The title displayed in the window header.
Icon
number | string
Icon shown in the topbar. Pass a Roblox image ID (number), a Lucide icon name (string), or 0 for no icon.
LoadingTitle
string
Title shown on the loading screen.
LoadingSubtitle
string
Subtitle shown on the loading screen.
ShowText
string
Text shown to mobile users to unhide the UI.
Theme
string | table
The theme to apply. Pass a theme identifier string or a custom theme table. See Themes.
ToggleUIKeybind
string | Enum.KeyCode
The key that toggles UI visibility.
DisableRayfieldPrompts
boolean
Suppresses built-in Rayfield prompts.
DisableBuildWarnings
boolean
Prevents Rayfield from emitting warnings when there is a version mismatch between your script and the interface.
ConfigurationSaving
object
Controls automatic configuration saving.
Discord
object
Prompts the user to join your Discord server on supported executors.
KeySystem
boolean
Enables the key system. Configure it with KeySettings.
KeySettings
object
Settings for the key system. Only used when KeySystem is true.

Create a tab

Tabs are the top-level sections inside a window. Each tab can hold its own elements.
local Tab = Window:CreateTab("Tab Example", 4483362458) -- Title, Image

Lucide icon support

You can use a Lucide icon name in place of a Roblox image ID.
local Tab = Window:CreateTab("Tab Example", "rewind")
Not all Lucide icons are supported. See the full list of supported icons. Credit to Lucide and Latte Softworks.

Create a section

Sections add a labelled group header inside a tab.
local Section = Tab:CreateSection("Section Example")

Update a section

Section:Set("Section Example")

Create a divider

Dividers add a horizontal rule inside a tab to visually separate content.
local Divider = Tab:CreateDivider()

Update a divider

Divider:Set(false) -- Whether the divider's visibility is to be set to true or false.

Visibility

Set visibility

Rayfield:SetVisibility(false)

Get visibility

Rayfield:IsVisible()

Destroy the interface

Rayfield:Destroy()