local Y=script.Parent.Parent local u=script.Parent.Parent.Parent.Parent.Car.Value local d=game.Players.LocalPlayer:GetMouse()local R="\122"local T="\099"local n="\120"local P=false local J=false local j=false local h=u.Body.Lights.Left.TurnSignal.TSL local W=u.Body.Lights.Right.TurnSignal.TSL local l=u.Body.Lights.Left.TurnSignal2 local c=u.Body.Lights.Right.TurnSignal2 local C=.32 local N=u.Body.Lights.Left.TurnSignal local a=u.Body.Lights.Right.TurnSignal local D=BrickColor.New("\077\105\100 \103\114\097\121")local s=BrickColor.New("\068\101\101\112 \111\114\097\110\103\101")d.KeyDown:connect(function(u)local d=string.lower(u)if d==R then if J==false then J=true repeat N.BrickColor=s l.BrickColor=s h.Enabled=true N.Material="\078\101\111\110"l.Material="\078\101\111\110"Y.TurnSignal:play()wait(C)N.BrickColor=D l.BrickColor=D Y.TurnSignal:play()N.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"l.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"h.Enabled=false wait(C)until J==false or j==true elseif J==true or j==true then J=false Y.TurnSignal:stop()h.Enabled=false end elseif d==T then if j==false then j=true repeat a.BrickColor=s c.BrickColor=s W.Enabled=true a.Material="\078\101\111\110"c.Material="\078\101\111\110"Y.TurnSignal:play()wait(C)a.BrickColor=D c.BrickColor=D Y.TurnSignal:play()a.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"W.Enabled=false wait(C)until j==false or J==true elseif j==true or J==true then j=false Y.TurnSignal:stop()W.Enabled=false end elseif d==n then if P==false then P=true repeat a.BrickColor=s c.BrickColor=s N.BrickColor=s l.BrickColor=s a.Material="\078\101\111\110"c.Material="\078\101\111\110"N.Material="\078\101\111\110"l.Material="\078\101\111\110"Y.TurnSignal:play()W.Enabled=true h.Enabled=true wait(C)a.BrickColor=D c.BrickColor=D N.BrickColor=D l.BrickColor=D Y.TurnSignal:play()a.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"N.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"l.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"W.Enabled=false h.Enabled=false wait(C)until P==false elseif P==true then P=false Y.TurnSignal:stop()W.Enabled=false h.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("Mid gray")
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)
