Back to Blog
Coding for Kids

Build a Simple Chatbot in Scratch with AI Help (Ages 9–12)

A parent-friendly Scratch chatbot tutorial for kids (9–12) using AI help for Scratch coding—scripts, ideas, and debugging tips included.

Build a Simple Chatbot in Scratch with AI Help (Ages 9–12)
March 6, 2026
8 min read
#Scratch#Chatbots#Projects

What your child will build (and why chatbots are a great first AI-style project)

A chatbot is a program that “talks” with a user. In Scratch, we can build one without any complicated math—just friendly questions, smart replies, and a few blocks that make it feel interactive.

This coding project for kids in Scratch is perfect for ages 9–12 because it practices:

  • Inputs and outputs (asking questions, showing answers)
  • Variables (remembering a name or favorite thing)
  • Logic (if/else decisions)
  • Sequencing (a conversation that flows)
  • Debugging (fixing it when it says the wrong thing)

And here’s the fun twist: we’ll use AI help for Scratch coding—not to “do it for them,” but to:

  • Generate conversation ideas (greetings, jokes, trivia)
  • Suggest better wording
  • Help troubleshoot when something isn’t working

Think of AI as a supportive coach: your child still builds, tests, and improves the project.

Before you start: quick setup + a simple plan

You’ll need Scratch (online at scratch.mit.edu or the Scratch app). No special extensions required.

Create a new Scratch project and choose a sprite (the chatbot character). A cat works, but letting your child pick a character increases motivation.

Here’s the plan for our beginner Scratch programming with AI:

  • Step 1: Build a basic chat flow (greeting → question → reply)
  • Step 2: Add memory (remember the user’s name)
  • Step 3: Add “brainy” branching (different replies based on choices)
  • Step 4: Make it feel polished (looping, reset, friendliness)

A good chatbot feels like a conversation. A great one feels like it remembers you.

Materials checklist

  • Scratch account (optional but helpful for saving)
  • 20–40 minutes
  • Curiosity
  • Optional: an AI helper (like Intellect Council tools or a safe, parent-approved assistant)

Scratch chatbot tutorial for kids: build the first working version

Start with one sprite as the “bot.” We’ll create a script that triggers when the green flag is clicked.

1) The core conversation blocks

In Scratch, the key blocks you’ll use are:

  • Events: when green flag clicked
  • Looks: say [text] for [seconds]
  • Sensing: ask [question] and wait and answer
  • Control: wait, forever, if/else
  • Variables: create variables like name and mood

Script: Greeting + name

  1. Add: when green flag clicked
  2. Add: say [Hi! I’m Byte, your Scratch chatbot!] for 2 seconds
  3. Add: ask [What’s your name?] and wait
  4. Create a variable called name
  5. Add: set [name v] to (answer)
  6. Add: say (join [Nice to meet you, ] (name)) for 2 seconds

That’s already a chatbot: it asks, listens, and responds.

2) Add a menu (so the user can choose what to chat about)

Now we’ll ask what they want to do. Create a variable called choice.

Add these blocks after the greeting:

  • ask [What should we do? Type: joke, trivia, or advice] and wait
  • set [choice v] to (answer)

Then add branching logic:

  • if <(choice) = [joke]> then ... else ...

Inside each branch, add a response. For example:

  • Joke branch: say [Why did the computer sneeze? It had a virus!] for 3 seconds
  • Trivia branch: ask [Trivia time! What planet is known as the Red Planet?] and wait → check if answer contains “Mars”
  • Advice branch: say [Tip: Break big problems into tiny steps. That’s coding!] for 3 seconds

3) Make it forgiving (kids don’t type perfectly)

Scratch compares text exactly. If your child types “Joke” instead of “joke,” the bot may not understand.

Two easy ways to help:

  • Tell the user: “Type exactly: joke, trivia, advice.”
  • Or add extra checks like:
    • if <(choice) = [joke]> or <(choice) = [Joke]> then ...

If you want a more advanced improvement later, you can create a mini “synonyms list” by checking multiple words (fun challenge!).

Actionable build checklist (use this as you code)

Feature to add Scratch blocks you’ll use What it teaches Kid-friendly success check
Greeting say Sequencing Bot introduces itself clearly
Ask name + store ask and wait, answer, variable Memory via variables Bot says: “Nice to meet you, [name]”
Topic choice ask and wait, variable User input Typing “joke” triggers a joke
Branching replies if/else Logic Different choices lead to different responses
Trivia with feedback if/else, operators Conditions Bot says “Correct!” only for right answers
Loop the chat repeat/forever Iteration User can keep chatting without restarting

Using AI help for Scratch coding (without letting AI take over)

This is where many parents wonder: “Is using AI cheating?” Not if you use it the right way.

A good rule: AI can help your child think, but your child should still build the blocks.

Smart ways to use AI during this project

Use AI as a brainstorming partner:

  • Ask: “Give me 10 kid-friendly chatbot topics for a Scratch project.”
  • Ask: “Write 5 short jokes that are school-appropriate.”
  • Ask: “Suggest 3 trivia questions with answers for ages 9–12.”

Use AI as a debugging assistant:

  • “My Scratch chatbot always goes to the else branch. What should I check?”
  • “How do I store the user’s name in a variable?”
  • “Why is my if (answer) = (Mars) not working when I type ‘mars’?”

Use AI for improving conversation design:

  • “How can I make the chatbot sound friendlier in 1–2 short sentences?”
  • “Suggest a conversation flow that includes a greeting, a choice, and a goodbye.”

Copy-paste prompts you can give your child

These prompts encourage learning, not just answers:

  • “Explain what an if/else does in Scratch like I’m 10.”
  • “Give me hints, not the full solution, to make a Scratch chatbot loop.”
  • “Ask me 3 questions to help me design my chatbot’s personality.”

Parent tip: keep AI safe and focused

  • Use a child-appropriate tool and set clear rules.
  • Encourage your child to test each change right away in Scratch.
  • If AI suggests something confusing, ask it to simplify.

AI is most helpful when your child treats it like a coach: “Explain,” “Give options,” “Help me debug.”

Level up: make the chatbot feel “smart” (easy upgrades)

Once the basic bot works, these upgrades make it feel impressively interactive.

Upgrade 1: A conversation loop + goodbye

Wrap the “menu question” in a loop so the user can choose again.

A simple pattern:

  • Ask choice
  • Respond
  • Ask: “Do you want to chat again? yes/no”
  • If yes → repeat
  • If no → say goodbye and stop

Blocks to look for:

  • repeat until <(answer) = [no]>
  • stop all

Upgrade 2: Mood meter (a simple variable)

Create variable: mood.

  • Start with: set mood to 0
  • If user chooses “joke,” increase mood: change mood by 1
  • If they get trivia wrong, decrease mood: change mood by -1

Then the chatbot can comment:

  • If mood is high: “You’re on a roll!”
  • If mood is low: “No worries—try another!”

This is a gentle introduction to how real systems “track state.”

Upgrade 3: A mini knowledge base (multiple trivia questions)

Create a list of trivia questions and answers (Scratch Lists). If lists feel advanced, start with 3 fixed questions using separate ask blocks.

Key idea: a chatbot becomes more fun when it has variety.

Common issues (and quick fixes)

  • Problem: The bot doesn’t respond to “Joke” vs “joke.”
    • Fix: Add checks for both, or remind the user what to type.
  • Problem: The bot says the name wrong or forgets it.
    • Fix: Make sure you used set name to answer right after asking.
  • Problem: It skips questions.
    • Fix: Check you used ask ... and wait (not just say).
  • Problem: Everything happens too fast.
    • Fix: Add short wait blocks or say ... for 2 seconds.

Next Steps: build it today, then make it yours

To turn this into a full “how to make a chatbot in Scratch” success story, aim for a working version first, then personalize.

Your 30–45 minute game plan

  • 10 minutes: Build greeting + name memory
  • 10 minutes: Add choice menu (joke/trivia/advice)
  • 10 minutes: Add one branch you’re proud of (a great trivia question or a fun joke)
  • 10 minutes: Loop it so the user can keep chatting

Personalization ideas kids love

  • Give the bot a theme: space explorer, animal expert, sports coach, mystery detective
  • Add a “secret code” response (type “unicorn” to unlock a special message)
  • Add a score: +1 for correct trivia answers
  • Record your own sounds and add them to responses

A simple challenge (great for sharing)

Ask your child to add one new feature using AI help for Scratch coding:

  • “Make the chatbot tell different jokes each time.”
  • “Add a ‘help’ command that explains the menu.”
  • “Add a compliment that uses the person’s name.”

When your child finishes, have them:

  • Test it with a family member
  • Fix one bug they notice
  • Add one improvement they choose

That cycle—build, test, improve—is real programming, and it’s the best habit they can learn.

Key Takeaways

  • A Scratch chatbot teaches core coding skills: input/output, variables, if/else logic, and debugging.
  • AI help works best as a coach—use it for ideas, clearer wording, and troubleshooting while kids still place the blocks.
  • Small upgrades like loops, mood variables, and trivia branching make the chatbot feel “smart” fast.
Toshendra Sharma

Auther

Toshendra Sharma