local o=script.Parent local W=script.Parent.Parent o.OnServerEvent:connect(function(o,x)if x.ToggleLight then if W.Body.Light.on.Value==true then W.Body.Light.on.Value=false else W.Body.Light.on.Value=true end elseif x.ToggleFog then if W.Body.Fog.on.Value==false then W.Body.Fog.on.Value=true else W.Body.Fog.on.Value=false end elseif x.ReverseOn then W.Body.Reverse.on.Value=true elseif x.ReverseOff then W.Body.Reverse.on.Value=false elseif x.EnableBrakes then W.Body.Brakes.on.Value=true elseif x.DisableBrakes then W.Body.Brakes.on.Value=false elseif x.ToggleLeftBlink then if W.Body.Left.on.Value==true then W.Body.Left.on.Value=false else W.Body.Left.on.Value=true end elseif x.ToggleRightBlink then if W.Body.Right.on.Value==true then W.Body.Right.on.Value=false else W.Body.Right.on.Value=true end elseif x.ToggleHazard then if W.Body.Hazards.on.Value==true then W.Body.Hazards.on.Value=false else W.Body.Hazards.on.Value=true end end end)


local event = script.Parent
local car=script.Parent.Parent


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['ToggleFog'] then
		if car.Body.Fog.on.Value==false then
			car.Body.Fog.on.Value=true
		else
			car.Body.Fog.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['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['ToggleHazard'] then
		if car.Body.Hazards.on.Value==true then
			car.Body.Hazards.on.Value=false
		else
			car.Body.Hazards.on.Value=true
		end
	end
end)
