> For the complete documentation index, see [llms.txt](https://smuddgge.gitbook.io/leaf-3.0.0/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smuddgge.gitbook.io/leaf-3.0.0/commands/other-types/variable.md).

# variable

Set the value of a variable.

{% code title="Example" overflow="wrap" %}

```yaml
change_theme:
  type: "variable"
  enabled: true
  name: "theme"
  # The variable to save to.
  variable: "theme"
  # Suggest options for the player to choose from.
  suggest:
    - "green"
    - "gray"
  # Only allow values from suggest list.
  # Defaults to false.
  only_allow_suggestions: true
  incorrect_value: "{error_colour}You can only set the theme to &fgreen &7or &fgray."
  correct_value: "{message} Theme is now set to &f<theme>"
```

{% endcode %}
