while true do wait(0) script.parent.poleA.TrafficLight1.GreenLight.BrickColor = BrickColor.Green() script.parent.poleA.TrafficLight1.GreenLight.SpotLight.Enabled = true script.parent.poleA.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight1.YellowLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight1.RedLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight1.RedLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight.GreenLight.BrickColor = BrickColor.Green() script.parent.poleA.TrafficLight.GreenLight.SpotLight.Enabled = true script.parent.poleA.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight.YellowLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight.RedLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight.RedLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight1.GreenLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight1.YellowLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight1.RedLight.BrickColor = BrickColor.Red() script.parent.poleB.TrafficLight1.RedLight.SpotLight.Enabled = true script.parent.poleB.TrafficLight.GreenLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight.GreenLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight.YellowLigt.SpotLight.Enabled = false script.parent.poleB.TrafficLight.RedLight.BrickColor = BrickColor.Red() script.parent.poleB.TrafficLight.RedLight.SpotLight.Enabled = true wait(20) script.parent.poleA.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight1.GreenLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight1.YellowLight.BrickColor = BrickColor.Yellow() script.parent.poleA.TrafficLight1.YellowLight.SpotLight.Enabled = true script.parent.poleA.TrafficLight1.RedLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight1.RedLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight.GreenLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight.GreenLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight.YellowLight.BrickColor = BrickColor.Yellow() script.parent.poleA.TrafficLight.YellowLight.SpotLight.Enabled = true script.parent.poleA.TrafficLight.RedLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight.RedLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight1.GreenLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight1.YellowLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight1.RedLight.BrickColor = BrickColor.Red() script.parent.poleB.TrafficLight1.RedLight.SpotLight.Enabled = true script.parent.poleB.TrafficLight.GreenLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight.GreenLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight.YellowLigt.SpotLight.Enabled = false script.parent.poleB.TrafficLight.RedLight.BrickColor = BrickColor.Red() script.parent.poleB.TrafficLight.RedLight.SpotLight.Enabled = true wait(5) script.parent.poleA.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight1.GreenLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight1.YellowLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight1.RedLight.BrickColor = BrickColor.Red() script.parent.poleA.TrafficLight1.RedLight.SpotLight.Enabled = true script.parent.poleA.TrafficLight.GreenLight.BrickColor = BrickColor.Black script.parent.poleA.TrafficLight.GreenLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight.YellowLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight.RedLight.BrickColor = BrickColor.Red() script.parent.poleA.TrafficLight.RedLight.SpotLight.Enabled = true script.parent.poleB.TrafficLight1.GreenLight.BrickColor = BrickColor.Green script.parent.poleB.TrafficLight1.GreenLight.SpotLight.Enabled = true script.parent.poleB.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight1.YellowLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight1.RedLight.BrickColor = BrickColor.Black script.parent.poleB.TrafficLight1.RedLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight.GreenLight.BrickColor = BrickColor.Green() script.parent.poleB.TrafficLight.GreenLight.SpotLight.Enabled = true script.parent.poleB.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight.YellowLigt.SpotLight.Enabled = false script.parent.poleB.TrafficLight.RedLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight.RedLight.SpotLight.Enabled = false wait(20) script.parent.poleA.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight1.GreenLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight1.YellowLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight1.RedLight.BrickColor = BrickColor.Red() script.parent.poleA.TrafficLight1.RedLight.SpotLight.Enabled = true script.parent.poleA.TrafficLight.GreenLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight.GreenLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.parent.poleA.TrafficLight.YellowLight.SpotLight.Enabled = false script.parent.poleA.TrafficLight.RedLight.BrickColor = BrickColor.Red() script.parent.poleA.TrafficLight.RedLight.SpotLight.Enabled = true script.parent.poleB.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight1.GreenLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight1.YellowLight.BrickColor = BrickColor.Yellow() script.parent.poleB.TrafficLight1.YellowLight.SpotLight.Enabled = true script.parent.poleB.TrafficLight1.RedLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight1.RedLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight.GreenLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight.GreenLight.SpotLight.Enabled = false script.parent.poleB.TrafficLight.YellowLight.BrickColor = BrickColor.Yellow() script.parent.poleB.TrafficLight.YellowLight.SpotLight.Enabled = true script.parent.poleB.TrafficLight.RedLight.BrickColor = BrickColor.Black() script.parent.poleB.TrafficLight.RedLight.SpotLight.Enabled = false wait(5) end
while true do wait(0) script.Parent.poleA.TrafficLight1.GreenLight.BrickColor = BrickColor.Green() script.Parent.poleA.TrafficLight1.GreenLight.SpotLight.Enabled = true script.Parent.poleA.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight1.YellowLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight1.RedLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight1.RedLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight.GreenLight.BrickColor = BrickColor.Green() script.Parent.poleA.TrafficLight.GreenLight.SpotLight.Enabled = true script.Parent.poleA.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight.YellowLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight.RedLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight.RedLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight1.GreenLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight1.YellowLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight1.RedLight.BrickColor = BrickColor.Red() script.Parent.poleB.TrafficLight1.RedLight.SpotLight.Enabled = true script.Parent.poleB.TrafficLight.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight.GreenLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight.YellowLigt.SpotLight.Enabled = false script.Parent.poleB.TrafficLight.RedLight.BrickColor = BrickColor.Red() script.Parent.poleB.TrafficLight.RedLight.SpotLight.Enabled = true wait(20) script.Parent.poleA.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight1.GreenLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight1.YellowLight.BrickColor = BrickColor.Yellow() script.Parent.poleA.TrafficLight1.YellowLight.SpotLight.Enabled = true script.Parent.poleA.TrafficLight1.RedLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight1.RedLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight.GreenLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight.YellowLight.BrickColor = BrickColor.Yellow() script.Parent.poleA.TrafficLight.YellowLight.SpotLight.Enabled = true script.Parent.poleA.TrafficLight.RedLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight.RedLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight1.GreenLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight1.YellowLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight1.RedLight.BrickColor = BrickColor.Red() script.Parent.poleB.TrafficLight1.RedLight.SpotLight.Enabled = true script.Parent.poleB.TrafficLight.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight.GreenLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight.YellowLigt.SpotLight.Enabled = false script.Parent.poleB.TrafficLight.RedLight.BrickColor = BrickColor.Red() script.Parent.poleB.TrafficLight.RedLight.SpotLight.Enabled = true wait(5) script.Parent.poleA.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight1.GreenLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight1.YellowLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight1.RedLight.BrickColor = BrickColor.Red() script.Parent.poleA.TrafficLight1.RedLight.SpotLight.Enabled = true script.Parent.poleA.TrafficLight.GreenLight.BrickColor = BrickColor.Black script.Parent.poleA.TrafficLight.GreenLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight.YellowLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight.RedLight.BrickColor = BrickColor.Red() script.Parent.poleA.TrafficLight.RedLight.SpotLight.Enabled = true script.Parent.poleB.TrafficLight1.GreenLight.BrickColor = BrickColor.Green script.Parent.poleB.TrafficLight1.GreenLight.SpotLight.Enabled = true script.Parent.poleB.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight1.YellowLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight1.RedLight.BrickColor = BrickColor.Black script.Parent.poleB.TrafficLight1.RedLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight.GreenLight.BrickColor = BrickColor.Green() script.Parent.poleB.TrafficLight.GreenLight.SpotLight.Enabled = true script.Parent.poleB.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight.YellowLigt.SpotLight.Enabled = false script.Parent.poleB.TrafficLight.RedLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight.RedLight.SpotLight.Enabled = false wait(20) script.Parent.poleA.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight1.GreenLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight1.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight1.YellowLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight1.RedLight.BrickColor = BrickColor.Red() script.Parent.poleA.TrafficLight1.RedLight.SpotLight.Enabled = true script.Parent.poleA.TrafficLight.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight.GreenLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight.YellowLight.BrickColor = BrickColor.Black() script.Parent.poleA.TrafficLight.YellowLight.SpotLight.Enabled = false script.Parent.poleA.TrafficLight.RedLight.BrickColor = BrickColor.Red() script.Parent.poleA.TrafficLight.RedLight.SpotLight.Enabled = true script.Parent.poleB.TrafficLight1.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight1.GreenLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight1.YellowLight.BrickColor = BrickColor.Yellow() script.Parent.poleB.TrafficLight1.YellowLight.SpotLight.Enabled = true script.Parent.poleB.TrafficLight1.RedLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight1.RedLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight.GreenLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight.GreenLight.SpotLight.Enabled = false script.Parent.poleB.TrafficLight.YellowLight.BrickColor = BrickColor.Yellow() script.Parent.poleB.TrafficLight.YellowLight.SpotLight.Enabled = true script.Parent.poleB.TrafficLight.RedLight.BrickColor = BrickColor.Black() script.Parent.poleB.TrafficLight.RedLight.SpotLight.Enabled = false wait(5) end
You can make it more simple.
1- Name your traffic light TrafficLight.
2- Add your three cylinder parts (green,yellow,red) and name them Green, Yellow, Red. Don't forget to change them to their correct color or else it would look weird lol.
3- In each cylinder part, add a SurfaceLight. (For Example: In each cylinder part [Green,Yellow,Red] add a surface light)
4- Add a script in the model named TrafficLight ****NOT IN THE CYLINDER PARTS**** and type in this:
local trafficLight = script.Parent -- locates the model local green = trafficLight.Green -- Locates the green cylinder part local yellow = trafficLight.Yellow --Locates the yellow cylinder part local red = trafficLight.Red -- locates the red cylinder part local function turnOn(part) part.Material = Enum.Material.Neon -- when turned on it would make the part neon part.SurfaceLight.Enabled = true -- when turned on the surfacelight will be enabled or turned on end local function turnOff(part) part.Material = Enum.Material.Plastic --when turned off it will do the oppostite part.SurfaceLight.Enabled = false end while true do --to turn on the green light turnOn(green) turnOff(red) wait(8) -- how many seconds you want the green light to last (you can change the amount) --to turn on yellow turnOn(yellow) turnOff(green) wait(3) -- how many seconds you want the yellow light to last --to turn on the red turnOn(red) turnOff(yellow) wait(10) -- how many seconds you want red to last. end
5- If you need the other side of the road you just copy this:
local trafficLight = script.Parent local green = trafficLight.Green local yellow = trafficLight.Yellow local red = trafficLight.Red local function turnOn(part) part.Material = Enum.Material.Neon part.SurfaceLight.Enabled = true end local function turnOff(part) part.Material = Enum.Material.Plastic part.SurfaceLight.Enabled = false end while true do -- this is for the other side of the intersection for right and left. the other one was for the front and back turnOn(red) turnOff(yellow) wait(10) -- how many seconds you want red to last. --to turn on the green light turnOn(green) turnOff(red) wait(8) -- how many seconds you want the green light to last (you can change the amount) --to turn on yellow turnOn(yellow) turnOff(green) wait(3) -- how many seconds you want the yellow light to last --to turn on the red end
last step- now all you need to do is add the extra part like the poles and your done!
I hope I helped you! I tested and it worked by the way. :D I hope the was more simpler.