> For the complete documentation index, see [llms.txt](https://legacy-script.gitbook.io/legacy-script/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-script.gitbook.io/legacy-script/lgf-utility/init-core.md).

# INIT CORE

`EXPLANATION OF THE MAIN MODULE EXPORT`

```lua
_ENV.LGF = lib.load(("modules.%s.main"):format(lib.context))
```

This line assigns the loaded main module to the application's environment variable `_ENV.LGF` by:

* **Dynamically Loading:** It dynamically loads the main module using `lib.load`.
* **Path Construction:** It constructs the path with `("modules.%s.main")`, where `%s` is replaced by `lib.context`.
* **Environmental Assignment:** The module is then assigned to `_ENV.LGF` for simplified access.

This approach allows seamless integration of the main module into the application environment.

### Importing Modules

To directly import the modules in the `fxmanifest.lua` file, follow the guidelines provided below:

* **Import All Modules**:

```lua
shared_scripts {
    '@LGF_Utility/init.lua',
}
```

Comprehensive `fxmanifest.lua` Example

```lua
fx_version 'adamant'
game 'gta5'

author 'ENT510'
version '1.0.0'
lua54 'yes'

shared_scripts {
    '@ox_lib/init.lua',
    '@LGF_Utility/init.lua',
    'shared/*.lua'
}

client_scripts {
    'client/*.lua',
}

server_scripts {
    'server/*.lua'
}
```

* **In this configuration, the `fxmanifest.lua` file incorporates the necessary modules and scripts**&#x20;
