
What You’re Building (and Why It’s a Great “First AI” Project)
A chatbot is a program that “talks” back. In real life, chatbots use advanced AI. But for ages 8–10, the best place to start is with a rules-based bot: it listens for a few keywords and replies with friendly, helpful messages.
This Scratch chatbot tutorial for kids is perfect because it teaches:
- Input → decision → output (a core coding pattern)
- Conversation rules (like “if the user says X, respond with Y”)
- Debugging (kids learn quickly that computers are very literal)
- Confidence: your child ends with a playable Scratch coding conversation game
Parent tip: If your child can type short sentences and read simple prompts, they can build this.
Before You Start: Plan the Conversation Rules
The secret to a fun chatbot project for kids (blocks-based) is not “more features”—it’s clear rules.
Start with a mini plan: pick a theme and decide what the bot should recognize.
Good themes for ages 8–10:
- A pet helper (cat, dog, dragon)
- A space guide (astronaut bot)
- A homework buddy (math cheerleader)
- A game NPC (a character who gives quests)
Here’s a simple set of conversation rules you can copy. The idea is: the bot checks the message for keywords and chooses a response.
| What the user might type | Keyword to check | Bot response idea | Extra tip for kids |
|---|---|---|---|
| “hi” “hello” “hey” | hi / hello / hey | “Hi! I’m AstroBot. What’s your name?” | Let the bot ask a question back |
| “my name is Sam” | name | “Nice to meet you, Sam!” | Store a name variable |
| “how are you?” | how are you | “I’m great! I run on code and curiosity.” | Add a silly personality line |
| “tell me a joke” | joke | “Why did the computer sneeze? It had a virus!” | Make 2–3 joke options |
| “help” | help | “Try typing: hi, joke, game, bye.” | Always include a help command |
| “bye” “goodbye” | bye / goodbye | “Bye! Come chat again soon.” | End with a friendly sign-off |
Actionable parent move: Print (or rewrite) the table with your child and let them pick responses. Kids care more when it sounds like their character.
Step-by-Step: Build the Scratch Chatbot with Blocks
This section is the “build along” part—no jargon, just the exact blocks you need.
Step 1: Set up your project
- Open Scratch and create a new project.
- Choose a sprite (the chatbot character). A simple animal or robot works well.
- Optional: Add a background (like a space scene).
You’ll mainly use:
- Events blocks (to start)
- Sensing blocks (to ask and get the user’s answer)
- Variables (to save the user’s message and name)
- Control blocks (if/else logic)
- Operators (to check if a message contains a keyword)
Step 2: Create your variables
Make these variables:
messagename
(Click Variables → Make a Variable.)
Step 3: Start the conversation
On your chatbot sprite, build this base script:
when green flag clickedset [name v] to []say [Hi! I’m AstroBot. Type “help” to see what I can do.] for (2) seconds
Now you need the chatbot to keep chatting, so add:
foreverask [Type a message:] and waitset [message v] to (answer)- (Next: your conversation rules)
Step 4: Add conversation rules (the “brain”)
Scratch doesn’t automatically understand language. We fake it by checking if the message contains certain words.
Use the operator:
((message) contains [hi])
Then combine it with if/else blocks.
A simple rule chain can look like:
if <(message contains [help])> thensay [Try: hi, name, joke, game, bye.] for (2) seconds
else if <(message contains [hi])> thensay [Hi there! What’s your name? (Type: my name is ...)] for (2) seconds
else if <(message contains [name])> then- (We’ll set the name next)
else if <(message contains [joke])> thensay [Why did the computer sneeze? It had a virus!] for (2) seconds
else if <(message contains [bye])> thensay [Bye! Come back soon.] for (2) seconds
elsesay [Hmm… I’m not sure. Type “help”.] for (2) seconds
Parent tip: Kids often forget spelling and capitalization. To make the bot more forgiving, you can check for multiple keywords (hi/hello/hey) with OR.
Example:
if <<(message contains [hi]) or (message contains [hello])> or (message contains [hey])> then ...
Step 5: Save the user’s name (simple version)
For ages 8–10, keep it easy: if the message contains “name”, ask again and store the answer.
Inside the else if <(message contains [name])> section:
ask [What name should I call you?] and waitset [name v] to (answer)say (join [Nice to meet you, ] (name)) for (2) seconds
This avoids tricky text parsing (like extracting the word after “is”). It’s simpler and works well.
Step 6: Add one “conversation game” mode
To turn your bot into a Scratch coding conversation game, give it a mini game command.
Add a new rule:
else if <(message contains [game])> thensay [Game time! Choose: rock, paper, or scissors.] for (2) secondsask [Type rock, paper, or scissors:] and waitset [message v] to (answer)- (Then respond with a simple rule)
Simple kid-friendly version (no randomness yet):
if <(message contains [rock])> then say [I choose paper! I win!]else if <(message contains [paper])> then say [I choose scissors! I win!]else if <(message contains [scissors])> then say [I choose rock! I win!]else say [Oops—type rock, paper, or scissors.]
This is fun because it feels interactive, and it teaches branching logic.
Make It Better: 5 Upgrades Kids Love (Without Getting Overwhelmed)
Once the basic chatbot works, choose 1–2 upgrades. The goal is “more delight,” not a huge project.
-
Random jokes
- Make a
jokeslist (Lists → Make a List) - Pick one with
item (pick random 1 to length of jokes) of jokes
- Make a
-
A mood setting
- Add variable
mood(happy, sleepy, excited) - Let the user type “mood happy” and the bot responds differently
- Add variable
-
Remember the name automatically
- If
nameis not blank, have the bot greet them with it: say (join [Welcome back, ] (name))
- If
-
More “synonyms”
- Check for “thanks” and “thank you”
- Check for “bye” and “goodbye”
-
A simple safety rule
- Teach kids: don’t collect personal info. The bot can say:
- “For safety, don’t share your address, phone number, or school name.”
Key debugging tips (these solve 90% of kid problems):
- If the bot doesn’t respond, check spelling in the keyword.
- If it always says the same thing, check your order. Put specific rules first (like “how are you”) before general ones (like “how”).
- If the bot feels “rude,” add a helpful fallback: “Type ‘help’ to see ideas.”
Next Steps: Turn This into a Polished Scratch Chatbot Project
To wrap up, here’s a simple checklist to help your child finish strong—and feel proud enough to share it.
- Add a Help menu that lists every command your bot understands.
- Test 10 messages and write down what happened (like a real developer).
- Try: hi, hello, hey, help, joke, game, bye, and two “nonsense” messages.
- Make the bot’s personality consistent
- Is it a space bot? Add space-themed jokes and greetings.
- Share safely
- When uploading to Scratch, remind your child: no personal details in the project notes.
If your child enjoyed this coding AI chatbot for kids style project, the next great milestone is teaching the bot to:
- choose random answers,
- remember multiple facts (favorites, score, mood), and
- use lists to organize conversation topics.
Want a guided path? At Intellect Council, we turn projects like this into step-by-step quests—so kids don’t just follow instructions, they learn how to think like builders. Open Scratch, pick a character, and build your chatbot’s first “brain rule” today.
Key Takeaways
- A great Scratch chatbot starts with simple conversation rules: keywords in, friendly replies out.
- Use variables like message and name to make the chatbot feel personal and interactive.
- Turn the chatbot into a conversation game by adding a command like “game” and branching responses.

Auther
Toshendra Sharma