Directing only part of a script's output to piped application

Is there a way to keep the output of a script displayed on the terminal when it's run by itself, but suspend part of that output and only have a specific part delivered when it's piped to another script or program? I'm thinking something like the following pseudocode:

#!/bin/bash

command_that_produces_output   # I want the output of this only in the terminal, and suspended if piped 

another_command_that produces_output  # Same for this, only in the terminal

yet_another_command_that_produces_output  # The output of this should only go to the application the script is piped to

Look up what

[[ -t 0 ]]

,

 [[ -t 1 ]]

, etc. does.
Perhaps this is what you want.