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

PlaybackLoudness function not working in game?

Asked by 8 years ago
01local num = 0
02 
03function onPlay()
04    repeat
05    .Parent.Size = num
06    num = game.Workspace.DJBooth.Sound.PlaybackLoudness/33.3333333
07    wait()
08    until false
09end
10game.Workspace.DJBooth.Sound.Played:connect(onPlay)
0
It only works in studio RequiredModule 38 — 8y

2 answers

Log in to vote
1
Answered by 8 years ago

Well, a lot of people do the same mistake, all you have to do is add WaitForChild because in the actual game it probably takes longer to load so it's doesn't work.

Here's the script you should replace it with;

01local num = 0
02 
03function onPlay()
04    repeat
05    .Parent.Size = num -- Not sure why .Parent?
06    num = game.Workspace:WaitForChild("DJBooth").Sound.PlaybackLoudness/33.3333333
07    wait()
08    until false
09end
10game.Workspace.DJBooth.Sound.Played:connect(onPlay)

I have no idea what .Parent.Size is but anything else it should work in the actual game now. If this helped please accept answer and upvote

Ad
Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
8 years ago

PlaybackLoudness is actually a client-side property. So if this is a server script then the value will not change at all ingame. Sorry!

Answer this question