I can not get my server so that it sends the file to the client.
I poured on some server models, but when you connect customers do not download from the server model.
What can I do that the server would send files to clients!?
Thanks in advance!
[ERROR] lua/autorun/download.lua:1: attempt to index global ‘resource’ (a nil value)
- unknown - lua/autorun/download.lua:1
It is a serverside only function. Put it into lua/autorun/server/*
Put a fastdl.lua file into lua/autorun/server and add your files by adding resource.AddFile(“filepath”) and do that for all files or resource.AddWorkshop"(CollectionID")
Don’t misinform, resource.AddWorkshop doesn’t work for collections.
It seems to work for my server just fine
Can’t be unless Garry fixed it in the 14.12.2013 patch ( or whatever it was ), which I don’t think he did.
My mistake. It was the Workshop Id for one file not the collection ID
These models do not appear in the game!
[editline]18th December 2013[/editline]
Firstly, resource.AddFile automatically adds related files so your code can be reduced down to
resource.AddFile("materials/models/vinrax/scp/scp-049_clothing_diffuse4.vmt") resource.AddFile("materials/models/vinrax/scp/scp-049_mask_diffuse5.vmt") resource.AddFile("models/vinrax/player/scp049_player.mdl") resource.AddFile("models/vinrax/weapons/c_arms_scp049.mdl")
Secondly, have you synced these files with your FastDL server, and are they packed in .bz2 files?
resource.addworkshop (“ID HERE”)
He’s not using workshop for the last time. That’s not even correct anyways.
Me to the main expansion in Lua config to add the extension .Bz2 ???
Misunderstood, I meant are all the files on your FastDL packed in .bz2’s? Your code is fine.
No you don’t have to add the extension .bz2 to the code. Just add what code_gs said to lua/autorun/server and sync your FastDL.