2 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

roblox.engine.Script — cloud.docs

A Script is a Lua code container that can access server-side objects, properties, and events, such as to award badges to players using BadgeService, while LocalScripts on the client cannot.

Properties

NameTypeRequiredDescription
EnabledbooleanfalseDetermines whether the BaseScript will run or not.
RunContextstringfalseDetermines the context in which the script will run. Possible values: | Value | Description | | --- | --- | | Legacy | Runs in legacy script containers dependent on the type of script used, such as LocalScript or Script. | | Server | Runs on the server. | | Client | Runs on the client. | | Plugin | Runs as a descendant of Plugin instances. |
SourcestringfalseThe code to be executed.

Complete Schema

{
  "type": "object",
  "properties": {
    "Enabled": {
      "example": true,
      "type": "boolean",
      "description": "Determines whether the BaseScript will run or not."
    },
    "RunContext": {
      "example": "Legacy",
      "enum": [
        "Legacy",
        "Server",
        "Client",
        "Plugin"
      ],
      "type": "string",
      "description": "Determines the context in which the script will run.\n\nPossible values:\n\n  | Value | Description |\n  | --- | --- |\n  | Legacy | Runs in legacy script containers dependent on the type of script used, such as LocalScript or Script. |\n  | Server | Runs on the server. |\n  | Client | Runs on the client. |\n  | Plugin | Runs as a descendant of Plugin instances. |",
      "format": "enum"
    },
    "Source": {
      "type": "string",
      "description": "The code to be executed."
    }
  },
  "description": "A Script is a Lua code container that can access server-side objects, properties, and events, such as to award badges to players using BadgeService, while LocalScripts on the client cannot.",
  "x-oneOf": {
    "Enabled": [
      "Enabled"
    ],
    "RunContext": [
      "RunContext"
    ],
    "Source": [
      "Source"
    ]
  }
}