Back to Blog
Coding for Kids

Build a Simple Chatbot in Scratch (Ages 9–12): Step-by-Step Dialogue Game

A kid-friendly Scratch chatbot project for ages 9–12 with step-by-step blocks, branching dialogue, and tips parents can use at home.

Build a Simple Chatbot in Scratch (Ages 9–12): Step-by-Step Dialogue Game
March 6, 2026
8 min read
#Scratch#Ages 9-12#Project

Build a Simple Chatbot in Scratch: What Kids Will Make

A chatbot doesn’t have to be complicated. In this Scratch chatbot project, your child (ages 9–12) will build an interactive character that asks questions, “listens” to answers, and responds with different replies—like a mini choose-your-own-adventure conversation.

This is a great first step toward understanding how real chatbots work: they use rules, conversation flow, and context to decide what to say next. In Scratch, we’ll do it with beginner-friendly blocks—no typing required.

By the end, your child will have an interactive dialogue game in Scratch that includes:

  • A chatbot sprite with a welcoming intro
  • Multiple questions using ask [ ] and wait
  • Branching responses using if/else
  • A “topic menu” so the player can choose what to talk about
  • Optional upgrades like mood, points, and a reset button

Parents: the best part is that this project naturally builds skills like reading comprehension, logic, and debugging—without feeling like “school.”

Before You Start: Setup, Skills, and Project Plan

What you need:

  • Scratch (online at scratch.mit.edu or the desktop app)
  • About 30–60 minutes
  • A child who can read short prompts and type short answers

Scratch blocks we’ll use (kid-friendly explanations):

  • say [ ] — the chatbot talks
  • ask [ ] and wait — the chatbot asks and stores the answer
  • answer — Scratch’s built-in “what the user typed” bubble
  • if/else — makes decisions
  • broadcast — sends a message to switch scenes or conversation topics (optional but powerful)
  • variables — memory like score or mood (optional)

Here’s a simple plan you can follow. If your child likes checklists, this helps them stay on track.

Step What you’ll build Scratch blocks you’ll use Time (approx.)
1 Chatbot character + greeting when green flag clicked, say 5–10 min
2 First question + response ask and wait, answer 10 min
3 Branching conversation if/else + comparisons 10–15 min
4 Topic menu (talk about jokes/help/facts) ask and wait, if/else or broadcast 10–15 min
5 Upgrades (points, mood, restart) variables, repeat, custom blocks (optional) 10–20 min

Parent tip: Encourage “tiny tests.” After every small change, click the green flag and try it. Scratch projects break less when kids test often.

Step-by-Step: How to Make a Chatbot in Scratch

Step 1: Choose your chatbot and set the scene

  1. Open Scratch and start a new project.
  2. Delete the cat if your child wants a different character, or keep it.
  3. Pick a friendly sprite (Robot, Alien, or a custom one).
  4. Choose a background (a bedroom, classroom, space station—anything).

In your chatbot sprite, add this starter script:

  • when green flag clicked
  • say [Hi! I’m ChatBuddy. What’s your name?] for (2) seconds
  • ask [Type your name:] and wait
  • say (join [Nice to meet you, ] (answer)) for (2) seconds

Now your chatbot already feels personal.

Step 2: Add a simple question-and-answer loop

Next, we’ll add a “menu” question. This turns your project into an interactive dialogue game Scratch kids can replay.

Add:

  • ask [What do you want to talk about? (joke / fact / help)] and wait

Now we need Scratch to check what the player typed. Use if/else blocks.

Create this logic (in plain language):

  • If they type “joke” → tell a joke
  • Else if they type “fact” → share a fact
  • Else → offer help and show options again

In Scratch, you’ll likely build:

  • if <(answer) = [joke]> then
    • say [Why did the computer go to the doctor? Because it had a virus!] for (3) seconds
  • else
    • if <(answer) = [fact]> then
      • say [Fun fact: Octopuses have three hearts!] for (3) seconds
    • else
      • say [I can do: joke, fact, or help. Try typing one!] for (3) seconds

Make it more forgiving (highly recommended): Kids will type “Joke” or “jokes” or “fact!”

  • Suggest they type exactly one of the options
  • Or add extra checks like:
    • if <(answer) = [Joke]> then (not perfect)
    • Better upgrade (optional): use a “lowercase” trick by asking them to type in lowercase, or teach them to copy the words.

Step 3: Turn it into a real chatbot conversation (branching)

To feel like a chatbot, your sprite should ask a follow-up question.

After telling a joke, add:

  • ask [Do you want another joke? (yes/no)] and wait
  • if <(answer) = [yes]> then
    • say [Okay! What do you call a computer that sings? A Dell!] for (3) seconds
  • else
    • say [No problem! Pick another topic: joke / fact / help] for (3) seconds

This is branching dialogue: the conversation changes based on the player’s input.

Debugging moment (very common): If it always goes to the “else,” check spelling. Scratch compares text exactly.

Step 4: Keep the chatbot running with a repeat loop

Right now, your chatbot asks once and stops. Let’s make it replayable.

Wrap the topic menu in a loop:

  • when green flag clicked
  • greeting/name
  • forever
    • ask [Choose: joke / fact / help / bye] and wait
    • if <(answer) = [bye]> then
      • say [Bye! Come chat again soon.] for (2) seconds
      • stop [all]
    • else if <(answer) = [joke]> then ...
    • else if <(answer) = [fact]> then ...
    • else ...

Now it’s an actual Scratch coding project for kids 9-12 that feels like a simple “AI chatbot,” even though it’s rule-based.

Step 5 (Optional but awesome): Add “mood” or points like a game

Kids love feedback. Add a variable called friendship or mood.

Ideas:

  • Start friendship at 0
  • If the player says something kind, add points
  • If they type “help,” your bot becomes more helpful

Example:

  • Create variable: friendship
  • set [friendship v] to (0) at start
  • Add a kindness check:
    • ask [How are you feeling today? (good/okay/bad)] and wait
    • If goodchange [friendship v] by (1) and say something upbeat
    • If bad → say something supportive like “That’s tough. Want a joke or a fact?”

This is a gentle intro to how computers can “store information” and respond based on it—one of the core ideas behind beginner AI chatbot for kids activities.

Make It Better: Upgrades That Teach Real Skills

Once the basic chatbot works, upgrades are where the learning really sticks. Here are improvements that feel like game features but teach big concepts.

Easy upgrades (10 minutes):

  • Add more topics: sports, space, pets, music
  • Add more jokes/facts so it doesn’t repeat
  • Add a “restart” option: type restart to reset the conversation

Intermediate upgrades (20–30 minutes):

  • Use broadcast [topic_joke] and separate scripts for each topic
  • Add a score for completing a conversation
  • Add “typing effect”: say short messages in a row for drama

Conversation design tips (this is where kids get creative):

  • Keep prompts short and clear
  • Offer choices in parentheses (kids can copy them)
  • Add at least one “I didn’t understand that” response
  • Make the bot feel friendly and consistent (same tone)

Common issues and quick fixes:

  • If your bot gets stuck: make sure your loop is forever and the ask block is inside it.
  • If it “ignores” answers: confirm you’re checking answer, not a variable you forgot to set.
  • If it’s too strict: allow multiple valid inputs (yes / yeah / y).

Next Steps: Make It a Mini Chatbot Game (and Keep Learning)

To turn this into a polished interactive dialogue game Scratch kids are proud to share, try this mini checklist:

  • Add a title screen: say [Welcome to ChatBuddy!]
  • Add 3 topics with at least 2 responses each
  • Add one follow-up question per topic
  • Add a bye option that ends cleanly
  • Test it like a player: type weird inputs on purpose and see what happens

If you want a simple weekly routine at home:

  • Day 1: Build the basic menu (joke/fact/help)
  • Day 2: Add branching questions and a bye option
  • Day 3: Add points/mood and 2 new topics
  • Day 4: Let your child rewrite the chatbot’s personality (robot, wizard, coach, detective)

When your child is done, encourage them to:

  • Click Share in Scratch
  • Ask a friend or family member to “playtest” and give one suggestion
  • Update the chatbot based on feedback (this is real software development!)

Want more guided projects like this? At Intellect Council, we turn coding into bite-sized missions kids actually finish—so they build skills and confidence at the same time.

Key Takeaways

  • A Scratch chatbot is a fun way for ages 9–12 to learn inputs (ask/answer), decisions (if/else), and loops (forever).
  • Branching dialogue plus a topic menu turns a simple script into a replayable interactive dialogue game.
  • Small upgrades like points, mood, and broadcasts teach “real” programming concepts without overwhelming beginners.
Toshendra Sharma

Auther

Toshendra Sharma