Guide

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.

Looking for Discord-style servers? Communities with channels, roles, invites and uploads live on Ember servers. Use the Ember server blocks for those. This page covers Nookara's own global chat, rooms and private messages. Permissions are requests: players can decline any of them on the sign-in screen, so a block that needs one can fail with a clear "Missing permission" message.

Before you start

  1. Open the extension menu. In the editor, click Add Extension (bottom left).
  2. 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.
  3. 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.

send global message msgwhen global chat message receivedlast message userlast message contentglobal messages

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 room roomsend msg in room roomwhen message in room room receivedmessages in room room

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 statetyping users

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

connected usersis user user connected?when a user connectswhen a user disconnectsset status to status

Private messages (instant messages)

Instant messages go to one person and are saved, so they get them next time they're online.

send instant message to to msgwhen instant message receivedwhen instant message received from userlast instant message senderlast instant message contentmessages with user (JSON)conversations (JSON)unread instant messagesmark messages from user as read

was my last message delivered instantly? tells you whether the other person was online to receive it right away.

Keeping chat friendly

Chat is tied to accounts.Every message comes from a signed-in Nookara account, and accounts can be reported and moderated. Nookara also has per-account restrictions, and you can check them with is [SERVICE] disabled by an admin? to hide chat for someone who isn't allowed to use it.

Related

More guides