Hi, I've been trying to setup some end round music for my purchased dedicated gmod TTT server and have been using this addon to do so:
https://steamcommunity.com/sharedfiles/filedetails/?id=125659070&searchtext=ttt+music
But i have run into some issues setting it up as the page doesn't really explain it clearly enough for someone who has next to zero experience in coding. Anyhow the main issue i'm running into seems to be the following message which appears in console at the end of a round (when the music is meant to play): Failed to load sound "yourmusic.whatever", file probably missing from disk/repository
I would like an answer so I'm going to try to be as detailed as possible here as i describe how I have set it up.
So as for the File Location/File Path I have put a folder containing the addon's .lua file in the following location on my servers files. Lua /Autorun. In the autorun folder I have placed the folder (named endroundmusic) for the addon. The file path within the addon file is as follows. lua/ autorun/luafilehere (named endofround).
The workshop page tells you to place the music you want within my garrysmod/sounds folder. I did not have a sounds folder on my personal computer nor on the servers files. So I made one and put it on the server. Within this folder I made one more folder named endround and I placed all 3 music files I want to play within that. The music files are all 15 second clips saved as 44100hz, 16 bit .wav files. As directed by a guy in the comments of the workshop page.
It should also be noted that I have uploaded the files to fastDL so that should not be a problem either. Now, as for the juicy code.
I have slightly edited the .lua, entering the names of the songs I want to play when the round ends. The code within the .lua file reads as follows.
resource.AddFile("sound/endround/dustendround.wav")
resource.AddFile("sound/endround/blizzardendround.wav")
resource.AddFile("sound/endround/sailendround.wav")
local function PlayMusic(wintype)
if wintype == WIN_INNOCENT then
BroadcastLua('surface.PlaySound("endround/dustendround.wav")')
elseif wintype == WIN_TRAITOR then
BroadcastLua('surface.PlaySound("endround/blizzardendround.wav")')
elseif wintype == WIN_TIMELIMIT then
BroadcastLua('surface.PlaySound("endround/sailendround.wav")')
end
end
hook.Add("TTTEndRound", "MyMusic", PlayMusic)
Anyhow, I have provided all the information I can. But I will also include a few images of filepaths just to clear up potential confusion. Heres hoping some kind fellow will help me, and thank you in advance
https://files.facepunch.com/forum/upload/253414/aa8232b6-ced5-4b1b-8108-74b6c3a5c541/image.png
https://files.facepunch.com/forum/upload/253414/6f736b67-f04f-4e4c-8b75-d258877869dc/image.png
https://files.facepunch.com/forum/upload/253414/8bf0e037-2ff1-461b-a762-6926f58941b4/image.png
er, bump
Add
resource.AddFile("sound/endround/dustendround.wav")
resource.AddFile("sound/endround/blizzardendround.wav")
resource.AddFile("sound/endround/sailendround.wav")
in lua/autorun/server save it as fastdl.lua or w/e name works for you
Restart your server.
I placed a .lua file containing the suggested code in lua/autorun/server and it doesnt work :/ As for the workshop suggestion, uploading a file to a workshop seems like a difficult process. I have tried to upload to workshop though and have run into other isssues in the process of uploading.
Any idea why this didnt work?
https://files.facepunch.com/forum/upload/253414/76078b03-3c0b-43e8-8a21-a350b4a6593e/image.png
Glad to hear!
Sorry, you need to Log In to post a reply to this thread.