I'm trying to make a script that will play a sound for and only for the person that kills someone, if you know how to do this / have an example then i'd appreciate info, i can't find anything on the wiki
Use this: [url]http://wiki.garrysmod.com/?title=Gamemode.PlayerDeath[/url]
In conjunction with:
[code]player:SendLua( "surface.PlaySound( \"soundfile.wav\" )" )[/code]
actually, I want something a bit different, and I know this won't work but i'm just giving an example, can any kind sir or madame help me?
[lua]function playerDies( victim, weapon, killer )
killer:DoSound()
end
hook.Add( "PlayerDeath", "playerDeathTest", playerDies )
local function DoSound( ply, snd, num )
if ValidEntity(ply) then
ply:EmitSound("", 100, 100)
end
end
end[/lua]