Resource files

Hello,

I use Fox Warrior for making the force download files but i want to know if i can have multiple files with this in it: if (SERVER) then resource.AddFile (“something”) end
Will that work if i have more files of them?

Thanks!

Yeah, you can just do something like this. Go to garrysmod/lua/autorun/server and create a file called download.lua (it can be called anything but I just call it that to make it easier for me). Inside of this file write something like this:



if (SERVER) then
        resource.AddFile( "materials/VGUI/ttt/icon_something.vmt" );
        resource.AddFile( "models/jaanus/defibrillator/w_defibrillator.mdl" );
        resource.AddFile( "sound/ttt/end round songs/song1.mp3" )
end


If you put for example icon_something.vmt is will also make you download icon_something.vtf. Same with models, if you resource the .mdl it will also download the vvd, phy, etc.

Yeah i know this but can i have multiple of these files, for example; download.lua and something.lua
Because if this file is too big then it doesnt work.

The file can’t be too big, but yes you can have multiple files for that. You either hit your lua limit, or the code is incorrect somewhere.

Would you mind pasting the content of it?

Well, my server was crashing also so i have reset everything, i will do it better now :wink: Thank you for your help anyway!