local F=script.Parent.Parent local O=script.Parent.Parent.Parent.Parent.Car.Value local e=game.Players.LocalPlayer:GetMouse()local h="\122"local Q="\099"local m="\120"local A=false local j=false local f=false local b=O.Body.Lights.Left.TurnSignal.TSL local E=O.Body.Lights.Right.TurnSignal.TSL local x=O.Body.Lights.Left.TurnSignal2 local Y=O.Body.Lights.Right.TurnSignal2 local W=.32 local X=O.Body.Lights.Left.TurnSignal local k=O.Body.Lights.Right.TurnSignal local Z=BrickColor.New("\078\101\111\110 \111\114\097\110\103\101")local g=BrickColor.New("\068\101\101\112 \111\114\097\110\103\101")e.KeyDown:connect(function(O)local e=string.lower(O)if e==h then if j==false then j=true repeat X.BrickColor=g x.BrickColor=g b.Enabled=true X.Material="\078\101\111\110"x.Material="\078\101\111\110"F.TurnSignal:play()wait(W)X.BrickColor=Z x.BrickColor=Z F.TurnSignal:play()X.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"x.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"b.Enabled=false wait(W)until j==false or f==true elseif j==true or f==true then j=false F.TurnSignal:stop()b.Enabled=false end elseif e==Q then if f==false then f=true repeat k.BrickColor=g Y.BrickColor=g E.Enabled=true k.Material="\078\101\111\110"Y.Material="\078\101\111\110"F.TurnSignal:play()wait(W)k.BrickColor=Z Y.BrickColor=Z F.TurnSignal:play()k.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"Y.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"E.Enabled=false wait(W)until f==false or j==true elseif f==true or j==true then f=false F.TurnSignal:stop()E.Enabled=false end elseif e==m then if A==false then A=true repeat k.BrickColor=g Y.BrickColor=g X.BrickColor=g x.BrickColor=g k.Material="\078\101\111\110"Y.Material="\078\101\111\110"X.Material="\078\101\111\110"x.Material="\078\101\111\110"F.TurnSignal:play()E.Enabled=true b.Enabled=true wait(W)k.BrickColor=Z Y.BrickColor=Z X.BrickColor=Z x.BrickColor=Z F.TurnSignal:play()k.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"Y.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"X.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"x.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"E.Enabled=false b.Enabled=false wait(W)until A==false elseif A==true then A=false F.TurnSignal:stop()E.Enabled=false b.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.TurnSignal2
local rightfront = car.Body.Lights.Right.TurnSignal2
local signalblinktime = 0.32
local neonleft = car.Body.Lights.Left.TurnSignal
local neonright = car.Body.Lights.Right.TurnSignal
local off =  BrickColor.New("Neon orange")
local on = BrickColor.New("Deep orange")
mouse.KeyDown:connect(function(lkey)
	local key = string.lower(lkey)
	if key == leftsignal then
		if lefton == false then
			lefton = true
			repeat
				neonleft.BrickColor = on
				leftfront.BrickColor = on
				leftlight.Enabled = true
				neonleft.Material = "Neon"
				leftfront.Material = "Neon"
				component.TurnSignal:play()
				wait(signalblinktime)
				neonleft.BrickColor = off
				leftfront.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
				rightfront.BrickColor = on
				rightlight.Enabled = true
				neonright.Material = "Neon"
				rightfront.Material = "Neon"
				component.TurnSignal:play()
				wait(signalblinktime)
				neonright.BrickColor = off
				rightfront.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
				rightfront.BrickColor = on
				neonleft.BrickColor = on
				leftfront.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
				rightfront.BrickColor = off
				neonleft.BrickColor = off
				leftfront.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)
