Techante
|
  |
| Joined: 17 Oct 2011 |
| Total Posts: 2101 |
|
|
| 17 Mar 2014 02:14 PM |
Pauses music, but when pressed again, the music doesn't play again!! Please help, here is the script:
sound = script.Parent.Parent.SoundBlock.Boom sounda = script.Parent.Parent.SoundBlocka.Boom
function onClicked() if sound.IsPlaying == true then sound:Pause() sounda:Pause() else if sound.IsPlaying == false then sound:Play() sounda:Play() end end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 17 Mar 2014 02:16 PM |
Try instead:
if sound.IsPaused == false then
|
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 17 Mar 2014 02:59 PM |
| sound.IsPlaying = not sound.IsPlaying |
|
|
| Report Abuse |
|
|
Techante
|
  |
| Joined: 17 Oct 2011 |
| Total Posts: 2101 |
|
| |
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 18 Mar 2014 03:27 AM |
elseif not else if it makes a difference |
|
|
| Report Abuse |
|
|
wubbzy301
|
  |
| Joined: 15 May 2010 |
| Total Posts: 1188 |
|
|
| 18 Mar 2014 03:57 AM |
sound = script.Parent.Parent.SoundBlock.Boom sounda = script.Parent.Parent.SoundBlocka.Boom
function onClicked() if sound.IsPlaying == true then sound:Pause() sounda:Pause() elseif sound.IsPlaying == false then -- it must be fixed. sound:Play() sounda:Play() end end end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|