Downloading files to a certain directory

Well, as you can probably tell I’m new at making Garry’s Mod servers. I got the sound that I wanted to download to actually download, but I have no idea where it downloads to. I need it to download into the client’s sound folder. The only thing that I have done concerning this is add sound/trawon1.wav into the ULX downloads.txt file. How can I set up a directory for the file to go to?

;ATTENTION! /ADDONS/ulx/data/ulx/<this file> is a DEFAULT file. DO NOT EDIT THE /ADDONS/ULX/DATA/ULX FOLDER FILE!!!
; Instead, edit the version in <garrysmod root>/data/ulx/ if it exists. If it doesn’t, copy this file to <gmod root>/data/ulx/ to create it.
; You can add forced downloads here. Add as many as you want, one file or
; folder per line. You can also add these to your map- or game-specific files.
; You can add a folder to add all files inside that folder recursively.
; Any line starting with ‘;’ is a comment and WILL NOT be processed!!!
; Examples:
;sound/cheeseman.mp3 <-- Adds the file ‘cheeseman.mp3’ under the sound folder
;sound/my_music <-- Adds all files within the my_music folder, inside the sound folder
sound/trawon1.wav

What I do is based on the file (lua) that is going to be using that sound, I then add these lines:

if SERVER then
resource.AddSingleFile(“sound/trawon1.wav”)
end

Obviously not the same sound file, but that will force-download that file for the player. Also make sure your server files are websyncd.

That didn’t change anything, the file still doesn’t download to the right directory. I’m trying to get the file to download to someone’s C:\Program Files (x86)\Steam\steamapps
ame\garrysmod\garrysmod\sound folder

It’s not going to. All files now go to a downloads folder.

downloads/sound/yourstuffgoeshere

The file doesn’t download to downloads/sound/

Then your file is not being downloaded correctly and you’re doing something wrong.

Don’t be putting it into any ulx config. Go to lua/autorun/ || create a lua file for there labelled forcedownloads

Then in that file do this


if SERVER then
resource.AddSingleFile("sound/filepathoritemhere")
end

That will work.

The file downloads but when I try playing the sound it’s not working and the file doesn’t go to my downloads folder. Are you able to help me over teamviewer? I’d be very grateful. Thanks for trying to help me so far

Yes, I can. Add Nookyava on steam. We’ll sort this out.