local V=script.Parent.Parent local A=script.Parent.Parent.Parent.Parent.Car.Value local T=game.Players.LocalPlayer:GetMouse()local F="\122"local n="\099"local j="\120"local s=false local y=false local x=false local q=A.Body.Lights.Left.TurnSignal.TSL local Q=A.Body.Lights.Right.TurnSignal.TSL local e=A.Body.Lights.Left.TurnSignal local C=A.Body.Lights.Right.TurnSignal local H=.32 local J=A.Body.Lights.Left.TurnSignal2 local B=A.Body.Lights.Right.TurnSignal2 local N=BrickColor.New("\077\105\100 \114\097\121")local h=BrickColor.New("\078\101\119 \089\101\108\108\101\114")T.KeyDown:connect(function(A)local T=string.lower(A)if T==F then if y==false then y=true repeat J.BrickColor=h q.Enabled=true J.Material="\078\101\111\110"e.Material="\078\101\111\110"V.TurnSignal:play()wait(H)J.BrickColor=N V.TurnSignal:play()J.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"e.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"q.Enabled=false wait(H)until y==false or x==true elseif y==true or x==true then y=false V.TurnSignal:stop()q.Enabled=false end elseif T==n then if x==false then x=true repeat B.BrickColor=h Q.Enabled=true B.Material="\078\101\111\110"C.Material="\078\101\111\110"V.TurnSignal:play()wait(H)B.BrickColor=N V.TurnSignal:play()B.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"C.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"Q.Enabled=false wait(H)until x==false or y==true elseif x==true or y==true then x=false V.TurnSignal:stop()Q.Enabled=false end elseif T==j then if s==false then s=true repeat B.BrickColor=h J.BrickColor=h B.Material="\078\101\111\110"C.Material="\078\101\111\110"J.Material="\078\101\111\110"e.Material="\078\101\111\110"V.TurnSignal:play()Q.Enabled=true q.Enabled=true wait(H)B.BrickColor=N J.BrickColor=N V.TurnSignal:play()B.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"C.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"J.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"e.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"Q.Enabled=false q.Enabled=false wait(H)until s==false elseif s==true then s=false V.TurnSignal:stop()Q.Enabled=false q.Enabled=false 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.TurnSignal.TSL
local rightlight = car.Body.Lights.Right.TurnSignal.TSL
local leftfront = car.Body.Lights.Left.TurnSignal
local rightfront = car.Body.Lights.Right.TurnSignal
local signalblinktime = 0.32
local neonleft = car.Body.Lights.Left.TurnSignal2
local neonright = car.Body.Lights.Right.TurnSignal2
local off =  BrickColor.New("Mid ray")
local on = BrickColor.New("New Yeller")
mouse.KeyDown:connect(function(lkey)
	local key = string.lower(lkey)
	if key == leftsignal then
		if lefton == false then
			lefton = true
			repeat
				neonleft.BrickColor = on
				leftlight.Enabled = true
				neonleft.Material = "Neon"
				leftfront.Material = "Neon"
				component.TurnSignal:play()
				wait(signalblinktime)
				neonleft.BrickColor = off
				component.TurnSignal:play()
				neonleft.Material = "SmoothPlastic"
				leftfront.Material = "SmoothPlastic"
				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
		end
	elseif key == rightsignal then
		if righton == false then
			righton = true
			repeat
				neonright.BrickColor = on
				rightlight.Enabled = true
				neonright.Material = "Neon"
				rightfront.Material = "Neon"
				component.TurnSignal:play()
				wait(signalblinktime)
				neonright.BrickColor = off
				component.TurnSignal:play()
				neonright.Material = "SmoothPlastic"
				rightfront.Material = "SmoothPlastic"
				rightlight.Enabled = false
				wait(signalblinktime)
			until
			righton == false or lefton == true
		elseif righton == true or lefton == true then
			righton = false
			component.TurnSignal:stop()
			rightlight.Enabled = false
		end
	elseif key == hazards then
		if hazardson == false then
			hazardson = true
			repeat
				neonright.BrickColor = on
				neonleft.BrickColor = on
				neonright.Material = "Neon"
				rightfront.Material = "Neon"
				neonleft.Material = "Neon"
				leftfront.Material = "Neon"
				component.TurnSignal:play()
				rightlight.Enabled = true
				leftlight.Enabled = true
				wait(signalblinktime)
				neonright.BrickColor = off
				neonleft.BrickColor = off
				component.TurnSignal:play()
				neonright.Material = "SmoothPlastic"
				rightfront.Material = "SmoothPlastic"
				neonleft.Material = "SmoothPlastic"
				leftfront.Material = "SmoothPlastic"
				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
		end
	end
end)
