local P=script.Parent.Parent local z=script.Parent.Parent.Parent.Parent.Car.Value local k=game.Players.LocalPlayer:GetMouse()local B="\122"local a="\099"local W="\120"local n=false local V=false local o=false local J=z.Body.Lights.Left.TurnSignal.TSL local p=z.Body.Lights.Right.TurnSignal.TSL local A=z.Body.Lights.Left.TurnSignal2 local i=z.Body.Lights.Right.TurnSignal2 local g=.32 local H=z.Body.Lights.Left.TurnSignal local F=z.Body.Lights.Right.TurnSignal local f=BrickColor.New("\077\105\100 \103\114\097\121")local I=BrickColor.New("\068\101\101\112 \111\114\097\110\103\101")k.KeyDown:connect(function(z)local k=string.lower(z)if k==B then if V==false then V=true repeat H.BrickColor=I J.Enabled=true H.Material="\078\101\111\110"A.Material="\078\101\111\110"P.TurnSignal:play()P.TurnSignal.Pitch=1.8 wait(g)H.BrickColor=f P.TurnSignal:play()P.TurnSignal.Pitch=1.6 H.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"A.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"J.Enabled=false wait(g)until V==false or o==true elseif V==true or o==true then V=false P.TurnSignal:stop()J.Enabled=false end elseif k==a then if o==false then o=true repeat F.BrickColor=I p.Enabled=true F.Material="\078\101\111\110"i.Material="\078\101\111\110"P.TurnSignal:play()P.TurnSignal.Pitch=1.8 wait(g)F.BrickColor=f P.TurnSignal:play()P.TurnSignal.Pitch=1.6 F.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"i.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"p.Enabled=false wait(g)until o==false or V==true elseif o==true or V==true then o=false P.TurnSignal:stop()p.Enabled=false end elseif k==W then if n==false then n=true repeat F.BrickColor=I H.BrickColor=I F.Material="\078\101\111\110"i.Material="\078\101\111\110"H.Material="\078\101\111\110"A.Material="\078\101\111\110"P.TurnSignal:play()P.TurnSignal.Pitch=1.8 p.Enabled=true J.Enabled=true wait(g)F.BrickColor=f H.BrickColor=f P.TurnSignal:play()P.TurnSignal.Pitch=1.6 F.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"i.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"H.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"A.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"p.Enabled=false J.Enabled=false wait(g)until n==false elseif n==true then n=false P.TurnSignal:stop()p.Enabled=false J.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
				leftlight.Enabled = true
				neonleft.Material = "Neon"
				leftfront.Material = "Neon"
				component.TurnSignal:play()
				component.TurnSignal.Pitch = 1.8				
				wait(signalblinktime)
				neonleft.BrickColor = off
				component.TurnSignal:play()
				component.TurnSignal.Pitch = 1.6				
				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()
				component.TurnSignal.Pitch = 1.8				
				wait(signalblinktime)
				neonright.BrickColor = off
				component.TurnSignal:play()
				component.TurnSignal.Pitch = 1.6				
				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()
				component.TurnSignal.Pitch = 1.8				
				rightlight.Enabled = true
				leftlight.Enabled = true
				wait(signalblinktime)
				neonright.BrickColor = off
				neonleft.BrickColor = off
				component.TurnSignal:play()
				component.TurnSignal.Pitch = 1.6				
				
				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)
