I am trying to add a Jihad bomb to my TTT server and when it is equipped it doesn't play any sound. I was troubleshooting and believed that the problem was that the sound was no being force downloaded by people joining.
Currently I am adding the sounds to the gamemodes/terrortown/content/sound/ folder. I am using the ULX playsound option in the menu to test to see if the sound is working. Right now it identifies the .wav file and says it played but no sound comes out.
I am trying to make people force download the sounds by adding this file to the lua/autorun/server/ folder
if (SERVER) then
resource.Addfile("siege/testsound.wav")
resource.Addfile("gamemodes/terrortown/content/sound/siege/testsound.wav")
end
I've got all these in there but none of them work. Also the code I have in the jihad lua file is this:
if ( SERVER ) then
timer.Simple( 2, function() self:Asplode() end )
if self.Owner:PS_HasItemEquipped("testsound") then
self.Owner:EmitSound("siege/testsound.wav")
else
self.Owner:EmitSound("siege/jihad.wav")
end
end
end
Formatting is a little off with the code but you get the point
Put it in /garrysmod/sound instead
So I didn't have a sound folder so I created my own and put the sound in there. I added this to the forcedownload file
resource.Addfile("sound/testsound.wav")
but when I play the sound it still has no sound
Also I have tested the sounds with ULX and it shows that the sound exists and when it plays nothing happens so It is something to do with downloading the sound to the client
[url]http://wiki.garrysmod.com/page/Entity/EmitSound[/url]
"It is recommended to use sound scripts ( see sound.Add ) over direct file paths. There are many inconsistencies, especially when the sound is played on a Weapon"
This could be the cause of your problem
if (SERVER) then
sound.Add( {
name = "testsound",
channel = CHAN_WEAPON,
volume = 1.0,
level = 80,
pitch = { 95, 110 },
sound = "sound/testsound.wav"
} )
end
So I put this in and it still doesn't download the sounds, when I play the sounds using ULX is says it exists but no sound comes out
Sorry, you need to Log In to post a reply to this thread.