For a self mini-project on while loops and in loops, I decided to script a dance floor today. The problem I noticed right away was the colors, which are randomly assigned from a local list of picked colors, changed once and is like that for the rest of the testing. What I'm trying to do is have the colors change every 0.75 seconds.
I noticed in the output browser it says BrickColor is not a valid member of the script which I quite don't understand since I'm a beginner. Would love to know those type of errors exactly mean. Thanks.
Here is the code:
local colors = {"Bright red","Bright blue","Bright green"}
local max = table.getn(colors)
while wait(0.75) do
for _, v in pairs(game.Workspace.DanceFloor.Lights:GetChildren()) do
v.BrickColor = BrickColor.new(colors[math.random(1,max)])
end
end

1 comment
That was interesting since in the lights model, there were only parts, but this solution worked flawlessly