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: Overlapping.. Help?

Previous Thread :: Next Thread 
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 06:46 PM
The Songs keap overlapping when I use this script like they all will be playing at the same time... Any help?

while true do
pick = math.random(1, 4)
wait(0.1)
if pick == 1 then
script.M1:Play()
elseif pick == 2 then
script.M2:Play()
elseif pick == 3 then
script.M3:Play()
elseif pick == 4 then
script.M4:Play()
end
wait(9)
end
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
16 Jan 2014 06:48 PM
local sounds = script:GetChildren()

while true do
pick = sounds[math.random(1, #sounds)]
print("Chosen sound: "..tostring(pick))
pick:Play()
wait(9)
pick:Pause()
end
Report Abuse
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 06:50 PM
Is that what I replace it with or?
Report Abuse
CrazySTEVE1234 is not online. CrazySTEVE1234
Joined: 11 Feb 2009
Total Posts: 613
16 Jan 2014 06:56 PM
Are the songs longer than 9 seconds? If so then you need to pause after the 9 seconds.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
16 Jan 2014 06:57 PM
Yes, replace it with that and try it.
Report Abuse
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 07:03 PM
Do I replace all of mine with it or just a part of it?
Report Abuse
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 07:03 PM
Sorry repost.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
16 Jan 2014 07:03 PM
Replace the sound script you posted with mine.
Report Abuse
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 07:05 PM
That script doesn't play my whole song..
Report Abuse
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 07:05 PM
My songs are the new 1-120 second ones..
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
16 Jan 2014 07:07 PM
You could make the wait 120sec, so it plays the whole song..
Report Abuse
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 07:09 PM
But thats alot of wait..
Is there another way?
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
16 Jan 2014 07:12 PM
What you want is a different song to play after the last one is done? That'd do just that. It'd play, then go straight to the wait, then play a new one after it's done playing.
Report Abuse
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 07:13 PM
So how would I do that?
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
16 Jan 2014 07:14 PM
The script I gave youuuuuuuuuuuu
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
16 Jan 2014 07:15 PM
except change the wait
Report Abuse
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 07:16 PM
Change it to what
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
16 Jan 2014 07:17 PM
Are all the songs the same length? If they aren't, do you know the length of each one?
Report Abuse
CrazySTEVE1234 is not online. CrazySTEVE1234
Joined: 11 Feb 2009
Total Posts: 613
16 Jan 2014 07:20 PM
It doesn't wait for the song to end for the wait to start, the song plays and the wait begins at the same time, that's why it overlaps lol
Report Abuse
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 07:21 PM
I don't actually sorry, I didn't make them..
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
16 Jan 2014 07:21 PM
That's what I said, it plays, then goes directly to the wait().
Report Abuse
Xupll is not online. Xupll
Joined: 28 Dec 2010
Total Posts: 653
16 Jan 2014 07:24 PM
So how do I fix it, and I changed the wait to 120 on wait, but it justs plays the whole song, but it takes really really long gaps between.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
16 Jan 2014 07:31 PM
The IsPlaying property on sounds don't go false when they stop playing, so I don't know, sorry.
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