• I need help with a death sound addon I made, hope this is right thread, I don't understand lua
    14 replies, posted
So recently I thought it would be funny if I replaced the death sound with the death sound of the original Crash Bandicoot, [URL="https://www.youtube.com/watch?v=78KbTXlDrlg"]https://www.youtube.com/watch?v=78KbTXlDrlg[/URL] here's the clip if you wanted to hear it. So then I followed this video, [URL="https://www.youtube.com/watch?v=l8Y6FBV9UQs"]https://www.youtube.com/watch?v=l8Y6FBV9UQs[/URL] it works but only in single player, I wanted to make it work on any multiplayer server if that's possible. So me being stupid I went to the help tab in steam discussions asking for help. Didn't think about coming here until someone told me. He also said "there's a better way to do this" then the way I was doing. Here's a pastebin of what the code is in the lua script: [URL="https://pastebin.com/ZNmcBim8"]https://pastebin.com/ZNmcBim8[/URL] and I also have notepad++ so that should make things slightly easier.
As you can't run lua on all multiplayer servers without them having sv_allowcslua 1. I would probably override the original death sound with your one. What you have to do is to find what sound GMod uses when you die and the path of it. Then create an addon that has a sound with the same name in the same path.
Check for errors in your ingame / server console. You need to make sure the soundfiles are sent to the client, but that should throw an error too.
[QUOTE=Jompe;52499604]As you can't run lua on all multiplayer servers without them having sv_allowcslua 1. I would probably override the original death sound with your one. What you have to do is to find what sound GMod uses when you die and the path of it. Then create an addon that has a sound with the same name in the same path.[/QUOTE] So not sure if i'm just stupid but I go in the common GarrysMod folder and type in sound to try to find the death sound, but I can't find it. Is there a better tool I could use to search for it?
You'll need to manually add the death sound to your client folders. Check the console like I said. If the sound is missing it would have told you.
[QUOTE=Shorthouse06;52500049]You'll need to manually add the death sound to your client folders. Check the console like I said. If the sound is missing it would have told you.[/QUOTE] I just don't know what you mean by client folders, I understand what your telling me to do, but I just can't find the client folders. I feel stupid that I can't find it. Do I need to make one?
Wherever the sound is on the server, you need to put it there on the client too. It's probably something like garrysmod/garrysmod/sound/addonname/filename.wav
[QUOTE=Shorthouse06;52500506]Wherever the sound is on the server, you need to put it there on the client too. It's probably something like garrysmod/garrysmod/sound/addonname/filename.wav[/QUOTE] Wait does it also need to be on the server to work? I wanna make it so only I hear it. Sorry if i'm being stupid.
I'll just summon up everything in a couple of lines: There are various methods of replacing the death sounds. One of them is to just replace the files of the default death sounds as content on an addon. The other one is using actual Lua, by using the hook [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerDeathSound]GM:PlayerDeathSound[/url], but this won't work on servers that have sv_allowcslua on 1, due to inability of running clientside Lua, unless the server has this addon in particular installed. And, those are the two methods I can think of right now.
[QUOTE=geferon;52501065]I'll just summon up everything in a couple of lines: There are various methods of replacing the death sounds. One of them is to just replace the files of the default death sounds as content on an addon. The other one is using actual Lua, by using the hook [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerDeathSound]GM:PlayerDeathSound[/url], but this won't work on servers that have sv_allowcslua on 1, due to inability of running clientside Lua, unless the server has this addon in particular installed. And, those are the two methods I can think of right now.[/QUOTE] Do you know what the directory would be for the default death sounds?
[url]https://facepunch.com/showthread.php?t=1298035&p=41813906&viewfull=1#post41813906[/url] [url]https://facepunch.com/showthread.php?t=891001&p=20116145&viewfull=1#post20116145[/url] Next time try using Google a bit more, please.
[QUOTE=geferon;52501098][url]https://facepunch.com/showthread.php?t=1298035&p=41813906&viewfull=1#post41813906[/url] [url]https://facepunch.com/showthread.php?t=891001&p=20116145&viewfull=1#post20116145[/url] Next time try using Google a bit more, please.[/QUOTE] Thank you and will do. [editline]24th July 2017[/editline] [QUOTE=geferon;52501098][url]https://facepunch.com/showthread.php?t=1298035&p=41813906&viewfull=1#post41813906[/url] [url]https://facepunch.com/showthread.php?t=891001&p=20116145&viewfull=1#post20116145[/url] Next time try using Google a bit more, please.[/QUOTE] I think I might be mentally ill because I just can't get this to work.
[QUOTE=Smorty Smith;52501162]Thank you and will do. [editline]24th July 2017[/editline] I think I might be mentally ill because I just can't get this to work.[/QUOTE] It's actually programmed as [CODE] // medical HEV_DEAD0 hl1/fvox/beep beep, beep beep, beep, beep, flatline {Len 6.29 closecaption HEV.Flatline} [/CODE] though
[QUOTE=Kevlon;52501423]It's actually programmed as [CODE] // medical HEV_DEAD0 hl1/fvox/beep beep, beep beep, beep, beep, flatline {Len 6.29 closecaption HEV.Flatline} [/CODE] though[/QUOTE] Man i'm getting so confused. Like I understand what your saying I just don't know what to do with what your saying.
[QUOTE=Smorty Smith;52501535]Man i'm getting so confused. Like I understand what your saying I just don't know what to do with what your saying.[/QUOTE] Basically when you die the beeps reproduce around 5 times, and then the flatline sound will get reproduced at the end. Thats what he posted about means.
Sorry, you need to Log In to post a reply to this thread.