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
|
  |
| 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
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 653 |
|
|
| 16 Jan 2014 06:50 PM |
| Is that what I replace it with or? |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 16 Jan 2014 06:57 PM |
| Yes, replace it with that and try it. |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 653 |
|
| |
|
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
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 653 |
|
|
| 16 Jan 2014 07:05 PM |
| That script doesn't play my whole song.. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 653 |
|
| |
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 16 Jan 2014 07:14 PM |
| The script I gave youuuuuuuuuuuu |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
| |
|
Xupll
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 653 |
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|