Is there a way to change the death sound from the regular sound to something else so it replaces it on my server only?
[QUOTE=Shenesis;50989538]Return true in [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerDeathSound]GM:PlayerDeathSound[/url] to mute the default death sound
Play sound using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/EmitSound]Entity:EmitSound[/url] in any death hook ([img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PlayerDeath]GM:PlayerDeath[/url], [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PostPlayerDeath]GM:PostPlayerDeath[/url], [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/DoPlayerDeath]GM:DoPlayerDeath[/url])
(serverside)[/QUOTE]
Thanks! So where do I put all this? Is it a console command or do I put it in the config
[QUOTE=Shenesis;50990109]In a serverside script, in your gamemode, add-on or lua/autorun/server/[/QUOTE]
Could you give me an example of this code?
[QUOTE=deadvcr;50990886]Could you give me an example of this code?[/QUOTE]
[CODE]function GM:EntityTakeDamage(ply, info)
if(ply:Health() < 1) then
ply:EmitSound(string.format("player/death%d.wav", math.random(1, 6)), 100, 100, 1, CHAN_BODY);
end
end
function GM:PlayerDeathSound()
return true;
end[/CODE]
Sorry, you need to Log In to post a reply to this thread.