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

Why wont this color changing script work?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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.

0
the part still isnt changing colors :( User#210 0 — 9y
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(). Shrekerly 70 — 9y
0
There is no Color3 for bricks, only BrickColor. GoldenPhysics 474 — 9y
0
Yes, but you can do Part.BrickColor = Color3.new(0, 0, 0), I believe. Shrekerly 70 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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

Answer this question