Gamemode content folder?

I’m pretty sure that I’m doing this correctly:

Lets say you have these directories in your gamemode, containing example.wav

examplegamemode/content/sound/example.wav

Now if you wanted to add this as a resource you would use
[lua]resource.AddFile("sound/example.wav")[/lua]
That SHOULD work, right? It returns:

[resource.AddFile] File 'sound\example.wav' didn't exist!

I’ve done it before so why isn’t this working now?

Are you sure you’ve got the names right? Also make sure it’s running under the server, (init.lua)

Definitely triple check the names of everything, including folder, and sound file.

100% sure the names of everything are correct. Someone on steam told me that the content folder doesn’t work properly… can anyone confirm this?

I use the content folder for gamemodes all the time, so I don’t know what the circumstances have to be for the content folder not to work.

I’ve used it before as well, however theres been another time where I had the same problem and never figured it out.

Are you sure it’s being run on the server?

How else would it be telling me it doesn’t exist?

If you didn’t call it on the server.

It can only be called on the server.

resource.AddFile( “examplegamemode/sounds/content/example.wav” )

Maybe you have to include the entire path?

I have had this problem before and it was that it was reading the content folder of a different gamemode (go figure). So browse through your folders and put the song in every single content folder you can find and find out which one it is trying to read from.

I did a test and I can call the function through shared.lua causing it to error about missing file.

Did you restart the server/game each time? not a change map, a full restart of the gamemode. I had to do that during this test.

fuck.