I am trying to make a script that changes an object's color from red to blue to purple to pink to orange and then repeating this cycle. Here is my first script I tried:
game.Workspace.part = changer changer.BrickColor = "Red" changer.BrickColor = "Blue" changer.BrickColor = "Purple" changer.BrickColor = "Pink changer.BrickColor = "Orange"
Results: This script doesn't loop the color changer and doesn't even show colors. I wanted it to loop the colors and show the colors.
What can I add to fix this script to make sure it is what I want?
The BrickColor
Property takes BrickColor values. And you're supplying strings.
Also, you're trying to set a variable on line 1
, but you're doing it backwards(:
So you need to put the strings inside BrickColor.new
functions.
And you also want it to loop constantly? To do this you need to put your code in a while loop.
local changer = workspace.part while wait() do changer.BrickColor = BrickColor.new("Red") changer.BrickColor = BrickColor.new("Blue") changer.BrickColor = BrickColor.new("Purple") changer.BrickColor = BrickColor.new("Pink") changer.BrickColor = BrickColor.new("Orange") end