Custom Death Sound

I have this but i get this error.

Hook ‘playerDeathTest’ Failed: Hunt/gamemode/init.lua:107: attempt to index global ‘surface’ (a nil value)

[lua]/---------------------------
Disable Death Sound
---------------------------
/

function OverrideDeathSound()
return true
end
hook.Add( “PlayerDeath”, “playerDeathTest”, playerDies )

/---------------------------
Custom Death Sound
---------------------------
/

function playerDies( victim, weapon, killer )

surface.PlaySound( "NESKill.wav" )

end

hook.Add( “PlayerDeath”, playerDies )[/lua]

PlayerDeath is a serverside Hook, surface is a clientside Library.

[lua]/---------------------------
Disable Death Sound
---------------------------
/

function OverrideDeathSound()
return true
end
hook.Add( “PlayerDeath”, “playerDeathTest”, playerDies )

/---------------------------
Custom Death Sound
---------------------------
/

function playerDies( victim, weapon, killer )

victim:SendLua("surface.PlaySound( \"NESKill.wav\" )")

end

hook.Add( “PlayerDeath”, playerDies )[/lua]

Not guaranteed, but try it anyways.

Thanks it worked

Well it works sometimes most of the time it doesnt play.

Also am trying to make a respawn sound i have this they is no errors it just doest play.

[lua]function playerRespawn( ply )

victim:SendLua("surface.PlaySound( \"NESHit1.wav\" )") 

end

hook.Add( “PlayerSpawn”, playerRespawn )[/lua]