I'm trying to pause the background music when I open a specific GUI and then resume it when the GUI is closed. However, it doesn't seem to resume?
I'm using this code to test:
- Code: Select all
if mySound1:isPlaying ( ) then
lprint("PLAYING")
else
lprint("IS NOT PLAYING")
end
if mySound1:isPaused ( ) then
lprint("PAUSED")
else
lprint("IS NOT PAUSED")
end
mySound1:pause ( )
if mySound1:isPlaying ( ) then
lprint("PLAYING")
else
lprint("IS NOT PLAYING")
end
if mySound1:isPaused ( ) then
lprint("PAUSED")
else
lprint("IS NOT PAUSED")
end
What I get in the console is:
- Code: Select all
IS NOT PLAYING
IS NOT PAUSED
IS NOT PLAYING
IS NOT PAUSED
mySound1 is definitely playing before it hits the 'pause ( )' and it definitely pauses afterwards, so I should be getting:
- Code: Select all
IS PLAYING
IS NOT PAUSED
IS NOT PLAYING
IS PAUSED
Thanks
Shando