Complete guide: chat blocks in Scratch with Nookara
Nookara's chat blocks give Scratch-mod projects real multiplayer chat: a global chat, as many rooms as you want, typing indicators, and private instant messages that are waiting for people even if they were offline. Every message comes from a real Nookara account, so there are no fake usernames.
Before you start
- Open the extension menu. In the editor, click Add Extension (bottom left).
- Add Nookara. In PenguinMod, pick Nookara from the extension gallery if it's listed. Otherwise (or in TurboWarp and other mods) choose Custom Extension, paste
https://ikelene.net/gallery/extensions/velora_extension.js, and turn on Run without sandbox - Nookara opens a sign-in popup, which sandboxed extensions can't do. - Done. The purple Nookara category appears in your block palette.
Then sign the player in (see how to add Nookara login). Ask for the Chat Messaging permission for chat rooms, and Read / Send Instant Messages for private messages (the player can decline any of them).
Global chat
One chat everyone in your project shares.
The simplest chat box: when the hat fires, add last message user and last message content to a list, and show the list on screen. global messages gives the recent history as JSON when someone joins late.
Chat rooms
Rooms keep conversations separate - a room per lobby, per team or per level.
Join the room first, then send to it. messages in room [ROOM] reports the latest messages as JSON (up to 50), which is handy for filling the chat when a player enters.
Typing indicators
Set typing on while the player has the text box open and off when they send or close it; show typing users under your chat.
Who's online
Private messages (instant messages)
Instant messages go to one person and are saved, so they get them next time they're online.
was my last message delivered instantly? tells you whether the other person was online to receive it right away.