Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I tried to do a script to change the brick color but I did something wrong what did i do wrong?

Asked by 6 years ago

~~~~~~~~~~~~~~~~~`` while true do game.Workspace.Part.BrickColor = BrickColor.new('Really red') wait(3) game.Workspace.Part.BrickColor = BrickColor.new('Really blue') end ~~~~~~~~~~~~~~~~~

2 answers

Log in to vote
0
Answered by
ali7682 17
6 years ago

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!

0
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. ali7682 17 — 6y
Ad
Log in to vote
0
Answered by
DanzLua 2879 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

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

Answer this question