Garry's Mod

Garry's Mod

80 ratings
Traffic Lighter
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Roleplay, Realism
File Size
Posted
Updated
1.061 MB
31 Dec, 2015 @ 8:50am
15 Jan, 2016 @ 1:02pm
2 Change Notes ( view )

Subscribe to download
Traffic Lighter

Description
Traffic Lighter is a lua script for automate traffic light.

2 traffic light model is supported :
- models/props_c17/traffic_light001a.mdl
- models/props/cs_assault/stoplight.mdl

  • Configuration traffic light :
    Create server-side lua script and use array variable
    TRAFFIC_LIGHTER_CONFIG["model link"] = {Timer = time for next light, TimerWait = time for wait light}

  • Exemple lua script :
    TRAFFIC_LIGHTER_CONFIG["models/props_c17/traffic_light001a.mdl"] = {Timer = 20, TimerWait = 5}

Lua Properties :

string color = ex :tostring(Color(255, 0, 0, 255))

ENTITY:SetTimer(int)
ENTITY:SetTimerWait(int)

ENTITY:SetLightStop(string color)
ENTITY:SetLightWait(string color)
ENTITY:SetLightStart(string color)

ENTITY:SetLight(string color)

Source Code : https://github.com/StidOfficial/Traffic-Lighter
Popular Discussions View All (1)
2
6 Sep, 2016 @ 10:56am
Pole is an Error, fix it?
Sammysat
23 Comments
FoXikYtByHoww 14 Nov, 2023 @ 1:07am 
WARNING! Carry on reading! Or you will die, even if you only looked at the word warning! Once there was a little girl called Clarissa, she was ten-years-old and she lived in a mental hospital, because she killed her mom and her dad. She got so bad she went to kill all the staff in the hospital so the More- government decided that best idea was to get rid of her so they set up a special room to kill her, as humane as possible but it went wrong the machine they were using went wrong. And she sat there in agony for hours until she died. Now every week on the day of her death she returns to the person that reads this letter, on a monday night at 12:00a.m. She creeps into your room and kills you slowly, by cutting you and watching you bleed to death. Now send this to ten other profiles on this one site, and she will haunt someone else who doesn't. This isn't fake. apparently, if u copy and paste this to ten comments in the next ten minutes u will have the best of your life
MaxZemX 5 Oct, 2018 @ 6:54am 
Problem in green...
YeOl'Choppa 30 Jun, 2018 @ 10:50am 
well, i just found out that no matter how much i set the value for ''traffic light timer'', it will be the same timing if the ''traffic light wait'' isn't touched. this had a good chance of being a masterpiece...
Stid  [author] 23 Aug, 2017 @ 1:09pm 
Use lua scripting for more customization.
V I P E R S N E K 23 Aug, 2017 @ 12:26pm 
can you get these to sync up if you have more than one?
JakeD24 10 Dec, 2016 @ 12:48am 
the lights breack after a long time
Stid  [author] 10 Apr, 2016 @ 1:13am 
Use a lua and change TimeWait variable for you skin.
Item 9 9 Apr, 2016 @ 9:39pm 
How do you make red light stay on longer?
Stid  [author] 9 Mar, 2016 @ 6:47am 
ok, thanks