BASIC TRAFFIC SIGNAL

:traffic_light: Want to learn how to build a basic traffic light for your city game? This tutorial will help you with that.

0_1489965336934_green.png

Build a traffic light from the image above or your own design

Name and color 3 parts

  • Red
  • Yellow
  • Green

Once you have created it, group all the parts.

Name the model "Traffic Light"

insert a script into it by right clicking it, and hitting "Insert Object" then click "Script" 0_1489965673466_ins.png

0_1489965685516_scr.png

Now, go into the script by double clicking it.

Type at the top (Or just copy below if your lazy and really don't wanna type this)

local G = script.Parent.Green
local Y = script.Parent.Yellow
local R = script.Parent.Red

Next type

while true do
G.Material = "Neon"
Y.Material = "Plastic"
R.Material = "Plastic"
wait(10)
G.Material = "Plastic"
Y.Material = "Neon"
R.Material = "Plastic"
wait(3)
G.Material = "Plastic"
Y.Material = "Plastic"
R.Material = "Neon"
wait(10)
end

There are also other ways to make a simple traffic light, but this is the easiest because you have to type less! :grin: