Liberty Unleashed

Scripting => Script Help => Topic started by: [EG]~[S]aha~ on September 28, 2012, 07:44:26 am

Title: Sound help
Post by: [EG]~[S]aha~ on September 28, 2012, 07:44:26 am
you need to do so in this script after spawning music stop


function onScriptLoad()
{
     spawn_Sound <- null;
}

function onClientRequestClass( player )
{
    if ( !spawn_Sound )
    {
         spawn_Sound = FindSound( "welcome2.mp3" );
         if ( spawn_Sound )
         {
              spawn_Sound.Open();
              spawn_Sound.Play();
         
              return 1;
         }
    }
    else
    {
        spawn_Sound.Open();
         spawn_Sound.Play();
      
         return 1;
    }
}
Title: Re: Sound help
Post by: Thijn on September 28, 2012, 09:11:53 am
You want the music to stop when you spawn?
In that case, Add the following:
Code: [Select]
function onClientSpawn( spawnclass )
{
   spawn_Sound.Stop();
   return 1;
}