Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Your title should be specific! Describe your problem concisely?

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

0

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.

0

Still doesn't work.

0

is this a localscript or a script?

0

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.

0

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)

1 answer

✓ Accepted answer

PlaybackLoudness is how loud the sound is at its current time position. If you want it to be based on how loud the song is playing to then change

workspace.Sound.PlaybackLoudness / 1000

to

(workspace.Sound.PlaybackLoudness / 1000)*workspace.Sound.Volume

This discussion is preserved as it was. New answers, comments, and votes are closed.