Modme Forums
Menu:

Sound plays when a door/debris is opened?

Game Modding | Call of Duty: Black Ops 3 | Scripting


BruhMomentum:

Hi,

I want a sound to play in my map when a door/debris is opened. I have the sound set up in my user_aliases file and I have met all of the requirements for the file (.wav, 48000hz). How would I make this sound play when a door/debris is bought and opened? Is it a KVP setting?


dakh:

Hi,

I want a sound to play in my map when a door/debris is opened. I have the sound set up in my user_aliases file and I have met all of the requirements for the file (.wav, 48000hz). How would I make this sound play when a door/debris is bought and opened? Is it a KVP setting?

In your gsc file's main function

Level thread play_door_open_sound ("zone_name", "sound_you_choose"); 



And at the bottom

function play_door_open_sound( flag, sound )
{
    ents = GetEntArray( flag, "script_flag" ); 
    level flag::wait_till( flag ); 
    // iprintlnbold( "^2PlaySound" );
    PlaySoundAtPosition( sound, ents[0].origin ); 
}


BruhMomentum:

In your gsc file's main function

Level thread play_door_open_sound ("zone_name", "sound_you_choose"); 



And at the bottom

function play_door_open_sound( flag, sound )
{
    ents = GetEntArray( flag, "script_flag" );
    level flag::wait_till( flag );
    // iprintlnbold( "^2PlaySound" );
    PlaySoundAtPosition( sound, ents[0].origin );
}

Awesome thanks so much!


Spiki:

i dont this this will work
for one it should be

Level thread play_door_open_sound ("flag_name", "sound_you_choose");

this
PlaySoundAtPosition( sound, ents[0].origin ); 
will play a 3d sound at the first door in the array not the one you opened


check this out. Same question


BruhMomentum:

i dont this this will work
for one it should be
Level thread play_door_open_sound ("flag_name", "sound_you_choose");

this
PlaySoundAtPosition( sound, ents[0].origin ); 
will play a 3d sound at the first door in the array not the one you opened


check this out. Same question

I got it all sorted out, thank you anyway though :)