Resource.addfile Fastdownload Help

So, I’ve had this problem for some time and I’ve still not been able to fix it.
I created a file called ‘downloads.lua’ and I placed it into my lua/autorun/server folder. I did it both for the server, and the fastdownload link.

The file reads,

[lua]

resource.AddFile(“addons/VehicleUpgrade/lua/autorun/Nova_vehicles.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/vehicles_overide.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/VehicleScript.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/client/ClientVehicleScript.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/entities/vu_headlight/cl_init.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/entities/vu_headlight/init.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/entities/vu_headlight/shared.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/materials/VGUI/entities/airboat(VU).vmt”)
resource.AddFile(“addons/VehicleUpgrade/lua/materials/VGUI/entities/airboat(VU).vtf”)
resource.AddFile(“addons/VehicleUpgrade/lua/materials/VGUI/entities/airboat_seat.vmt”)
resource.AddFile(“addons/VehicleUpgrade/lua/materials/VGUI/entities/airboat_seat.vtf”)
resource.AddFile(“addons/VehicleUpgrade/lua/materials/VGUI/entities/jalopy(VU).vmt”)
resource.AddFile(“addons/VehicleUpgrade/lua/materials/VGUI/entities/jalopy(VU).vtf”)
resource.AddFile(“addons/VehicleUpgrade/lua/materials/VGUI/entities/jalopy_seat.vtf”)
resource.AddFile(“addons/VehicleUpgrade/lua/materials/VGUI/entities/jalopy_seat.vmt”)
resource.AddFile(“addons/VehicleUpgrade/lua/materials/VGUI/entities/Jeep(VU).vmt”)
resource.AddFile(“addons/VehicleUpgrade/lua/materials/VGUI/entities/Jeep(VU).vtf”)

[/lua]

Whenever a player joins, it doesn’t look like it downloads the files. The player can see the models(probably becasue VU mod is built with hl2 standard models) but cannot spawn them.

How can I fix it so they download and show up on the vehicle spawn menu. This is for normal sandbox btw.

Thanks.

…Install VU Mod on the server?..

please remove the:

resource.AddFile(“addons/VehicleUpgrade/lua/autorun/Nova_vehicles.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/vehicles_overide.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/VehicleScript.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/client/ClientVehicleScript.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/entities/vu_headlight/cl_init.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/entities/vu_headlight/init.lua”)
resource.AddFile(“addons/VehicleUpgrade/lua/autorun/entities/vu_headlight/shared.lua”)

you dont have to add the Lua files

Yes it is, people who have the mod can spawn the props fine, but whenever someone doesn’t have it, It doesn’t show up in the vehicles tab. I want it so that they can download it from the server and see it in the vehicles tab. Last time I had this problem I had a vehicle store and only people with the mod could buy the certain car. So :expressionless:

Edit:
Just removed the lua files as well.

it have never popped up the vehicles tab for me either

Well this issue occurs when I add other vehicles as well, not just mods. Say I added a golf gt, only people with the mod could see it, even after downloading it from the server.

Copy the addon content into the garrysmod root dir, and start the AddFile paths from models/ and materials/. If you use resource.AddFile() with the addon, the client will inherit the same dir structure, but of course, the addon won’t load, as it has no info.txt.

[lua]
local initialdir = nil
function GenRes( dir )
print( “Generating resource adds” )
initialdir = dir
GenResFolder( dir )
print( “Resource adds loaded” )
end

function GenResFolder( dir )
if string.find( dir, ‘lua’ ) then
return
end

if file.IsDir( dir ) then
	for k, v in pairs( file.Find( dir .. "*" ) ) do
		if file.IsDir( dir .. "/" .. v ) then
			GenResFolder( dir .. v .. "/" )
		else
			print( "Adding resource: " .. string.Replace( dir .. v, initialdir, "" ) )
			resource.AddFile( string.Replace( dir .. v, initialdir, "" ) )
		end
	end
else
	print( "Invalid start folder" )
end

end

GenRes( "…/addons/VehicleUpgrade/lua/materials )
[/lua]