UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Stop a looping sound in mp

broken avatar :(
Created 6 years ago
by Gunrock12
0 Members and 1 Guest are viewing this topic.
687 views
broken avatar :(
×
broken avatar :(
Location: usIndiana, Indianapolis
Date Registered: 19 October 2014
Last active: 5 years ago
Posts
23
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Gunrock12's Groups
Gunrock12's Contact & Social Links
I have two triggers both looping while the players stand it. one starts the music while the other trigger stops it

while the player stands in it. The problem is once the player stands in the stop looping sound second trigger the music keeps on playing.
How do i get the music to stop playing in the second trigger the player stands in?






function soundbox1()////////PLAYS SOUND LOOP WHILE PLAYER IS IN THE TRIGGER


{

 
soundbox1_trig = GetEnt("area_sound1", "targetname");


soundbox1_trig waittill("trigger");



players = GetPlayers();

for (i = 0; i < players.size; i++)

              

   

   

while(1)

   
{

       

       

 while(!(players istouching(soundbox1_trig)))

       

           

           

wait 0.5;

       

       

       

           

           
 iprintlnbold("playing sound");

           
players PlayLoopSound( "jack" );

           

           

wait 8;

       

   
}
 
}








function soundbox1_stop()////////STOPS SOUND LOOP WHILE PLAYER IS IN THE TRIGGER


{


soundbox2_trig = GetEnt("area_sound2", "targetname");


soundbox2_trig waittill("trigger");



players = GetPlayers();

for (i = 0; i < players.size; i++)

              

   

   

while(1)

   
 {

       

       

 while(!(players istouching(soundbox2_trig)))

       

           

           

 wait 0.5;

       

       

       

           

           

iprintlnbold("stoping sound");

          
players StopLoopSound( "jack" );/////////THIS DOSEN'T WORK SOUND STILL PLAYS!

           

           

           

wait 8;

       

   
}

}



 
Loading ...