local d=script.Parent.Parent local x=script.Parent.Parent.Parent.Parent.Car.Value local z=game.Players.LocalPlayer:GetMouse()local q="\122"local N="\099"local f="\120"local H=false local G=false local c=false local U=x.Body.Lights.Left.RLTS.TSL local D=x.Body.Lights.Right.RRTS.TSL local J=x.Body.Lights.Left.RLTS local A=x.Body.Lights.Right.RRTS local I=.32 local y=x.Body.Lights.Left.LTS local s=x.Body.Lights.Right.RTS local g=(script.Parent.Parent.Parent.Parent:WaitForChild("\065\067\054\095\083\116\111\099\107\095\071\097\117\103\101\115")).Left local k=(script.Parent.Parent.Parent.Parent:WaitForChild("\065\067\054\095\083\116\111\099\107\095\071\097\117\103\101\115")).Right local E=BrickColor.New("\077\105\100 \103\114\097\121")local F=BrickColor.New("\066\114\105\103\104\116 \111\114\097\110\103\101")z.KeyDown:connect(function(x)local z=string.lower(x)if z==q then if G==false then G=true script.Parent.Parent.StartSignal:play()repeat y.BrickColor=F U.Enabled=true y.Material="\078\101\111\110"y.Transparency=0 g.ImageTransparency=0 J.Material="\078\101\111\110"d.TurnSignal:play()wait(I)y.Transparency=1 y.BrickColor=E g.ImageTransparency=1 d.TurnSignal:play()y.Material="\083\097\110\100"J.Material="\083\097\110\100"U.Enabled=false wait(I)until G==false or c==true elseif G==true or c==true then G=false d.TurnSignal:stop()U.Enabled=false wait(.05)script.Parent.Parent.StopSignal:play()end elseif z==N then if c==false then c=true script.Parent.Parent.StartSignal:play()repeat D.Enabled=true s.Material="\078\101\111\110"A.Material="\078\101\111\110"d.TurnSignal:play()s.BrickColor=F s.Transparency=0 k.ImageTransparency=0 wait(I)s.Transparency=1 s.BrickColor=E k.ImageTransparency=1 d.TurnSignal:play()s.Material="\083\097\110\100"A.Material="\083\097\110\100"D.Enabled=false wait(I)until c==false or G==true elseif c==true or G==true then c=false d.TurnSignal:stop()wait(.05)script.Parent.Parent.StopSignal:play()D.Enabled=false end elseif z==f then if H==false then script.Parent.Parent.StartSignal:play()H=true repeat s.BrickColor=F y.BrickColor=F s.Material="\078\101\111\110"A.Material="\078\101\111\110"y.Material="\078\101\111\110"y.Transparency=0 s.Transparency=0 J.Material="\078\101\111\110"d.TurnSignal:play()D.Enabled=true U.Enabled=true g.ImageTransparency=0 k.ImageTransparency=0 wait(I)y.Transparency=1 s.Transparency=1 s.BrickColor=E y.BrickColor=E g.ImageTransparency=1 k.ImageTransparency=1 d.TurnSignal:play()s.Material="\083\097\110\100"A.Material="\083\097\110\100"y.Material="\083\097\110\100"J.Material="\083\097\110\100"D.Enabled=false U.Enabled=false wait(I)until H==false elseif H==true then H=false d.TurnSignal:stop()D.Enabled=false U.Enabled=false wait(.05)script.Parent.Parent.StopSignal:play()end end end)

local component = script.Parent.Parent
local car = script.Parent.Parent.Parent.Parent.Car.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local leftsignal = "z"
local rightsignal = "c"
local hazards = "x"
local hazardson = false
local lefton = false
local righton = false
local leftlight = car.Body.Lights.Left.RLTS.TSL
local rightlight = car.Body.Lights.Right.RRTS.TSL
local leftfront = car.Body.Lights.Left.RLTS
local rightfront = car.Body.Lights.Right.RRTS
local signalblinktime = 0.32
local neonleft = car.Body.Lights.Left.LTS
local neonright = car.Body.Lights.Right.RTS
local leftgui = script.Parent.Parent.Parent.Parent:WaitForChild("AC6_Stock_Gauges").Left
local rightgui = script.Parent.Parent.Parent.Parent:WaitForChild("AC6_Stock_Gauges").Right
local off =  BrickColor.New("Mid gray")
local on = BrickColor.New("Bright orange")
mouse.KeyDown:connect(function(lkey)
	local key = string.lower(lkey)
	if key == leftsignal then
		if lefton == false then
			lefton = true
			script.Parent.Parent.StartSignal:play()
			repeat
				neonleft.BrickColor=on
				leftlight.Enabled = true
				neonleft.Material = "Neon"
				neonleft.Transparency=0
				leftgui.ImageTransparency=0
				leftfront.Material = "Neon"
				component.TurnSignal:play()
				wait(signalblinktime)
				neonleft.Transparency=1
				neonleft.BrickColor=off
				leftgui.ImageTransparency=1
				component.TurnSignal:play()
				neonleft.Material = "Sand"
				leftfront.Material = "Sand"
				leftlight.Enabled = false
				wait(signalblinktime)
			until
			lefton == false or righton == true
		elseif lefton == true or righton == true then
			lefton = false
			component.TurnSignal:stop()
			leftlight.Enabled = false
			wait(0.05)
			script.Parent.Parent.StopSignal:play()
		end
	elseif key == rightsignal then
		if righton == false then
			righton = true
			script.Parent.Parent.StartSignal:play()
			repeat
				rightlight.Enabled = true
				neonright.Material = "Neon"
				rightfront.Material = "Neon"
				component.TurnSignal:play()
				neonright.BrickColor=on
				neonright.Transparency=0
				rightgui.ImageTransparency=0
				wait(signalblinktime)
				neonright.Transparency=1
				neonright.BrickColor=off
				rightgui.ImageTransparency=1
				component.TurnSignal:play()
				neonright.Material = "Sand"
				rightfront.Material = "Sand"
				rightlight.Enabled = false
				wait(signalblinktime)
			until
			righton == false or lefton == true
		elseif righton == true or lefton == true then
			righton = false
			component.TurnSignal:stop()
			wait(0.05)
			script.Parent.Parent.StopSignal:play()
			rightlight.Enabled = false
		end
	elseif key == hazards then
		if hazardson == false then
			script.Parent.Parent.StartSignal:play()
			hazardson = true
			repeat
				neonright.BrickColor=on
				neonleft.BrickColor=on
				neonright.Material = "Neon"
				rightfront.Material = "Neon"
				neonleft.Material = "Neon"
				neonleft.Transparency=0
				neonright.Transparency=0
				leftfront.Material = "Neon"
				component.TurnSignal:play()
				rightlight.Enabled = true
				leftlight.Enabled = true
				leftgui.ImageTransparency=0
				rightgui.ImageTransparency=0
				wait(signalblinktime)
				neonleft.Transparency=1
				neonright.Transparency=1
				neonright.BrickColor=off
				neonleft.BrickColor=off
				leftgui.ImageTransparency=1
				rightgui.ImageTransparency=1
				component.TurnSignal:play()
				neonright.Material = "Sand"
				rightfront.Material = "Sand"
				neonleft.Material = "Sand"
				leftfront.Material = "Sand"
				rightlight.Enabled = false
				leftlight.Enabled = false
				wait(signalblinktime)
			until
			hazardson == false
		elseif hazardson == true then
			hazardson = false
			component.TurnSignal:stop()
			rightlight.Enabled = false
			leftlight.Enabled = false
			wait(0.05)
			script.Parent.Parent.StopSignal:play()
		end
	end
end)
