✓ Accepted answer
##Problem
Your script is reading line 4 as a line it needs to remember, not as a property that needs to be changed. Just removing the .BrickColor from that line will make the script remember the value as a object, which if you reference it later in the script with .BrickColor afterward. The script will realise that you're intending to change the value of the object.
##Solution
while wait(1) do
math.randomseed(tick())
local value = math.random(1,8)
Color = script.Parent
if value == 1 then
Color.BrickColor = BrickColor.new("Really Red")
elseif value == 2 then
Color.BrickColor = BrickColor.new("Lime green")
elseif value == 3 then
Color.BrickColor = BrickColor.new("Hot pink")
elseif value == 4 then
Color.BrickColor = BrickColor.new("New Yeller")
elseif value == 5 then
Color.BrickColor = BrickColor.new("Toothpaste")
elseif value == 6 then
Color.BrickColor = BrickColor.new("Burnt Sienna")
elseif value == 7 then
Color.BrickColor = BrickColor.new("Really black")
elseif value == 8 then
Color.BrickColor = BrickColor.new("Peral")
end
end
How your script was reading it before probably was like this. Repeat randomseed: get a value: remember the part's BrickColor for later being Mid gray: if statement: value is equal to two: alright remember the BrickColor Lime Green: wait a second: alright randomseed: get value: remember Lime Green since that's the color of the Brick: value is 5: remember Toothpaste. And it just goes on just remember the changing variable instead of actually changing the property of the object.
1 comment
Setting a variable to a value doesn't attach it to where that value came from.