NEW Explore the Scratch Block Dictionary, tutorials, textbook, and classroom guides

Start learning →

if < > then — Scratch Block Guide

📌 What you will learn

Runs the enclosed blocks only when the hexagonal condition is true.

What this block does

Runs the enclosed blocks only when the hexagonal condition is true.

React to key presses, collisions, high scores, or item pickups.

  • Category: Control Blocks
  • Key tip: Wrap "if" inside "forever" when you want continuous checking during gameplay.

Working Scratch example

Try building this small script in the Scratch editor, predict what will happen, then click the green flag to test it.

Example using if < > then
  1. When green flag clicked
  2. Forever
  3. If (score) 9> then
  4. Say You win!

Try it: Announces victory as soon as score reaches 10.

Related block guides

Explore other blocks in the same category or return to the full English Block Dictionary.

Back to Control Blocks See the overview and patterns for Control Blocks. Learn more → Scratch Block Dictionary (All Categories) Browse Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables, and Extensions. Learn more →

FAQ

When should I use "if < > then" in Scratch?

React to key presses, collisions, high scores, or item pickups. Wrap "if" inside "forever" when you want continuous checking during gameplay.

This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.