//INSTRUCTIONS: rename the script file to the name of your map, and place it in the same directory as your map. //Along with your door, set up a nodraw brush, and convert it to atdm:mover_button. //Create 2 atdm:target_callscriptfunction entities. give one a "call" "stateChange" key/val pair, //and the other "call" "stateCheck". Give both your door and button a "target" spawnarg, and assign the value //for it with the names of your atdm:target_callscriptfunction entities. //the door target should correspond with the script entity with "call" "stateChange", and the button with the other. //Make sure your door has spawnargs "trigger_on_close" "1", "trigger_on_open" "0", and "trigger_when_opened" "1". //change the value of "snd_lockpick_pin_14" spawnarg of your door to the sound that you desire. (and make sure that your locks don't use pin14). //set a "frob_peer" spawnarg on your door with the name of your button as its value. //you are done! note: additional functionality to stop the sound if door closing is interrupted may be added later :) float doorState = 0; float k = 0; void stateCheck() //trigger with button only { if(doorState && !k) { $my_door.startSound( "snd_lockpick_pin_14", 0, 1 ); k++; } } void stateChange() //trigger with door only { if($my_door.IsOpen()) { doorState = 1; k = 0; } else doorState = 0; }