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

Part size change on sound PlaybackLoudness doesnt work?

Asked by 4 years ago
Edited 4 years ago

So i have this script that selects a random song from lighting and drops it into a folder in workspace to play it. I also have an audio visualiser (Its a part/mesh part) in my game that is supposed to go off of the songs played in the folder, but i really don't know where I've gone wrong. some help would be highly appreciated

(More info) "mus" is the name of the folder in workspace. (i name my stuff weirdly, sorry.) i used "mus" as the place holder in the script the script is inside a part, the script is supposed to take the playback loudness of the song in the "mus" folder and use that to resize the part, working as a visualiser. {idk if this helped or not, im bad at explaining} ()

The Script that is inside the visualiser that is supposed to go off of the songs in the folder:

mus = game.Workspace.mus:GetChildren()
while true do

    for _,v in pairs(mus.PlaybackLoudness) do
    script.Parent.Size = Vector3.new(mus/math.random(30,80),1.119,3.883)
    wait()
    end
    end

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
for _,v in pairs(mus.PlaybackLoudness) do

You need a table in the column not a value So it should be this instead :

for _,v in pairs(mus) do

What do u intend to use the .PlaybackLoudness for anyway, and if you gonna use a while loop, why bother using a for loop when you didnt use "_" or "v"

Edit : this is probably what u need, just replace the for loop part with this

for _,v in pairs(mus) do
    script.Parent.Size = Vector3.new(v.PlaybackLoudness/math.random(30,80),1.119,3.883)
    wait()
    end

0
So the playback loudness i supposed to go with the part size, so the part would change size based on the bass and loudness of the audio being played Bylli_Oruze 38 — 4y
0
Add more info so we can work to help you, what is a mus exactly, what do you want the script to do exactly, etc etc Azure_Kite 885 — 4y
0
okay 1 sec, il update the question Bylli_Oruze 38 — 4y
Ad

Answer this question