Im trying to make a brick change the color is the playbackloudness is on a specific number but i keep getting this error:
Workspace.Part.Script:2: attempt to call a userdata value
The script is (its all written in a normal script):
if workspace.Sound.IsPlaying then script.Parent.BrickColor = BrickColor.Random()((workspace.Sound.PlaybackLoudness/1000)*5) end
Thank you for reading. -Jamielelystad
Your issue wasn't with the BrickColor, but rather with the way you structured your PlaybackLoudness adjustment.
Whenever you're trying to change a value such as Volume or PlaybackLoudness, if you want to adjust the original value rather than change it to a whole new number, you need to restate it, then perform your arithmetics. The below is an example of what I mean:
if workspace.Sound.IsPlaying == true then script.Parent.BrickColor = BrickColor.Random() workspace.Sound.Volume= (workspace.Sound.Volume/1000) * 5 end