> For the complete documentation index, see [llms.txt](https://doc.open-tx.org/opentx-lua-reference-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.open-tx.org/opentx-lua-reference-guide/part_ii_-_opentx_lua_api_programming_guide/init_function_syntax.md).

# Init Function Syntax

If defined, *init* function is called right after the script is loaded from SD card and begins execution. Init is called only once before the run function is called for the first time.

```lua
local function <init_function_name>()
  -- code here runs only once when the model is loaded
end
```

* **Input Parameters:**

  none
* **Return values:**

  none
