local sounds = {"sounds/headshot1.mp3","sounds/headshot2.mp3","sounds/headshot3.mp3",}
headshot = true
function Sound(killer,_,bodypart)
if not headshot then
headshot = nil
else
if bodypart == 9 and getElementData(source,"zombie") and localPlayer == killer then -- aca comprueba que la muerte sea por headshot , que el ped sea un zombies y que el que mato al ped sea el jugador local
sound = sounds[math.random(1, #sounds)] -- aca se escoje el sonido al azar de todas las opciones del inicio
soundvolume = playSound(sound) setSoundVolume(soundvolume,0.5)
end
end
end
addEventHandler("onClientPedWasted",root, Sound)
function ActivarDesactivar()
if not headshot then
headshot = true
outputChatBox("Sonidos del Headshot activados.", 0, 255, 0)
else
headshot = nil
outputChatBox("Sonidos del Headshot desactivados.", 255, 0, 0)
end
end
addCommandHandler("headshot",ActivarDesactivar)
-- Hacer una funcion con un if de /headshot | para desactivarlo y activarlo