Transfer practice · Track three collected stars in a local variable. Print its value twice without changing it.

← Back to journey

Bring a small lobby to life

Give a value a name: practice

v7 · Activity 1 of 1 · Scores · 4 min Runs here

Workshop progress · step 7 of 1
Optional learning visualization
Scene choices
Chapter outline
Loading draft…
Activity 7 · Scores

Use a familiar idea in a different task. Read the changed requirement before running.

Your task

Track three collected stars in a local variable. Print its value twice without changing it.

Expected output
3
3

Lines must stay in order. Spelling, capitalization and spaces inside a message matter.

Syntax in this activity

New syntax: local, score, =, 10

Earlier ideas used here
  • addition
  • numbers
What this exercise checks

Actual Output · exact lines and order · extra output forbidden.

Successful execution is required. A compile error, runtime error or execution limit never completes this task.

Whitespace, matching single or double quotes, and different variable names are allowed. Output-only tasks accept any valid Luau solution meeting the displayed result and value types. Construct tasks use the stated straight-line form.

Lesson requirements: local-variable, local-read. These are exercise requirements, not Luau syntax rules.

Explain this code

Select a word or symbol in this authored example. Your editor draft stays unchanged.

   
Choose a highlighted part to see what it means.
Your goal

Track three collected stars in a local variable. Print its value twice without changing it.

Run code to see what happens. Check solution to test the activity.

Reset starter

Replace this code with the starter? Download your draft to keep a copy.

Code

Luau
Luau keyword highlighting · Ctrl/⌘ + Enter: Run · Esc: leave editor

Your output will appear here.

Ready