# Sandbox.ScriptSystem.LoadFile

```csharp
FileLoadResult LoadFile(string filePath, string source)
```

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 `M:Sandbox.ScriptSystem.LoadFiles(System.Collections.Generic.IReadOnlyDictionary{System.String,System.String})`.

### Parameters

- `filePath` (`string`)
- `source` (`string`)

### Returns

`FileLoadResult`

Declared in [Sandbox.ScriptSystem](/api/Sandbox.ScriptSystem).
Assembly: `Sandbox.Engine`.
