👨‍💻INIT CORE

EXPLANATION OF THE MAIN MODULE EXPORT

_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:

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

Comprehensive fxmanifest.lua Example

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

Last updated