Quote:
Originally posted by zokemon
Like if you have music playing from a super far distance so it would sound very quiet and you could put a CD player on or something and that would block that out (or if it was quiet enough you could hear the other in the backround)
You could also have this for fading form one song to another
|
That is why play2 exists.

You specify the file to play and the x/y coordinates where it should be played. Something similar can be done with playlooped:
NPC Code:
//#CLIENTSIDE
if (playerenters || timeout) {
playlooped audiofile;
timeout = 0.05;
}
Though I doubt it would work for music unless its saved as a wav file. This little script here is useful for adding ambience like waves hitting the shore. Just specify the sound to loop and pick the spot where the NPC will be and play the level. It will automattically get softer as you move away from the NPC and louder as you get closer.