frontForceField.Touched:connect(function(R)onTouch(R,Vector3.new(0,-1,0))end)backForceField.Touched:connect(function(R)onTouch(R,Vector3.new(0,1,0))end)vehicle.Wheel_BackLeft.Touched:connect(function(R)onTouch(R,Vector3.new(1,0,0))end)vehicle.Wheel_FrontLeft.Touched:connect(function(R)onTouch(R,Vector3.new(1,0,0))end)vehicle.Wheel_BackRight.Touched:connect(function(R)onTouch(R,Vector3.new(-1,0,0))end)vehicle.Wheel_FrontRight.Touched:connect(function(R)onTouch(R,Vector3.new(-1,0,0))end)local R=false function checkIfVehicleIsDamaged()if(not frontForceField.Parent or not backForceField.Parent)and(not R and allowDamage)then R=true script.IsDamaged.Value=true vehicle.VehicleScript.Disabled=true vehicleSmoke.Enabled=true vehicle.VehicleSeat.MaxSpeed=0 vehicle.ExhaustPipe.Smoke.Enabled=false vehicle.Wheel_BackLeft:BreakJoints()vehicle.Wheel_FrontLeft:BreakJoints()vehicle.Wheel_BackRight:BreakJoints()vehicle.Wheel_FrontRight:BreakJoints()hood:BreakJoints()end end vehicle.ChildRemoved:connect(checkIfVehicleIsDamaged)
--vehicle.Nose.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, -1)) end)
--vehicle.Bumper_Front.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, -1)) end)
--vehicle.Bumper_Back.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, 1)) end)
--vehicle.Tailgate.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, 1)) end)
--vehicle.ExhaustPipe.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, 1)) end)

frontForceField.Touched:connect(function(hitPart)
	onTouch(hitPart, Vector3.new(0, -1, 0))
end)
backForceField.Touched:connect(function(hitPart)
	onTouch(hitPart, Vector3.new(0, 1, 0))
end)

vehicle.Wheel_BackLeft.Touched:connect(function(hitPart)
	onTouch(hitPart, Vector3.new(1, 0, 0))
end)
vehicle.Wheel_FrontLeft.Touched:connect(function(hitPart)
	onTouch(hitPart, Vector3.new(1, 0, 0))
end)
vehicle.Wheel_BackRight.Touched:connect(function(hitPart)
	onTouch(hitPart, Vector3.new(-1, 0, 0))
end)
vehicle.Wheel_FrontRight.Touched:connect(function(hitPart)
	onTouch(hitPart, Vector3.new(-1, 0, 0))
end)

local vehicleDamaged = false
function checkIfVehicleIsDamaged()
	if (not frontForceField.Parent or not backForceField.Parent) and not vehicleDamaged and allowDamage then
		vehicleDamaged = true
		script.IsDamaged.Value = true
		vehicle.VehicleScript.Disabled = true
		vehicleSmoke.Enabled = true
		vehicle.VehicleSeat.MaxSpeed = 0
		vehicle.ExhaustPipe.Smoke.Enabled = false
		-- Break Joints
		vehicle.Wheel_BackLeft:BreakJoints()
		vehicle.Wheel_FrontLeft:BreakJoints()
		vehicle.Wheel_BackRight:BreakJoints()
		vehicle.Wheel_FrontRight:BreakJoints()
		hood:BreakJoints()
	end
end

vehicle.ChildRemoved:connect(checkIfVehicleIsDamaged)
