Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a block change color repeatedly?

Pretty much I am trying to make a block change from red to green and I want it to repeat but I also dont want this huge text script and I cant seem to make it repeat

while true do
	script.Parent.BrickColor = BrickColor.new ("Lime green")
	wait(4)
	script.Parent.BrickColor = BrickColor.new ("Really red")
	wait(4)
end

This is my script, I even tryed replacing the end with repeat and that did not work along with adding repeat before the end and it wouldn't work.

1 comment

0

hold on i have done this before just need to test code it should be ready in like 10 minutes then ill anwser

3 answers

✓ Accepted answer

BrickColor.new() is meant to have Color Values as it's parameters, not strings. Therefore, the color parameters in RGB values would look something like this:

while true do
    script.Parent.BrickColor = BrickColor.new(0,255,0)
    wait(4)
    script.Parent.BrickColor = BrickColor.new(255,0,0)
    wait(4)
end

Feel free to try that out and accept if it works

2 comments

0

Hmmm for RGB values you have to use Part.Color = Color3.fromRGB(164,168,50)

0

Yes, but we are using BrickColor

local Part = script.Parent -- make sure your script is inside of the part you want to change colors

while true do
    Part.BrickColor = BrickColor.new ("Lime green")
    wait(1)
    Part.BrickColor = BrickColor.new ("Really red")
    wait(1)
end

this worked for me note: if you want to make it more then just 2 colors dont use Part.BrickColor = BrickColor.new ("Really red") with a whole bunch of wait() because that is really inefficient you can use a list and it will make your life a lot easier and if you use the list properly you wont even have to wait() multiple time

Keep scripting you'll get better :)

This discussion is preserved as it was. New answers, comments, and votes are closed.