Shopping Cart
FiveM script How to Have multiple scripts in one resource Modding Tutorials

[How-to] Have multiple scripts in one resource – Modding Tutorials


So hello guys so I saw someone that asked about how to have multiple scripts in one script. It is really easy and Iโ€™m going to show you guys an example:

So first you need to make a loadout as you can see I have 3 scripts in my pack: Script1, Script2, Script3,

script1

When you have made that, then we can move to the fxmanifest

So here is the fxmanifest code

-- Script pack by godgutten

fx_version 'cerulean'
game { 'gta5' }

client_scripts {
    '/**/client.lua'
}

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

Doing it this way will allow all files with the names client.lua or server.lua to be started without having to list everyone individually. (Note: Only works if your client and server files have the same names)


Iโ€™m going to give a download for those of you who like to do it that way:

Download: ScriptPack.rar

If your client or server files arenโ€™t the same you can use arrays to declare them in the fxmanifest

fx_version 'cerulean'
game { 'gta5' }

client_scripts {
     "'script1/client.lua",
      'script2/client.lua',
      'script3/server.lua'
}

server_scripts {
     'script1/server.lua',
     'script2/server.lua',
     'script3/server.lua'
}

Another way to do it is to declare each file seperately

-- Script pack by godgutten

fx_version 'cerulean'
game { 'gta5' }

-- Script 1 
client_script 'script1/client.lua'
server_script 'script1/server.lua'

-- Script 2
client_script 'script2/client.lua'
server_script 'script2/server.lua'

-- Script 3
client_script 'script3/client.lua'
server_script 'script3/server.lua'

This is a wiki post if you want to contribute you have permission

Leave a Reply
FiveM ESX Scripts

The best scripts and maps

Best support

Problems? We are there to help!

Wide range of products

We have a wide range of products

100% Secure Checkout

Stripe