-- Used for cars, de activates when the user jumps --

plane.PilotSeat.ChildRemoved:connect(function(child)
	run=false
	cam.CameraType="Custom"
	cam.FieldOfView = 70
	CamV = ("third") 
end)
	
game:GetService("RunService").RenderStepped:connect(function()
	if run and CamV == "first" then
		local XLook=math.max(math.min(((mouse.X-(mouse.ViewSizeX/2))/200)^3,1),-1)
		local YLook=math.max(math.min(((mouse.Y-(mouse.ViewSizeY/2))/200)^3,1),-1)
		local LookOffset=player.Character.Head.CFrame:toWorldSpace(CFrame.new(0,0,-1)*CFrame.Angles(-YLook,-XLook,0))
		cam.CameraType="Scriptable"
		cam.CameraSubject=player.Character.Humanoid
		cam.CoordinateFrame=LookOffset
		
	elseif run and CamV == "second" then
		local XLook=math.max(math.min(((mouse.X-(mouse.ViewSizeX/2))/200)^3,1),-1)
		local YLook=math.max(math.min(((mouse.Y-(mouse.ViewSizeY/2))/200)^3,1),-1)
		local LookOffset=AimPart.CFrame:toWorldSpace(CFrame.new(0,0,0))
		cam.CameraType="Scriptable"
		cam.CameraSubject=player.Character.Humanoid
		cam.CoordinateFrame=LookOffset
	end
end)
	