generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How to play song

Previous Thread :: Next Thread 
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
05 Sep 2014 05:13 PM
How would I play another audio after another one finishes? Can I even?
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
05 Sep 2014 05:14 PM
Yes you can even.
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
05 Sep 2014 05:34 PM
how?
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 05:37 PM
Yeah bud. Ok. SO say the first song is named song1 and is in workspace ok? I will make a script for a loop.

while true do
workspace.song1:play()
wait(10) ---------------Make this number be how long the song is in seconds (yes u have to count)
workspace.song1:pause()
workspace.song2:play()
wait(10) --------------find the length again
workspace.song2:pause()
end
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Sep 2014 05:39 PM
im not going to define things for you, if you dont know how, then give up whatever you're trying.

sound1:Play();
repeat wait() until sound1.IsPlaying == false;
sound1:Pause();
sound2:Play();
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
05 Sep 2014 05:39 PM
Thx guys, the is playing will definitely help! <3
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 05:41 PM
np and mine is better ver \_/
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Sep 2014 05:42 PM
yours assumes the owner knows exactly how long the audio is.
mine doesn't.
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 05:46 PM
true...but...doesnt take a genius to count seconds on a clock :D


Cheesecake
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Sep 2014 05:48 PM
go count 9.67 seconds for me and ill give you a cookie.
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 05:53 PM
1,2,3,4,5,6,7,8,9,9.67....DONE.lol
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
05 Sep 2014 06:16 PM
Wait, how will I make one of these audio play after one finishes?

a = math.random(1, 4)
if (a == 1) then
game.Workspace.Songs.Believer:Play()
end

if (a == 2) then
game.Workspace.Songs.Downwat:Play()
end


if (a == 3) then
game.Workspace.Songs.Happy:Play()
end

if (a == 4) then
game.Workspace.Songs.Snowman:Play()
end
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 06:18 PM
hmmm. add a while true do I think. Also, the songs will not stop playing....as in you will have multiple songs playing at once.
Report Abuse
donovanisawesome is not online. donovanisawesome
Joined: 18 Aug 2010
Total Posts: 548
05 Sep 2014 06:21 PM
I have added a while true do once, but predicting the future, I did a save before I run it, because, of course, it crashed my studio... So that wont work :L
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 06:26 PM
while true do i just a loop
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
05 Sep 2014 06:34 PM
It crashed because there is no type of waiting there.

In both examples people have made there were two types of waiting. You could either determine the length of the song (if you uploaded it or maybe it's a property of sound you would know) or the other guy's way would wait until the sound is no longer playing.

Which ever you choose to use place the wait inside all of these like so:
if (a == 1) then
game.Workspace.Songs.Believer:Play()
--wait here
end

Wrap the entire code (not just the spinet I posted here) with proper waiting added and put it in a while true do loop. It won't crash now.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image