
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 talksask [ ] and wait— the chatbot asks and stores the answeranswer— Scratch’s built-in “what the user typed” bubbleif/else— makes decisionsbroadcast— sends a message to switch scenes or conversation topics (optional but powerful)variables— memory likescoreormood(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
- Open Scratch and start a new project.
- Delete the cat if your child wants a different character, or keep it.
- Pick a friendly sprite (Robot, Alien, or a custom one).
- Choose a background (a bedroom, classroom, space station—anything).
In your chatbot sprite, add this starter script:
when green flag clickedsay [Hi! I’m ChatBuddy. What’s your name?] for (2) secondsask [Type your name:] and waitsay (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]> thensay [Why did the computer go to the doctor? Because it had a virus!] for (3) seconds
elseif <(answer) = [fact]> thensay [Fun fact: Octopuses have three hearts!] for (3) seconds
elsesay [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 waitif <(answer) = [yes]> thensay [Okay! What do you call a computer that sings? A Dell!] for (3) seconds
elsesay [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
foreverask [Choose: joke / fact / help / bye] and waitif <(answer) = [bye]> thensay [Bye! Come chat again soon.] for (2) secondsstop [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
friendshipat 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
good→change [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
restartto reset the conversation
Intermediate upgrades (20–30 minutes):
- Use
broadcast [topic_joke]and separate scripts for each topic - Add a
scorefor 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
foreverand theaskblock 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
byeoption 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
byeoption - 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.

Auther
Toshendra Sharma