Hello - so, does anyone know how to script a sound to spawn upon a switch activation, and then play for a few seconds, then despawn? I want it to be a one-time event on my Delta Relic (work in progress) map so when you activate the teleports the monk chanting sound comes on for around 15 seconds, then disappears for the rest of the game. I know how to get the sound to spawn upon activating the switch via a sent message, but I don't know how to get the sound to despawn after a set time. Any help would be much appreciated; thanks! =D
Set up an external object timer. Aka spawn olive the pig, or the whale, or whatever. Alpha is the message that is being sent to trigger the spawn of the FX (interchangeable, just stay consistent.) Bravo is the message the FX receives to despawn (interchangeable, just stay consistent.) Set the object up like this script wise [On Message=Alpha][Despawn] [On Spawn][Message Send=Bravo] Object settings: Respawn- On timer=15 Then for the FX your scripts should be: [On Round Start][Despawn] [On Message=Alpha][Spawn] [On Message=Bravo][Despawn] This should fix your issue, P.S. Make sure the button can only be interacted with once. If you need help with that, i can further detail that if need be.
yeah the button I have can be activated more than once, but the teleports on my map work fine and once they spawn in, they're there to stay.
You can use a power channel in place of alpha with nothing turning it back off. Another option is simply setting a script to despawn the button on interaction or when the dummy script object despawns.
Set a new script on the timer object to turn on power charlie when it despawns. Then make the on message alpha despawn script a multi function script that requires charlie to be off along with alpha message. So the object timer will look like this instead. [On Message/Power Multi (MIN REQUIRED 2)=Message Received: Alpha, Power: Charlie Off][Despawn] [On Despawn][Power Set: Charlie On] [On Spawn][Message Send=Bravo] Object settings: Respawn- On timer=15 This should make it so the first button press of the game will be the only thing to trigger the FX. Once the button is pressed the first time the "lock" flicks on and there is no way to turn it off. EDIT: If you want the button to go away after that, you could throw a script on it to despawn the button when charlie turns on.
If you're using an invisible switch it won't work unfortunately. Invisible switches can't be spawned/despawned.