thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 27 Jan 2014 03:04 PM |
while true do local b = math.random(1, 2) if b == 1 then game.Workspace.Sound2:Play() elseif b == 2 then game.Workspace.Sound1:Play() end end |
|
|
| Report Abuse |
|
|
| |
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 27 Jan 2014 03:07 PM |
| Works now, but how do I make it wait until the audio is finished? |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
| |
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
| |
|
|
| 27 Jan 2014 03:14 PM |
| Work out how long the audio is then "while wait(howlong) do". |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 27 Jan 2014 03:17 PM |
This script doesn't work:
while wait(120) do local b = math.random(1, 2) if b == 1 then game.Workspace.Sound2:Play() elseif b == 2 then game.Workspace.Sound1:Play() end end |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
| |
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 27 Jan 2014 03:24 PM |
| Wait, would that wait 2 minutes before putting the first sound? I don't want it like dat. |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
| |
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
| |
|
|
| 27 Jan 2014 03:58 PM |
while not game.Workspace.Sound1.IsPlaying or not game.Workspace.Sound2.IsPlaying do wait() local b = math.random(1, 2) if b == 1 then game.Workspace.Sound2:Play() elseif b == 2 then game.Workspace.Sound1:Play() end end |
|
|
| Report Abuse |
|
|