local c=script.Parent local m=script.Parent.Parent local V=0 c.OnServerEvent:connect(function(c,R)if R.ToggleLight then if m.Body.Light.on.Value==true then m.Body.Light.on.Value=false else m.Body.Light.on.Value=true end elseif R.EnableBrakes then m.Body.Brakes.on.Value=true elseif R.DisableBrakes then m.Body.Brakes.on.Value=false elseif R.ToggleLeftBlink then if m.Body.Left.on.Value==true then m.Body.Left.on.Value=false else m.Body.Left.on.Value=true end elseif R.ToggleRightBlink then if m.Body.Right.on.Value==true then m.Body.Right.on.Value=false else m.Body.Right.on.Value=true end elseif R.ToggleStandlicht then if V==0 then V=2 m.Body.Headlight.on.Value=true elseif V==1 then V=2 m.Body.Headlight.on.Value=true elseif V==2 then V=3 m.Body.Highlight.on.Value=true elseif V==3 then V=1 m.Body.Highlight.on.Value=false m.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['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)
