ScriptSystemclass
Creates scripts in the current menu or game context. Identical source shares cached code, while each script has independent arguments and execution state.
Methods4
Showing 4 methods
public Sandbox.Script.Analysis Analyze(string source, System.Collections.Generic.IEnumerable`1<Sandbox.Script.Input> inputs = null)
| Parameter | Type | Description |
|---|---|---|
| source | string | — |
| inputs = null | IEnumerable<Input> | — |
public Sandbox.Script CreateScript(string source, Sandbox.ScriptStore locals = null)
Creates a reusable script. Syntax and execution errors are reported through `Sandbox.Script.LastError`. Binding and IL compilation occur on the first run, once arguments are available. Supply a local store to share persistent fields or preserve them across source edits. If omitted, the script receives its own local store.
| Parameter | Type | Description |
|---|---|---|
| source | string | — |
| locals = null | ScriptStore | — |
public Sandbox.ScriptStore CreateStore()
Creates an independent store. Share it between scripts belonging to the same owner.
public T Run(string source)
Runs a script using cached code and returns its value. Throws if execution fails, no value is returned, or the return type is incompatible with .
| Parameter | Type | Description |
|---|---|---|
| source | string | — |
T—No results match this filter.
Properties1
Showing 1 properties
public Sandbox.ScriptStore Sandbox.ScriptSystem.Globals { get; set; }
Runtime values shared by all scripts in this game or menu context.
No results match this filter.