Skip to content

Best strip Update getting-started.mdx#20

Open
greentrevion23-afk wants to merge 1 commit into
SiriusSoftwareLtd:mainfrom
greentrevion23-afk:patch-3
Open

Best strip Update getting-started.mdx#20
greentrevion23-afk wants to merge 1 commit into
SiriusSoftwareLtd:mainfrom
greentrevion23-afk:patch-3

Conversation

@greentrevion23-afk

Copy link
Copy Markdown

-local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() title: Loading the library
description: How to load Rayfield into your script and enable configuration saving. ---

**Share your script with the community.**

Publish your script on RoScripts so players can find your script.

Load Rayfield

Add the following line at the top of your script to load the Rayfield library.

local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()

Enable configuration saving

Configuration saving lets Rayfield automatically persist and restore element values across sessions.

Set `ConfigurationSaving.Enabled` to `true` and provide a `FileName` when calling `CreateWindow`. Every element that supports configuration saving has a `Flag` field. Make sure each flag is unique to avoid conflicts. Place `Rayfield:LoadConfiguration()` after all your elements have been created.
```lua
Rayfield:LoadConfiguration()
```

Rayfield will now automatically save and restore your configuration on each load.

-local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
title: Loading the library
description: How to load Rayfield into your script and enable configuration saving.
---

<Note>
  **Share your script with the community.**

  Publish your script on [RoScripts](https://roscripts.io) so players can find your script.
</Note>

## Load Rayfield

Add the following line at the top of your script to load the Rayfield library.

```lua
local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
```

## Enable configuration saving

Configuration saving lets Rayfield automatically persist and restore element values across sessions.

<Steps>
  <Step title="Enable ConfigurationSaving in CreateWindow">
    Set `ConfigurationSaving.Enabled` to `true` and provide a `FileName` when calling `CreateWindow`.
  </Step>
  <Step title="Set a unique flag on each element">
    Every element that supports configuration saving has a `Flag` field. Make sure each flag is unique to avoid conflicts.
  </Step>
  <Step title="Call LoadConfiguration at the end of your script">
    Place `Rayfield:LoadConfiguration()` after all your elements have been created.

    ```lua
    Rayfield:LoadConfiguration()
    ```
  </Step>
</Steps>

Rayfield will now automatically save and restore your configuration on each load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant