Just Some Edited Traffic Light Scripting

General discussions

Moderator: senjer

Post Reply
User avatar
Sgt_DeBones
Posts: 645
Joined: 05 Apr 2019, 15:23
Location: Los Angeles, California
Contact:

Just Some Edited Traffic Light Scripting

Post by Sgt_DeBones »

1. var Red : Light;
2. var Green : Light;
3. var Yellow : Light;
4.
5. function Start()
6. {
7.
8. Yellow.enabled = false;
9.
10. while(true)
11. {
12. Green.enabled = true;
13. Red.enabled = false;
14. yield WaitForSeconds(30);
15. Yellow.enabled = true;
16 .Green.enabled = false;
17. yield WaitForSeconds(3.7);
18. Red.enabled = true;
19. Yellow.enabled = false;
20. yield WaitForSeconds (20);
21. }
22.
23. }


I am working on a script for blankout LEDs and trolley signals. I've worked on a script that invovled in intersection and an adjacent RR crossing with the traffic lights cooperating with the crossing signals.

@Michiel, please allow traffic light routine scripts into the simulator.
WW3 is at our doorstep. Gear up just in case. PROTECT THE METROS!
Post Reply