I'm trying to run a loop for my traffic lights, all works well because it's really messy. I want to figure out how clean the crosswalk signal loop up by running a separate loop inside of the main loop for a certain amount of times.
local startRed = script.Parent.redFULL
local startGreen = script.Parent.greenARROW
local crossWalk1red = script.Parent.crossWalk_Red1
local crossWalk1white = script.Parent.crossWalk_White1
local crossWalk2red = script.Parent.crossWalk_Red2
local crossWalk2white = script.Parent.crossWalk_White2
while true do
startGreen.red.Transparency = 0.95
wait(0.1)
startGreen.green.Transparency = 0
wait(13) --Time the GreenLight stays on
startGreen.green.Transparency = 0.95
wait(0.1) -- Interval Between changing to different Light
startGreen.yellow.Transparency = 0
wait(2) --Time the YellowLight stays on
startGreen.yellow.Transparency = 0.95
wait(0.1) -- Interval Between changing to different Light
startGreen.red.Transparency = 0
wait(1)
startRed.red.Transparency = .95
crossWalk2red.light.Color = Color3.fromRGB(17, 17, 17) --red off
wait(0.1)
startRed.green.Transparency = 0
crossWalk2white.light.Color = Color3.fromRGB(248, 248, 248) --white on
wait(6.5)
crossWalk2white.light.Color = Color3.fromRGB(17, 17, 17) --white off
wait(0.1)
crossWalk2red.light.Color = Color3.fromRGB(255, 0, 0) -- red on
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(17, 17, 17) --red off
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(255, 0, 0) -- red on
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(17, 17, 17) --red off
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(255, 0, 0) -- red on
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(17, 17, 17) --red off
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(255, 0, 0) -- red on
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(17, 17, 17) --red off
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(255, 0, 0) -- red on
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(17, 17, 17) --red off
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(255, 0, 0) -- red on
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(17, 17, 17) --red off
wait(0.5)
crossWalk2red.light.Color = Color3.fromRGB(255, 0, 0) -- red on
startRed.green.Transparency = 0.95
wait(0.1)
startRed.yellow.Transparency = 0
wait(2)
startRed.yellow.Transparency = 0.95
wait(0.1)
startRed.red.Transparency = 0
wait(1)
end

2 comments
I had a feeling this question would get a ton of upvotes
Especially since this is a copy of a same question which got 11 answers and 20+ upvotes in a week...