[HELP] Error nil value (global 'require')


I’ve came across a weird problem. Hope that anyone can help me.

So I decided to make a job on the server but It seems like I cant connect to the DB with the script.
I’m using the following line in server/main.lua:

> require "resources/mysql-async/lib/MySQL"
> MySQL:open("", "essentialmode", "root", "")

and I get this error:

Error loading script server/main.lua in resource esx_military: server/main.lua:1: attempt to call a nil value (global 'require')
stack traceback:
        server/main.lua:1: in main chunk
Failed to load script server/main.lua.


Require hasnt been used in a long time here as lua 5.3 doesn’t use if. If you would have used the search bar you would see its been said multiple times…


I’ve been serching for 2 hours now. I always serch before I make a help post.
So what do I do now then. How do I make the plugin communicate with the db?


I believe you do

server_script “@resourcename/examplefile.lua”

Not sure though.

(In your __resource.lua file)


I believe it worked!
Thanks alot!


The full install was in the readme

Unfortunately some old tutorials have yet to be removed using the require method but you can use that method to load any external Lua files from another resource as MySQL Async shows a good example for that.


Okay next problem.
It tells me that I have an error in my config.lua

resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'

description 'Military Job'

version '1.0.0'

server_scripts {

client_scripts {

files {

ui_page 'html/ui.html'

Error code:

Error parsing script config.lua in resource esx_military: config.lua:18: '}' expected (to close '{' at line 4) near 'Config'

Help? xD


Your not closing the config table.


Thanks alot.
This helped. I was looking at the __resouce.lua file