Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
roblox.engine.LocalScript — openapi
A LocalScript is a Lua code container that runs its contents on the client (player's device) instead of the server.
Properties
| Name | Type | Required | Description |
|---|---|---|---|
| Enabled | boolean | false | Determines whether a BaseScript will run or not. |
| RunContext | string | false | Determines the context under 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. | |
| Source | string | false | The code to be executed. |
Complete Schema
{
"type": "object",
"properties": {
"Enabled": {
"example": true,
"type": "boolean",
"description": "Determines whether a BaseScript will run or not."
},
"RunContext": {
"example": "Legacy",
"enum": [
"Legacy",
"Server",
"Client",
"Plugin"
],
"type": "string",
"description": "Determines the context under 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 LocalScript is a Lua code container that runs its contents on the client (player's device) instead of the server.",
"x-oneOf": {
"Enabled": [
"Enabled"
],
"RunContext": [
"RunContext"
],
"Source": [
"Source"
]
}
}