View unanswered posts | View active topics It is currently Thu Dec 26, 2024 3:51 am



Reply to topic  [ 4 posts ] 
 I need a simple lua script for sound control 
Author Message
User avatar

Joined: Fri Jan 11, 2013 6:28 am
Posts: 29
Reply with quote
Post I need a simple lua script for sound control
I want a lua script that plays a sound when an actor is spawned and shuts it off when that specific actor dies, but can check to see if the sound is already playing as to not play it more than once if more than one actor is spawned, and shuts off when the original one dies.

So like check>>>actor spawned>>>play>>>> if other actor spawned>>>>check if song already played>>> do not play if already played>>>> if actor dies turn off song>>> no idea


eehhhhheh


Wed Jan 16, 2013 7:41 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: I need a simple lua script for sound control
Do you plan to have this as background music or sound-effect like? If you're going for sound effect, using an emitter with your sound as the burst sound effect will play the entire sound even when the emitter dies, and you can just have a variable to change when you add the emitter.

If you're going for background music, same concept, just use the function that changes the music.


Wed Jan 16, 2013 9:40 pm
Profile
User avatar

Joined: Fri Jan 11, 2013 6:28 am
Posts: 29
Reply with quote
Post Re: I need a simple lua script for sound control
CaveCricket48 wrote:
Do you plan to have this as background music or sound-effect like? If you're going for sound effect, using an emitter with your sound as the burst sound effect will play the entire sound even when the emitter dies, and you can just have a variable to change when you add the emitter.

If you're going for background music, same concept, just use the function that changes the music.


Oh you can control both using lua???

Basically I wanted it to be a surprise but I'm trying to create a walking boombox that shoots single shot weapons and when shot these weapons play a sound that would be a whole song.


Wed Jan 16, 2013 10:20 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: I need a simple lua script for sound control
Just have the script on the actor that watches whether or not if it fires, and control the emitter spawning appropriately.


Sat Jan 19, 2013 2:59 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.034s | 14 Queries | GZIP : Off ]