I am trying to make a basic traffic light to practice my scripting skills as I have only been scripting for a few days. I want it to “turn off”, wait 40 seconds, then revert back to it’s original color, then repeat that process.
So I tried creating a function with a parameter so I could change the BrickColor of the light. I then activated it to change the color of the brick to gray, to make it appear that the light is off.
I inserted the RGB of the color I wanted, just to get an error saying that the BrickColor was expected, yet received a number.
I tried using an Enum to select a specific color I wanted, but it didn’t work. I also suspected something was wrong on line 6, so I tweaked it a bit, and yet again didn’t work. Here is the script I was using:
while true do
function StopGo (part, BrickColor)
part.BrickColor = BrickColor
end
StopGo(game.Workspace.greenLight, 66,66,66)
wait (40)
StopGo(game.Workspace.greenLight, 75,151,75)
end
Also the error I was getting: