of     1   

InYo22
#115385328Sunday, October 13, 2013 4:20 PM GMT

As the title may suggest, I am trying to stitch together two sounds seamlessly. Please keep in mind I am a noob at scripting so there might be ((To some of the professionals out there.)) A lot of technical errors. Using an audio editing program I made two 14 second long clips of a song. Now the hard part stitching them together on Roblox. For the sake of simplicity I decided to create a simple click activated sound to test it. Script below. function TheClick(playerWhoClicked) script.Parent.Sound:Play() end script.Parent.ClickDetector.MouseClick:connect(TheClick) Now that just plays one sound clip. I have modified it so it would play two sound clips one after the other. function TheClick(playerWhoClicked) script.Parent.Sound:Play() wait(insert time here) script.Parent.Sound:Play() end script.Parent.ClickDetector.MouseClick:connect(TheClick) Now I thought it would be as simple as that, just insert the wait period the same length as the first audio clip. However Roblox's definition of a second isn't the same as a second the editing program I used for the audio is. So there is a slightly noticeable stop. So I thought of a new way. Have second sound clip play once the first one has ended. So the process in my mind goes like this, again for simplicity's sake the first sound clip will be called SoundA and the second SoundB. Play SoundA, when SoundA is finished playing, Play SoundB. This is where I reach the limit of my scripting knowledge, how to translate this into Lua. So this is where I ask for some help.
EchoReaper
#115386088Sunday, October 13, 2013 4:28 PM GMT

ROBLOX has a property built into sounds that can be used to tell when the sound is done playing. Every single sound has an IsPlaying value. If it is true, the sound is playing, but if it is false, then the sound is not playing. http://wiki.roblox.com/index.php/RBX.lua.Sound_%28Object%29
EchoReaper
#115386204Sunday, October 13, 2013 4:29 PM GMT

Oh, and by the way, in Studio, if you click Help and then Object Browser, you'll get a list of every object in ROBLOX. If you click on an object, it will show you all of its properties, methods, and listener events. It comes in handy a lot.

    of     1