[HELP] Is it safe to compact "complex" scripts?

Hello!
I’ve been working on my server for a long time and I was wondering if I can compact some scripts. I already compacted some small scripts without config.lua, locale folder… etc…

Is is possible and safe to compact scripts with config.lua with coords and some specific configs?
Maybe I can put the code from config.lua on top of client.lua, server.lua etc?

If someone can help with that, thanks! Have a nice day x)

1 Like

By compact you mean

put the code from config.lua on top of client.lua, server.lua etc

I don’t see why you would do that, but as long as the variables are defined it should work?

I have more than 80 resources now on my server and I see servers with 30/40 resources. I heard that fivem only loads a certain number of resources and I want to make sure everything is loaded on my server. I will try to convert multiple resources into one, if it doesnt work, its ok… i think xD

Just make sure you refrence all the files in __resource.lua

As long as it works now no need to worry :smiley:

But it’s a terrible way of working.

The more files you have in a script folder means the more the code is easy to maintain.

fivem was limiting 80 ressources on cfx, now i got 92 resources on my server and it works like a charm.

Thanks for the information, I have now 60/70 resources and its working better than before (120/130 resources). I didnt know that 80 resources was the limit, thanks !

1 Like