I'm guessing that your model is doing a looping sound? Here's how I'd do it...

Code:

sound SkelVoiceSND = <Voices.wav>; // The sound file...
var SkelVoiceVol = 200; // Change the volume here!
var SkelVoiceHandle;
//
Action SkelVoices
{
while(1)
{
if (vec_dist(my.x, camera.x) <= SkelVoiceVol * 10)
{
if (snd_playing(SkelVoiceHandle) == 0)
{SkelVoiceHandle = ent_playloop(my, SkelVoiceSND, SkelVoiceVol);}
}
else
{
if (snd_playing(SkelVoiceHandle) == 1)
{snd_stop(SkelVoiceHandle);}
}
wait(1);
}
}



This action will play the sound in a loop while the camera is close enough. It uses camera, instead of player (or whatever), because the camera is what determines the sounds volume and other properties. This action will also stop playing the sound if the camera is out of the range of hearing it. I have not tested this, so it may not work, but it should... I hope.

Anyways, let me know how it goes...

xXxGuitar511...


xXxGuitar511
- Programmer