Shared
Imports a file that has a return value by passing its relative path
lib.require
lib.require(path)Parameters
- path
string
Returns
- response
any: a file's content
Examples
shared.lua
local config = lib.require('config/shared')
print(config.retval) -- Hello Lenixconfig/shared.lua
return {
retval = 'Hello Lenix'
}Callout
- The file you want to import must be defined atleast in the fxmanifest's file | files
- Requiring a file will automatically execute its content
- Don't include the extension of the file ('.lua') at the end of the path since we are already taking care of that.
- If the system could not find the path, please refer to your fxmanifest and copy how you defined that file that you are trying to require
- The file you want to require, it must be a non void file so you can receive its content