while true do
game.Workspace.Part.BrickColor = BrickColor.new('Really red')
wait(3)
game.Workspace.Part.BrickColor = BrickColor.new('Really blue')
end
COMMUNITY QUESTION
I tried to do a script to change the brick color but I did something wrong what did i do wrong?
2 answers
I see your problem, your script was good but you messed up at the last line. You should do ANOTHER wait (3). Because what you are telling the script now is this:
while true do --Okay script, i want you to repeat these codes of line FOR EVER! (Script: Okay!)
game.Workspace.Part.BrickColor = BrickColor.new("Really red") --Now i want you to change the color of the brick WHEN I JOIN IMMEDIATELY to ''Really Red'' (Script: Okay!)
wait (3) --I want you to wait 3 seconds until the next color! (Script: Okay!)
game.Workspace.Part.BrickColor = BrickColor.new("Really blue") --Now change the brickcolor to ''Really Blue'' after the 3 seconds! (Script: Okay!)
end --Now i want you to repeat all the progress over and over! (Script: I can't do that :( because you didn't add a ''wait (3) in the last line, so what i have to do now = this. When the blue color is over, i immediately change to red since there is no ''wait 3'' added)
So you have to add a wait (3) before you end the script so it runs as you want. Like this:
while true do --Okay script, i want you to repeat these codes of line FOR EVER! (Script: Okay!)
game.Workspace.Part.BrickColor = BrickColor.new("Really red") --Now i want you to change the color of the brick WHEN I JOIN IMMEDIATELY to ''Really Red'' (Script: Okay!)
wait (3) --I want you to wait 3 seconds until the next color! (Script: Okay!)
game.Workspace.Part.BrickColor = BrickColor.new("Really blue") --Now change the brickcolor to ''Really Blue'' after the 3 seconds! (Script: Okay!)
wait (3) --Now you have to wait 3 seconds before you repeat the progress again! (Script: Okay!)
end --Now i want you to repeat all the progress over and over! (Script: I can do that!)
Btw, use code blocks next time to write your script lines. Good luck!
Whats wrong here is you right after it changes the color to blue it changes it right back to red because the while loop repeats it self
while true do
game.Workspace.Part.BrickColor = BrickColor.new('Really red')
wait(3)
game.Workspace.Part.BrickColor = BrickColor.new('Really blue')
wait(3) --this wait separates blue and red
end
Now instead of red>wait>blue>red it is red>wait>blue>wait>red
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
You can remove the green lines they don't do much it's just to tell you what you did and what the script thinks.