Headshot/double kill/ blah blah blah sounds :)

I want to make a sound play when people get a headshot or a double kill, where can I find sounds that say “HEADSHOT” or “DOUBLE KILL” and stuff like that

Are you asking us where you can find sounds that do not relate to lua at all?

those are quake sounds FYI, you can find them on gmod.org search unreal sounds

I was gonna ask how to play the sounds with lua after I found the sounds -_-

Search?

http://luasearch.overvprojects.nl/?keywords=Play+Sound

Brings up surface.PlaySound straight away.

forgot about lua search thanks !

[editline]27th December 2010[/editline]

how would you play a sound on everyone’s client?

[lua]
for k,v in pairs(player.GetAll()) do
v:SendLua(“surface.PlaySound(‘buttons/button10.wav’)”)
end
[/lua]

Untested but will probably work.

That’s such a stupid method.

[lua]
– serverside

function _R.Player:SendSound(soundid)
umsg.Start(“PlayMySound”, self)
umsg.Char(soundid)
umsg.End()
end

function SendSoundToAll(soundid)
for _, ply in pairs(player.GetAll()) do
ply:SendSound(soundid)
end
end

– clientside

DMGSOUNDS = {}
DMGSOUNDS[1] = Sound(“mysound/headshot.wav”)
DMGSOUNDS[2] = Sound(“mysound/dblkill.wav”)

usermessage.Hook(“PlayMySound”, function(um)
local soundid = um:ReadChar()
surface.PlaySound(DMGSOUNDS[soundid])
end)
[/lua]