Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Playback Loudness Not Working Correctly?

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

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).

3 comments

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

0

Just noticed - You are missing an end keyword to end the if statement.

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.