So my code changes the color and point light color going from right side to left side as can be seen in the gyazo. But even though I use a math.random for the colors, it only changes between 2 colors over and over? Any idea what’s wrong here?
https://gyazo.com/022fb7c46dc1cc21505d64a1a79ceb68
local p = script.Parent
local myTable = {
p["Light1"],
p["Light2"],
p["Light3"],
p["Light4"],
p["Light5"],
p["Light6"],
p["Light7"],
p["Light8"],
p["Light9"],
}
while true do
local myColor = Color3.new(math.random(0,255), math.random(0,255), math.random(0,255))
local myColorOG = myTable[1]["Light"].PointLight.Color
--wait(2)
for i = 1,9 do
print("looping1 "..i)
myTable[i]["Light"].PointLight.Color = Color3.new(myColor)
myTable[i]["Light"].BrickColor = BrickColor.new(myColor)
wait(.2)
end
--wait(2)
for i = 9,1,-1 do
print("looping2 "..i)
myTable[i]["Light"].PointLight.Color = Color3.new(myColorOG)
myTable[i]["Light"].BrickColor = BrickColor.new(myColorOG)
wait(.2)
end
print("test?")
end