os.os.restart
Declaration
lua
os.restart([path])
Description
Restart the current script or start a different script. Raises a sentinel Lua error
__VNT_RESTART__ which is caught by the engine to trigger restart behavior.Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | Optional | — | Path to script file to restart with (must exist on disk) |
Return Values
| Type | Description |
|---|---|
| boolean | false + 'invalid path' if path doesn't exist. Does not return normally on success — raises error. |
Example
lua
os.restart() -- restart current script
os.restart("other_script.lua") -- start different script
Notes
The __VNT_RESTART__ error is a sentinel, not a real error. Engine catches it to restart.