local j=script.Parent local I=script.Parent.Parent local O=0 j.OnServerEvent:connect(function(j,w)if w.ToggleLight then if I.Body.Light.on.Value==true then I.Body.Light.on.Value=false else I.Body.Light.on.Value=true end elseif w.EnableBrakes then I.Body.Brakes.on.Value=true elseif w.DisableBrakes then I.Body.Brakes.on.Value=false elseif w.ToggleLeftBlink then if I.Body.Left.on.Value==true then I.Body.Left.on.Value=false else I.Body.Left.on.Value=true end elseif w.ToggleRightBlink then if I.Body.Right.on.Value==true then I.Body.Right.on.Value=false else I.Body.Right.on.Value=true end elseif w.ReverseOn then I.Body.Reverse.on.Value=true elseif w.ReverseOff then I.Body.Reverse.on.Value=false elseif w.ToggleStandlicht then if O==0 then O=2 I.Body.Headlight.on.Value=true elseif O==1 then O=2 I.Body.Headlight.on.Value=true elseif O==2 then O=3 I.Body.Highlight.on.Value=true elseif O==3 then O=1 I.Body.Highlight.on.Value=false I.Body.Headlight.on.Value=false end elseif w.ToggleHazards then if I.Body.hazards.Value==false then I.Body.hazards.Value=true wait(.35)I.Body.Left.on.Value=false I.Body.Right.on.Value=false wait(.35)I.Body.Left.on.Value=true I.Body.Right.on.Value=true elseif I.Body.hazards.Value==true then I.Body.hazards.Value=false I.Body.Left.on.Value=false I.Body.Right.on.Value=false 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
		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
		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.hazards.Value == false then
			car.Body.hazards.Value = true
			wait(.35)
			car.Body.Left.on.Value=false
			car.Body.Right.on.Value=false
			wait(.35)
			car.Body.Left.on.Value=true
			car.Body.Right.on.Value=true	
		elseif car.Body.hazards.Value == true then
			car.Body.hazards.Value = false
			car.Body.Left.on.Value=false
			car.Body.Right.on.Value=false
		end
	end
end)
