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 7 years ago
local num = 0

function onPlay()
    repeat
    .Parent.Size = num
    num = game.Workspace.DJBooth.Sound.PlaybackLoudness/33.3333333
    wait()
    until false
end
game.Workspace.DJBooth.Sound.Played:connect(onPlay)
0
It only works in studio RequiredModule 38 — 7y

2 answers

Log in to vote
1
Answered by 7 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;

local num = 0

function onPlay()
    repeat
    .Parent.Size = num -- Not sure why .Parent?
    num = game.Workspace:WaitForChild("DJBooth").Sound.PlaybackLoudness/33.3333333
    wait()
    until false
end
game.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
7 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