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

Playback Loudness Not Working Correctly?

Asked by 6 years ago

This question has been solved by the original poster.

I have currently gotten into playback loudness and cant seem to figure out what is wrong with my script. It is a simple script that causes a change in a color value. It randomizes but I only have it set to two colors just for testing.

local color = {"Gold", "Lily White"}

while true do
    wait()
    if game.Workspace.TrelloSound.PlaybackLoudness > 100  then
        script.Parent.Value = color[math.random(1,#color)]
    wait(.5)
end

1 answer

Log in to vote
0
Answered by 6 years ago

I'm assuming by "color value" you mean BrickColor value. In this case, you need to convert the name of the color to an actual BrickColor value:

script.Parent.Value = BrickColor.new(color[math.random(1,#color)])

Also, "Lily White" is not a valid BrickColor name; it should be named "Lily white" (Caps matter when BrickColors are used).

0
Well the parent of this script is a stringvalue and what the script is supposed to do is change the value to a color when the loudness hits that certain volume OVOFinessinq 21 — 6y
0
Just noticed - You are missing an `end` keyword to end the `if` statement. MightyBaconOverlord 253 — 6y
0
I found the problem. I wasn't setting the volume value high enough. The color was saying idle because the music was always louder than what I put. OVOFinessinq 21 — 6y
Ad

Answer this question