When I pressed play on Roblox Studio it worked fine, but it never worked when I went to the game, it also doesn't show any error, any help?
while true do
wait()
workspace:WaitForChild("PART2").SurfaceGui.TextLabel.Size = UDim2.new(0.446, 0,workspace.Sound.PlaybackLoudness / 1000, 0)
end
how can i make this work?

5 comments
You always need to add some kind of wait feature in infinite loops rather than just wait(), I would recommend wait(0.01). If that doesn't work there's some kind of error in the other area of that script.
Still doesn't work.
is this a localscript or a script?
wait(0.01) is probably the same as wait() because roblox wiki says that wait() pauses close to 1/30 of a second. wait(0.01) would pause for only 1/100 of a second.
I recreated this script in workspace and it seems to work fine. Did you use :Play() to play the sound or did you hit the green triangle in studio(that doesn't trigger playbackloudness or any other sound properties to change)