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

Why wont this color changing script work?

Im trying to change the RGB values of a part multiple times to give a color changing effect, but this script isnt working.

while true do
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 17, 255))
wait (5)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 15, 226))
wait (0.1)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 12, 182))
wait (0.1)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 9, 135))
wait (0.1)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 5, 82))
wait (0.1)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 3, 46))
wait (0.1)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 0, 0))
wait (5)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 3, 46))
wait (0.1)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 5, 82)
wait (0.1)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 9, 135))
wait (0.1)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 12, 182))
wait (0.1)
game.Workspace.Part.BrickColor = BrickColor.new(Color3.new(0, 15, 226))
end

2 answers

Since you are using a loop, you will need to put an 'end' at the bottom of the script so the loop knows to end there.

4 comments

0

the part still isnt changing colors :(

0

I see it now- You put "BrickColor.new(Color3.new(0, 0, 0)". Remove the BrickColor.new() and change it to just Color3.new().

0

There is no Color3 for bricks, only BrickColor.

0

Yes, but you can do Part.BrickColor = Color3.new(0, 0, 0), I believe.

If there are multiple instances in your place named Part, the script can't tell which part it is.

If this is your problem, I would suggest naming all of your Parts

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