local l=script.Parent local V=script.Parent.Parent local C=0 l.OnServerEvent:connect(function(l,x)if x.ToggleLight then if V.Body.Light.on.Value==true then V.Body.Light.on.Value=false else V.Body.Light.on.Value=true end elseif x.EnableBrakes then V.Body.Brakes.on.Value=true elseif x.DisableBrakes then V.Body.Brakes.on.Value=false elseif x.ToggleLeftBlink then if V.Body.Left.on.Value==true then V.Body.Left.on.Value=false else V.Body.Left.on.Value=true V.Body.Right.on.Value=false end elseif x.ToggleRightBlink then if V.Body.Right.on.Value==true then V.Body.Right.on.Value=false else V.Body.Right.on.Value=true V.Body.Left.on.Value=false end elseif x.ReverseOn then V.Body.Reverse.on.Value=true elseif x.ReverseOff then V.Body.Reverse.on.Value=false elseif x.ToggleStandlicht then if C==0 then C=2 V.Body.Headlight.on.Value=true elseif C==1 then C=2 V.Body.Headlight.on.Value=true elseif C==2 then C=3 V.Body.Highlight.on.Value=true elseif C==3 then C=1 V.Body.Highlight.on.Value=false V.Body.Headlight.on.Value=false end elseif x.ToggleHazards then if V.Body.Right.on.Value==true and V.Body.Left.on.Value==true then V.Body.Right.on.Value=false V.Body.Left.on.Value=false else V.Body.Right.on.Value=true V.Body.Left.on.Value=true end end end)


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.Brakes.on.Value=true
	elseif data['DisableBrakes'] then
		car.Body.Brakes.on.Value=false
	elseif data['ToggleLeftBlink'] then
		if car.Body.Left.on.Value==true then
			car.Body.Left.on.Value=false
		else
			car.Body.Left.on.Value=true
			car.Body.Right.on.Value=false
		end
	elseif data['ToggleRightBlink'] then
		if car.Body.Right.on.Value==true then
			car.Body.Right.on.Value=false
		else
			car.Body.Right.on.Value=true
			car.Body.Left.on.Value=false
		end
	elseif data['ReverseOn'] then
		car.Body.Reverse.on.Value=true
	elseif data['ReverseOff'] then
		car.Body.Reverse.on.Value=false
	elseif data['ToggleStandlicht'] then
		if LichtNum == 0 then
			LichtNum = 2
			car.Body.Headlight.on.Value = true
		elseif LichtNum == 1 then
			LichtNum = 2
			car.Body.Headlight.on.Value = true
		elseif LichtNum == 2 then
			LichtNum = 3
			car.Body.Highlight.on.Value = true
		elseif LichtNum == 3 then
			LichtNum = 1
			car.Body.Highlight.on.Value = false
			car.Body.Headlight.on.Value = false
		end
		
		elseif data['ToggleHazards'] then
		if car.Body.Right.on.Value==true and car.Body.Left.on.Value==true then
			car.Body.Right.on.Value=false
			car.Body.Left.on.Value=false
		else
			car.Body.Right.on.Value=true
			car.Body.Left.on.Value=true
		end
		end
		end)
