Can you make a bricks color and material change in sync with music?
I am very new to scripting and this is what i'm trying to do. I'm trying to make a strobe light essentially, and i want the loudness of the music (Preferably the low end of the music) to trigger a switch in the color and material of the brick. The sound file is under workspace/MusicScript/S1
MusicScript is the script that is playing a playlist of songs, and S1 is the sound file.
In the workspace, i added a new script to try to make the light work, and this is the script
" game:GetService("RunService").RenderStepped:connect(function()
01 | local loudness = game.Workspace.MusicScript.S 1. Volume |
06 | if loudness > = 350 then |
07 | game.workspace.StrobeBrick.Material = "Neon" |
08 | game.workspace.StrobeBrick.BrickColor = BrickColor.new "Mid grey" |
12 | game.workspace.StrobeBrick.Material = "Neon" |
13 | game.workspace.StrobeBrick.BrickColor = BrickColor.new "Really black" |
end) "
Is there anything i'm missing? or any terms i've used wrong? Thank you!