Get users to download files?

I’ve had this problem recently where players aren’t downloading models when they join. Is there a script that makes players download files before joining?

For example, if I had a models/player/model.mdl file how would I get users to download that when they join?

Yes, I do have everything on FastDL.

resoucre.AddFile

Ma ka olen Eestist! (;

I’m a lua noob so how would I set it up?

[lua]resource.AddFile(“path/to/file.ext”)[/lua]

on server.

Would this be for client or server?

/facepalm nevermind.

To avoid future questions, create a new file called “downloads.lua” (can be anything, but extension .lua). Place it in lua\autorun\server\ and add:

[lua]
resource.AddFile(“Path”)
[/lua]

for each model.

Still not working. This is the way I have downloads.lua setup in lua/autorun/server.

[lua]
if SERVER then
resource.AddFile(“models/models/player/agent_47.dx80.vtx”)
resource.AddFile(“models/models/player/agent_47.dx90.vtx”)
resource.AddFile(“models/models/player/agent_47.mdl”)
resource.AddFile(“models/models/player/agent_47.phy”)
resource.AddFile(“models/models/player/agent_47.sw.vtx”)
resource.AddFile(“models/models/player/agent_47.vvd”)
end
[/lua]

You only need to enter the .mdl by the way. All other stuff is added automatically. The files must be both on your server and fastdl server, in the root folder, not in addons.

As well, you need to set up the material files for the model this way as well or else it’ll showed up completely untextured.

if it is placed in lua/autorun/server it doesnt need if SERVER then cause it is always loaded as serverside

I figured it out I just had the path wrong.

Thanks for the help guys.