local D=script.Parent.Parent local q=script.Parent.Parent.Parent.Parent.Car.Value local u=game.Players.LocalPlayer:GetMouse()local n="\122"local B="\099"local y="\120"local X=false local Z=false local e=false local g=q.Body.Lights.Left.TurnSignal.TSL local R=q.Body.Lights.Right.TurnSignal.TSL local m=q.Body.Lights.Left.TurnSignal2 local O=q.Body.Lights.Right.TurnSignal2 local l=.32 local f=q.Body.Lights.Left.TurnSignal local T=q.Body.Lights.Right.TurnSignal local L=BrickColor.New("\066\108\097\099\107")local N=BrickColor.New("\068\101\101\112 \111\114\097\110\103\101")local i=BrickColor.New("\066\114\105\103\104\116 \121\101\108\108\111\119")u.KeyDown:connect(function(q)local u=string.lower(q)if u==n then if Z==false then Z=true repeat f.BrickColor=N m.BrickColor=N g.Enabled=true f.Material="\078\101\111\110"m.Material="\078\101\111\110"D.TurnSignal:play()wait(l)f.BrickColor=L m.BrickColor=i D.TurnSignal:play()f.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"m.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"g.Enabled=false wait(l)until Z==false or e==true elseif Z==true or e==true then Z=false D.TurnSignal:stop()g.Enabled=false end elseif u==B then if e==false then e=true repeat T.BrickColor=N O.BrickColor=N R.Enabled=true T.Material="\078\101\111\110"O.Material="\078\101\111\110"D.TurnSignal:play()wait(l)T.BrickColor=L O.BrickColor=i D.TurnSignal:play()T.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"O.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"R.Enabled=false wait(l)until e==false or Z==true elseif e==true or Z==true then e=false D.TurnSignal:stop()R.Enabled=false end elseif u==y then if X==false then X=true repeat T.BrickColor=N O.BrickColor=N f.BrickColor=N m.BrickColor=N T.Material="\078\101\111\110"O.Material="\078\101\111\110"f.Material="\078\101\111\110"m.Material="\078\101\111\110"D.TurnSignal:play()R.Enabled=true g.Enabled=true wait(l)T.BrickColor=L O.BrickColor=i f.BrickColor=L m.BrickColor=i D.TurnSignal:play()T.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"O.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"f.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"m.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"R.Enabled=false g.Enabled=false wait(l)until X==false elseif X==true then X=false D.TurnSignal:stop()R.Enabled=false g.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("Black")
local on = BrickColor.New("Deep orange")
local off2 =  BrickColor.New("Bright yellow")
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 = off2
				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 = off2
				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 = off2
				neonleft.BrickColor = off
				leftfront.BrickColor = off2
				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)
