Jump to content

Play sound when player walks into area


pidgebc

Recommended Posts

I'm wanting to make a sound file play when the player walks into an area. I've already got the sound file imported and in place in Sound Marker and Sound Descriptor categories. What I need is how you make a trigger to play the sound when the player walks into it, and how to set that up.

 

Thanks

Link to comment
Share on other sites

you have to create a trigger box in the CK with a script attached to it(the button that has a box with a T in the middle)

 

For your script:

 

Script Extends Objectreference

Int Prop RunOnce
Sound Prop

Event OnTriggerEnter(ObjectReference akActionRef)
	If(akActionRef == Game.GetPlayer())
	EndIf
	If RunOnce == 0
	Sound.Play (Self)
	RunOnce = 1
	EndIf
EndEvent

If you want the sound to play every time:

 

Script Extends ObjectReference

Sound Prop

Event OnTriggerEnter(ObjectReference akActionRef)
	If(akActionRef == Game.GetPlayer())
	Sound.Play (Self)
	EndIf
EndEvent
Edited by morrowind1979
Link to comment
Share on other sites

  • Recently Browsing   0 members

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