CreateScript
(source, locals)
Script
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.
LoadFile
(filePath, source)
FileLoadResult
Adds or replaces one named script from source without reading or writing a file, preserving other scripts.
The name shares the same namespace as loaded resource paths; a later resource scan can replace it.
Hosts replicate .csx names except those ending in .server.csx, including to clients that join later.
Unchanged source does not run again. Clients receiving the host's scripts cannot call this method.
Publication and startup failures are reported in the result, as with Sandbox.ScriptSystem.LoadFiles(System.Collections.Generic.IReadOnlyDictionary{System.String,System.String}).