local f=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local V=game:GetService("\082\117\110\083\101\114\118\105\099\101")local X=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local n=game.Players.LocalPlayer local K=n.Character or n.CharacterAdded:Wait()local A=script.Parent.Parent:WaitForChild("\086\097\108\117\101\115")local r=script.Parent.Parent.Car.Value local i=r:WaitForChild("\068\114\105\118\101\083\101\097\116")local q=require(r:WaitForChild("\065-\067\104\097\115\115\105\115 \084\117\110\101"))local z=A.Parent:WaitForChild("\073\115\079\110")local x=r:WaitForChild("\076\105\103\104\116\069\118\101\110\116")local k=script.Values.Left local P=script.Values.Right local j=script.Values.Hazard local u=script.Values.RunningLights local E=script.Values.Headlights local F=false local c=1 local G=false local e=false local b=false local H=false local g=TweenInfo.new(.5,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false,0)local N=TweenInfo.new(Indicator_Flash_Rate/2.5,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false,0)function input(f,V)if not V then if f.KeyCode==Headlights then if E.Value==0 then E.Value=1 x:FireServer("\072\101\097\100\108\105\103\104\116\115",Low_Beam_Brightness,.2,48,e,Popups_Enabled,Headlight_Type,E.Value)x:FireServer("\082\101\097\114\076\105\103\104\116\115",Rear_Light_Type,Rear_Light_Brightness,.2,Trunk_Lights)if b then x:FireServer("\070\111\103\076\105\103\104\116\115",Fog_Light_Brightness,.02,Fog_Light_Type);(X:Create(script.Parent.FogLights,g,{ImageTransparency=0})):Play()end;(X:Create(script.Parent.LowBeams,g,{ImageTransparency=0})):Play()elseif E.Value==1 then E.Value=2 x:FireServer("\072\101\097\100\108\105\103\104\116\115",High_Beam_Brightness,.02,60,e,Popups_Enabled,Headlight_Type,E.Value);(X:Create(script.Parent.LowBeams,g,{ImageTransparency=1})):Play();(X:Create(script.Parent.HighBeams,g,{ImageTransparency=0})):Play()elseif E.Value==2 then E.Value=0 x:FireServer("\072\101\097\100\108\105\103\104\116\115",0,1,60,e,Popups_Enabled,Headlight_Type,E.Value)x:FireServer("\082\101\097\114\076\105\103\104\116\115",Rear_Light_Type,0,1,Trunk_Lights)x:FireServer("\070\111\103\076\105\103\104\116\115",0,1,Fog_Light_Type);(X:Create(script.Parent.LowBeams,g,{ImageTransparency=1})):Play();(X:Create(script.Parent.HighBeams,g,{ImageTransparency=1})):Play();(X:Create(script.Parent.FogLights,g,{ImageTransparency=1})):Play()end if Plate_Lights then if E.Value>=1 then x:FireServer("\080\108\097\116\101\076\105\103\104\116\115",true,Plate_Light_Type)else x:FireServer("\080\108\097\116\101\076\105\103\104\116\115",false,Plate_Light_Type)end end elseif f.KeyCode==Popups then if Popups_Enabled then if H==false then x:FireServer("\080\111\112\117\112\115",true,Popups_Enabled,Popup_Hinge_Angle)H=true else x:FireServer("\080\111\112\117\112\115",false,Popups_Enabled,Popup_Hinge_Angle)H=false end end elseif f.KeyCode==RunningLights then if not e then e=true;(X:Create(script.Parent.ParkLights,g,{ImageTransparency=0})):Play()else e=false;(X:Create(script.Parent.ParkLights,g,{ImageTransparency=1})):Play()end if E.Value==0 then x:FireServer("\072\101\097\100\108\105\103\104\116\115",0,1,60,e,Popups_Enabled,Headlight_Type,E.Value)end elseif f.KeyCode==FogLights then if E.Value>0 then if not b then x:FireServer("\070\111\103\076\105\103\104\116\115",Fog_Light_Brightness,.02,Fog_Light_Type);(X:Create(script.Parent.FogLights,g,{ImageTransparency=0})):Play()b=true else x:FireServer("\070\111\103\076\105\103\104\116\115",0,1,Fog_Light_Type);(X:Create(script.Parent.FogLights,g,{ImageTransparency=1})):Play()b=false end else if not b then b=true else b=false end end elseif f.KeyCode==Flash then if not G then end elseif f.KeyCode==SignalLeft then if not k.Value then k.Value=true script.StackOn:Play()else k.Value=false script.StackOff:Play()end elseif f.KeyCode==SignalRight then if not P.Value then P.Value=true script.StackOn:Play()else P.Value=false script.StackOff:Play()end elseif f.KeyCode==Hazards then if not j.Value then j.Value=true else j.Value=false end end end end
--- DONT TOUCH ---

local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local Values = script.Parent.Parent:WaitForChild("Values")
local car = script.Parent.Parent.Car.Value
local DriveSeat = car:WaitForChild("DriveSeat")
local Tune = require(car:WaitForChild("A-Chassis Tune"))
local IsOn = Values.Parent:WaitForChild("IsOn")
local LightEvent = car:WaitForChild("LightEvent")

local LI = script.Values.Left
local RI = script.Values.Right
local H = script.Values.Hazard
local RL = script.Values.RunningLights
local HL = script.Values.Headlights

local setup = false
local current_seq_seg = 1
local flashing = false
local parklightActive = false
local fogActive = false
local popupsActive = false

local gui_tweeninfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local indgui_tweeninfo =
	TweenInfo.new(Indicator_Flash_Rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

function input(key, gameprocessed)
	if not gameprocessed then
		if key.KeyCode == Headlights then
			if HL.Value == 0 then
				HL.Value = 1
				LightEvent:FireServer(
					"Headlights",
					Low_Beam_Brightness,
					0.2,
					48,
					parklightActive,
					Popups_Enabled,
					Headlight_Type,
					HL.Value
				)
				LightEvent:FireServer("RearLights", Rear_Light_Type, Rear_Light_Brightness, 0.2, Trunk_Lights)
				if fogActive then
					LightEvent:FireServer("FogLights", Fog_Light_Brightness, 0.02, Fog_Light_Type)
					TweenService:Create(script.Parent.FogLights, gui_tweeninfo, { ImageTransparency = 0 }):Play()
				end
				TweenService:Create(script.Parent.LowBeams, gui_tweeninfo, { ImageTransparency = 0 }):Play()
			elseif HL.Value == 1 then
				HL.Value = 2
				LightEvent:FireServer(
					"Headlights",
					High_Beam_Brightness,
					0.02,
					60,
					parklightActive,
					Popups_Enabled,
					Headlight_Type,
					HL.Value
				)
				TweenService:Create(script.Parent.LowBeams, gui_tweeninfo, { ImageTransparency = 1 }):Play()
				TweenService:Create(script.Parent.HighBeams, gui_tweeninfo, { ImageTransparency = 0 }):Play()
			elseif HL.Value == 2 then
				HL.Value = 0
				LightEvent:FireServer("Headlights", 0, 1, 60, parklightActive, Popups_Enabled, Headlight_Type, HL.Value)
				LightEvent:FireServer("RearLights", Rear_Light_Type, 0, 1, Trunk_Lights)
				LightEvent:FireServer("FogLights", 0, 1, Fog_Light_Type)
				TweenService:Create(script.Parent.LowBeams, gui_tweeninfo, { ImageTransparency = 1 }):Play()
				TweenService:Create(script.Parent.HighBeams, gui_tweeninfo, { ImageTransparency = 1 }):Play()
				TweenService:Create(script.Parent.FogLights, gui_tweeninfo, { ImageTransparency = 1 }):Play()
			end
			if Plate_Lights then
				if HL.Value >= 1 then
					LightEvent:FireServer("PlateLights", true, Plate_Light_Type)
				else
					LightEvent:FireServer("PlateLights", false, Plate_Light_Type)
				end
			end
		elseif key.KeyCode == Popups then
			if Popups_Enabled then
				if popupsActive == false then
					LightEvent:FireServer("Popups", true, Popups_Enabled, Popup_Hinge_Angle)
					popupsActive = true
				else
					LightEvent:FireServer("Popups", false, Popups_Enabled, Popup_Hinge_Angle)
					popupsActive = false
				end
			end
		elseif key.KeyCode == RunningLights then
			if not parklightActive then
				parklightActive = true
				TweenService:Create(script.Parent.ParkLights, gui_tweeninfo, { ImageTransparency = 0 }):Play()
			else
				parklightActive = false
				TweenService:Create(script.Parent.ParkLights, gui_tweeninfo, { ImageTransparency = 1 }):Play()
			end
			if HL.Value == 0 then
				LightEvent:FireServer("Headlights", 0, 1, 60, parklightActive, Popups_Enabled, Headlight_Type, HL.Value)
			end
		elseif key.KeyCode == FogLights then
			if HL.Value > 0 then
				if not fogActive then
					LightEvent:FireServer("FogLights", Fog_Light_Brightness, 0.02, Fog_Light_Type)
					TweenService:Create(script.Parent.FogLights, gui_tweeninfo, { ImageTransparency = 0 }):Play()
					fogActive = true
				else
					LightEvent:FireServer("FogLights", 0, 1, Fog_Light_Type)
					TweenService:Create(script.Parent.FogLights, gui_tweeninfo, { ImageTransparency = 1 }):Play()
					fogActive = false
				end
			else
				if not fogActive then
					fogActive = true
				else
					fogActive = false
				end
			end
		elseif key.KeyCode == Flash then
			if not flashing then
			end
		elseif key.KeyCode == SignalLeft then
			if not LI.Value then
				LI.Value = true
				script.StackOn:Play()
			else
				LI.Value = false
				script.StackOff:Play()
			end
		elseif key.KeyCode == SignalRight then
			if not RI.Value then
				RI.Value = true
				script.StackOn:Play()
			else
				RI.Value = false
				script.StackOff:Play()
			end
		elseif key.KeyCode == Hazards then
			if not H.Value then
				H.Value = true
			else
				H.Value = false
			end
		end
	end
end
