local l=script.Parent.Parent local s=script.Parent.Parent.Parent.Parent.Car.Value local L=game.Players.LocalPlayer:GetMouse()local Q="\122"local H="\099"local t="\120"local h=false local b=false local k=false local z=s.Body.Lights.Left.TurnSignal.TSL local P=s.Body.Lights.Right.TurnSignal.TSL local v=s.Body.Lights.Left.TurnSignal2 local V=s.Body.Lights.Right.TurnSignal2 local S=.32 local e=s.Body.Lights.Left.TurnSignal local M=s.Body.Lights.Right.TurnSignal local g=BrickColor.New("\078\101\119 \089\101\108\108\101\114")local a=BrickColor.New("\077\101\100\105\117\109 \115\116\111\110\101 \103\114\101\121")L.KeyDown:connect(function(s)local L=string.lower(s)if L==Q then if b==false then b=true repeat e.BrickColor=g z.Enabled=true e.Material="\078\101\111\110"v.Material="\078\101\111\110"l.TurnSignal:play()wait(S)e.BrickColor=a l.TurnSignal:play()e.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"v.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"z.Enabled=false wait(S)until b==false or k==true elseif b==true or k==true then b=false l.TurnSignal:stop()z.Enabled=false end elseif L==H then if k==false then k=true repeat M.BrickColor=g P.Enabled=true M.Material="\078\101\111\110"V.Material="\078\101\111\110"l.TurnSignal:play()wait(S)M.BrickColor=a l.TurnSignal:play()M.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"V.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"P.Enabled=false wait(S)until k==false or b==true elseif k==true or b==true then k=false l.TurnSignal:stop()P.Enabled=false end elseif L==t then if h==false then h=true repeat M.BrickColor=g e.BrickColor=g M.Material="\078\101\111\110"V.Material="\078\101\111\110"e.Material="\078\101\111\110"v.Material="\078\101\111\110"l.TurnSignal:play()P.Enabled=true z.Enabled=true wait(S)M.BrickColor=a e.BrickColor=a l.TurnSignal:play()M.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"V.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"v.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"P.Enabled=false z.Enabled=false wait(S)until h==false elseif h==true then h=false l.TurnSignal:stop()P.Enabled=false z.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 on =  BrickColor.New("New Yeller")
local off = BrickColor.New("Medium stone grey")
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)
