local q=script.Parent local U=script.Parent.Parent local Q=0 q.OnServerEvent:connect(function(q,T)if T.ToggleLight then if U.Body.Light.on.Value==true then U.Body.Light.on.Value=false else U.Body.Light.on.Value=true end elseif T.EnableBrakes then U.Body.Lights.Brake.Value=true elseif T.DisableBrakes then U.Body.Lights.Brake.Value=false elseif T.ToggleLeftBlink then if U.Body.Lights.Left.Value==true then U.Body.Lights.Left.Value=false else U.Body.Lights.Left.Value=true U.Body.Lights.Right.Value=false end elseif T.ToggleRightBlink then if U.Body.Lights.Right.Value==true then U.Body.Lights.Right.Value=false else U.Body.Lights.Right.Value=true U.Body.Lights.Left.Value=false end elseif T.ReverseOn then U.Body.Lights.Reverse.Value=true elseif T.ReverseOff then U.Body.Lights.Reverse.Value=false elseif T.ToggleStandlicht then if Q==0 then Q=2 U.Body.Lights.Headlights.Value=true elseif Q==1 then Q=2 U.Body.Lights.Headlights.Value=true elseif Q==2 then Q=3 U.Body.Lights.HiBeams.Value=true elseif Q==3 then Q=1 U.Body.Lights.Headlights.Value=false U.Body.Lights.HiBeams.Value=false end elseif T.ToggleHazards then if U.Body.Lights.Hazards==false then U.Body.Lights.Right.Value=false U.Body.Lights.Left.Value=false elseif U.Body.Lights.Hazards==true then U.Body.Lights.Right.Value=true U.Body.Lights.Left.Value=true end end end)
-- Testing AC FE support

local event = script.Parent
local car = script.Parent.Parent
local LichtNum = 0

event.OnServerEvent:connect(function(player, data)
	if data["ToggleLight"] then
		if car.Body.Light.on.Value == true then
			car.Body.Light.on.Value = false
		else
			car.Body.Light.on.Value = true
		end
	elseif data["EnableBrakes"] then
		car.Body.Lights.Brake.Value = true
	elseif data["DisableBrakes"] then
		car.Body.Lights.Brake.Value = false
	elseif data["ToggleLeftBlink"] then
		if car.Body.Lights.Left.Value == true then
			car.Body.Lights.Left.Value = false
		else
			car.Body.Lights.Left.Value = true
			car.Body.Lights.Right.Value = false
		end
	elseif data["ToggleRightBlink"] then
		if car.Body.Lights.Right.Value == true then
			car.Body.Lights.Right.Value = false
		else
			car.Body.Lights.Right.Value = true
			car.Body.Lights.Left.Value = false
		end
	elseif data["ReverseOn"] then
		car.Body.Lights.Reverse.Value = true
	elseif data["ReverseOff"] then
		car.Body.Lights.Reverse.Value = false
	elseif data["ToggleStandlicht"] then
		if LichtNum == 0 then
			LichtNum = 2
			car.Body.Lights.Headlights.Value = true
		elseif LichtNum == 1 then
			LichtNum = 2
			car.Body.Lights.Headlights.Value = true
		elseif LichtNum == 2 then
			LichtNum = 3
			car.Body.Lights.HiBeams.Value = true
		elseif LichtNum == 3 then
			LichtNum = 1
			car.Body.Lights.Headlights.Value = false
			car.Body.Lights.HiBeams.Value = false
		end
	elseif data["ToggleHazards"] then
		if car.Body.Lights.Hazards == false then
			car.Body.Lights.Right.Value = false
			car.Body.Lights.Left.Value = false
		elseif car.Body.Lights.Hazards == true then
			car.Body.Lights.Right.Value = true
			car.Body.Lights.Left.Value = true
		end
	end
end)
