

Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() Oil Rig Beta Access |
main()
{
playsound = getEntArray( "playsound", "targetname" );
for( i = 0; i < playsound.size; i++ )
{
playsound[i] thread play_loop_sound();
}
}
play_loop_sound()
{
while( 1 )
{
players = get_players();
player_touching = false;
for( i = 0; i < players.size; i++ )
{
if( players[i] isTouching( self ) )
{
player_touching = true;
players[i] playLoopSound( "tzp_generator_loop" ); // name of sound
while( player_touching )
{
if( !players[i] isTouching( self ) )
{
players[i] StopLoopSound();
player_touching = false;
break;
}
wait( 0.5 );
}
}
}
wait( 0.5 );
}
}
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
while( player_touching )
{
if( !players[i] isTouching( self ) )
{
players[i] StopLoopSound();
player_touching = false;
break;
}
wait( 0.5 );
//replace that while loop with self thread TouchingMe(player);
TouchingMe(player){
player endon("disconnect");
while( player isTouching( self ) )
{
wait( 0.5 );
}
player StopLoopSound();
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() Oil Rig Beta Access |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() Oil Rig Beta Access |
Yeah hes right, buried somewhere deep in the cod code that im yet to find is a stopLoopedSound() on player ( by the sounds of it - in the grenade throw function )
this is probably used for cleaning up left over sounds, i guess they never wanted us to use "player" for sounds directly ( This is why my craftables sounds stopped working once, took me ages to work out why coz "just coz" wasnt acceptable lol )
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
![]() BO3 Modtools Alpha | This user has access to the Black Ops 3 Modtools Alpha |
i remade the script so it doesn't loop constantly anymore and to fix that issue with nades and switching weapons i...
instead of
players playLoopSound( "tzp_generator_loop" );
i added,
sound = spawn("script_origin", self.origin);
mysounds(sound);
then to stop the sound,
sound StopLoopSound();
with what im trying to do thats the only way i got it to work without bugs