Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to check if a sound is playing?

Asked by 8 years ago

Hi guys!

I was just wondering... is there anyway of checking if any sound instance is still playing in a player?

Thanks

1 answer

Log in to vote
3
Answered by
XAXA 1569 Moderation Voter
8 years ago

You can check if the IsPlaying property of the sound is true.

if sound.IsPlaying then
    -- TODO: do something if the sound is playing
end

There's a complementary IsPaused if you want to check if the sound is paused, but it's essentially the opposite of IsPlaying

0
Thanks! I'm assuming you can do if sound.IsPlaying then jjwood1600 215 — 8y
0
sound:Stop() end ? :) jjwood1600 215 — 8y
0
Yes! You don't even have to check if the sound is playing to stop it. XAXA 1569 — 8y
Ad

Answer this question