local c=script.Parent.Parent local g=script.Parent.Parent.Parent.Parent.Car.Value local Z=game.Players.LocalPlayer:GetMouse()local e="\122"local E="\099"local R="\120"local V=false local J=false local l=false local d=g.Body.Lights.Left.TurnSignal.TSL local A=g.Body.Lights.Right.TurnSignal.TSL local T=g.Body.Lights.Left.TurnSignal local X=g.Body.Lights.Right.TurnSignal local D=.32 local C=g.Body.Lights.Left.TurnSignal2 local i=g.Body.Lights.Right.TurnSignal2 local o=BrickColor.New("\077\105\100 \114\097\121")local y=BrickColor.New("\078\101\119 \089\101\108\108\101\114")Z.KeyDown:connect(function(g)local Z=string.lower(g)if Z==e then if J==false then J=true repeat C.BrickColor=y T.BrickColor=y d.Enabled=true C.Material="\078\101\111\110"T.Material="\078\101\111\110"c.TurnSignal:play()wait(D)T.BrickColor=o C.BrickColor=o c.TurnSignal:play()C.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"T.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"d.Enabled=false wait(D)until J==false or l==true elseif J==true or l==true then J=false c.TurnSignal:stop()d.Enabled=false end elseif Z==E then if l==false then l=true repeat i.BrickColor=y X.BrickColor=y A.Enabled=true i.Material="\078\101\111\110"X.Material="\078\101\111\110"c.TurnSignal:play()wait(D)X.BrickColor=o i.BrickColor=o c.TurnSignal:play()i.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"A.Enabled=false wait(D)until l==false or J==true elseif l==true or J==true then l=false c.TurnSignal:stop()A.Enabled=false end elseif Z==R then if V==false then V=true repeat i.BrickColor=y C.BrickColor=y T.BrickColor=y X.BrickColor=y i.Material="\078\101\111\110"X.Material="\078\101\111\110"C.Material="\078\101\111\110"T.Material="\078\101\111\110"c.TurnSignal:play()A.Enabled=true d.Enabled=true wait(D)T.BrickColor=o X.BrickColor=o i.BrickColor=o C.BrickColor=o c.TurnSignal:play()i.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"C.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"T.Material="\083\109\111\111\116\104\080\108\097\115\116\105\099"A.Enabled=false d.Enabled=false wait(D)until V==false elseif V==true then V=false c.TurnSignal:stop()A.Enabled=false d.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.TurnSignal
local rightfront = car.Body.Lights.Right.TurnSignal
local signalblinktime = 0.32
local neonleft = car.Body.Lights.Left.TurnSignal2
local neonright = car.Body.Lights.Right.TurnSignal2
local off =  BrickColor.New("Mid ray")
local on = BrickColor.New("New Yeller")
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)
				leftfront.BrickColor = off
				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
				rightfront.BrickColor = on
				rightlight.Enabled = true
				neonright.Material = "Neon"
				rightfront.Material = "Neon"
				component.TurnSignal:play()
				wait(signalblinktime)
				rightfront.BrickColor = off
				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
				leftfront.BrickColor = on
				rightfront.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)
				leftfront.BrickColor = off
				rightfront.BrickColor = off
				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)
