Jump to content

Need help makeing a script.


Cordedstraw

Recommended Posts

I am trying to make a sound trigger script. I was trying to make it as when you enter a room a audio plays and then activates another audio trigger in another room but if enter the room that had the other audio it wont play until you trigger the first one. If anyone know how to make a script like that if you can please can send or post the script.

 

Thank you :biggrin:

Link to comment
Share on other sites

Try this, this is pretty basic so PM if you any questions.

 

This script can be attached to one activator, then you can link the activators in the order you want them to fire off in. Make sure to make them persistent references or the scripts will fail. Also, give a name to the first (master) activator reference for this to work.

 

int iStep

short bDoOnce

ref rLinkedREF (SecondTriggerREF)

ref rSelf (FirstTriggerREF)

 

Begin OnTriggerEnter Player

 

if iStep 0

if bDoOnce 0

set.rSelf to GetSelf

set.rLinkedREF to GetLinkedREF

set bDoOnce to 1

else if bDoOnce 1

if rSelf FirstTriggerREF

PlaySound WPNSniperRifle2D (This is how it'll look, just replace it with the sound you desire)

rLinkedREF.Activate

set iStep to 1

else

;Do Nothing

endif

endif

elseif iStep 1 (This is only valid after the first activator has been tripped by the player and the first trigger sets off the next.)

PlaySound WPNSniperRifle2D

endif

End

 

Like I said that is basic and may not work right off the bat, so PM if you need any further help.

Link to comment
Share on other sites

Try this, this is pretty basic so PM if you any questions.

 

This script can be attached to one activator, then you can link the activators in the order you want them to fire off in. Make sure to make them persistent references or the scripts will fail. Also, give a name to the first (master) activator reference for this to work.

 

int iStep

short bDoOnce

ref rLinkedREF (SecondTriggerREF)

ref rSelf (FirstTriggerREF)

 

Begin OnTriggerEnter Player

 

if iStep 0

if bDoOnce 0

set.rSelf to GetSelf

set.rLinkedREF to GetLinkedREF

set bDoOnce to 1

else if bDoOnce 1

if rSelf FirstTriggerREF

PlaySound WPNSniperRifle2D (This is how it'll look, just replace it with the sound you desire)

rLinkedREF.Activate

set iStep to 1

else

;Do Nothing

endif

endif

elseif iStep 1 (This is only valid after the first activator has been tripped by the player and the first trigger sets off the next.)

PlaySound WPNSniperRifle2D

endif

End

 

Like I said that is basic and may not work right off the bat, so PM if you need any further help.

Thank you my kind Sir.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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