Merging scripts

how please give me a example because i have been struggling with this

Hi I’m just looking into this but how about doing wildcards as can be done with cars now?

Like:

server_scripts {
'**/server.lua',
}

client_scripts {
'**/client.lua'
}

That would be a lot cleaner, and less time spend.

Have a great Christmas! :christmas_tree:

Merging scripts (not vehicles and maps) can be done in two ways:

  1. you put all files in separated folder in one resource with including files in config.lua
  2. or you put all codes into one file, for example I merged most of the scripts about vehicles into one client.lua and one server.lua

well the solution number 1 is easy to do but not much effective on increasing fps
but number 2 can boost your cpu and memory usage specially when you reduce “while loops” or in other meaning merging “while loops” into each other, for example we have 2 loops from 2 different scripts :

while true do
print(‘hello’)
Citizen.Wait(0)
end

while true do
print(‘hello2’)
Citizen.Wait(0)
end

why not just merging them into :

while true do
print(‘hello1’)
print(‘hello2’)
Citizen.Wait(0)
end

we have another solution for specific resources like jobs, for example we have esx_pizzajob and esx_delivery job, both have same structure with different job names and a few other stuffs so we can merge them into one by editing and adding some code

hope I did help you

For those who still don’t understand, I created 3 packs (Map_Pack, Car_Pack, Script_Pack). Everything you need to know is in the README.

Merge Scripts.zip (4.9 KB)

if you still need help i can help you

the car merger does not always work