Jump to content

Using sound in script.


spikensbror

Recommended Posts

There is a script that allows notes to be played while hacking the computer inside Tranquillity Lane. You might check that out for ideas.

 

Otherwise, first of all, don't select a sound that loops.

 

If you add a DoOnce type of placemarker you can get the sound to play just one time and stop, else it will contine to play once the conditions of the script have been met. As an example, a script that could be attached to a triggerbox:

 

scn SoundAlarmSCRIPT

short DoOnce

Begin OnTriggerEnter Player

 if DoOnce == 0
	  PlaySound OBJBuzzerBell
	  set DoOnce to 1
 endif
End

Begin OnTriggerLeave Player

 Set DoOnce to 0

End

 

The first bit plays the bell sound one time. The second bit resets the DoOnce so that the alarm will sound if the trigger is entered again.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...