✓ Accepted answer
This code does not print whenever a sound is playing.
It prints until the sound stops playing. If it's not playing at the beginning, the code will never run.
If you want to print whenever it's playing, you need to always loop and conditionally print:
while true do
if Sound.IsPlaying then
print("Playing!")
end
wait(1)
end
Note that if a LocalScript plays the sound (and it's not replicated because it's local or FilteringEnabled is on) then a Script won't be able to get IsPlaying.
Things like == true are redundant and clutter up your code!
1 comment
There are no errors before anyone asks.