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