Minecraft command block order I need help in redstone

minecraft-commandsminecraft-java-edition

I would like to make a command block that when he found someone(testfor) in a specific condition (like, survival mode) a redstone signal will appear and activate another command block(the command doesn't matter)

If you can please to post a picture of how this setup (in redstone) should look like I will be pleased.

Best Answer

Place a command block with the /testfor @p[whatever] command.
Then, a redstone comparator facing outwards from the command block.
From there, place your redstone or any redstone contraption that needs the input.

Note: If the comparator's signal isn't strong enough (1 block worth of power), place a Redstone Repeater after the comparator and any output should now have 15 strength.

A comparator only outputs a signal power of 1 if the command succeeds. Add a repeater to make that 15.