# 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;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://legacy-script.gitbook.io/legacy-script/lgf-utility/init-core.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
