util.resource.restart
Server
Restarts a running resource
Syntax
local result = util.resource.restart(
name
)The resource must be running before it can be restarted.
- Not running — returns
falseif the resource is not currently running. - Manifest reload — the manifest is re-read and re-parsed on restart; any changes to scripts or files are picked up automatically.
- Cleanup — the stop phase cleans up all entities, threads, promises, timers, events, and exports before the resource is started again.
- Async — the restart is enqueued; stop executes immediately on the main thread, then start is re-enqueued after.
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of the resource to restart |
Returns
| Type | Name | Description |
|---|---|---|
bool | result | true if the restart was enqueued successfully, false otherwise |
Examples
util.resource.restart("my_resource")if util.resource.is_running("my_resource") then
util.resource.restart("my_resource")
end