Not sure what the issue is, the code is suppose to print when a sound is playing, however it does not work in game but does in studio.
Script (not Local):
local Sound = script:WaitForChild("Sound") while Sound.IsPlaying == true do wait(1) print("Playing") end
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!
Well there might be a bug on roblox. Did you hear the Music Playing InGame? Sometimes Roblox Cant get Sound IDs to load into Roblox itself for whatever reason.