Module 1 · Your first Luau scripts
Mini-project: A welcoming game message
Create a clearly named server Script that prints a short sequence of welcoming messages.
What you will learn
- Create a server Script in the intended service
- Print several understandable messages
- Use readable local names and an intent-focused comment
- mini-project
- A small feature that combines the module's ideas.
- source
- The text of a script.
Loading saved progress…
Understand
Read the idea and follow a worked example.
Why this matters
A start-up message is a small but complete behavior for Coin Quest and gives you a reliable path from Explorer to Script Editor to Output.
The mental model
Build the feature in three layers: put the right script in the right place, name the message values, then print them in the order a player would understand.
The Studio check can inspect this marked Script's class, location, and source structure. It does not need the rest of your place.
New words and symbols
--!strict asks Studio to check your code for type mistakes. It is an instruction for the editor and produces no Output message.
Matching quotes such as "hello" surround a string: a piece of text. The quotation marks tell Luau where the text starts and ends.
print(...) calls the built-in print function. Put the values to show inside its parentheses; separate multiple values with commas. Read the result in Studio's Output panel.
local is read as “local”: it creates a name that is available only in the current code scope.
= is read as “is assigned”: it evaluates the right side and stores that value in the name on the left.
A tiny example
--!strict-- Introduce the goal before play begins.local gameTitle = "Welcome to Coin Quest"local goalMessage = "Collect coins and explore the path"print(gameTitle)print(goalMessage)Line by line
- 3
The comment explains the intended order of the messages.
- 4
gameTitle names the first string.
- 5
goalMessage holds a separate instruction.
- 7
The title is printed first.
- 8
The goal follows as a second Output message.
Read the code aloud
Read one statement at a time: name the value being read, what the operation does, and where its result goes. Keep identifiers exactly as written so you can find them again in the code.
Pause at calls, conditions, and loops. Explain when the body runs before moving to the next statement; use the line notes above when a symbol is unfamiliar.
Execution trace
Begin at the first executable statement. Comments and blank lines do not run; a branch chooses which block runs, and a loop may revisit its body.
Line 3: The comment explains the intended order of the messages.
Line 4: gameTitle names the first string.
Line 5: goalMessage holds a separate instruction.
Line 7: The title is printed first.
Line 8: The goal follows as a second Output message.
State before and after
Before running, identify the starting values and any existing Studio objects this example needs. List what you expect to change.
After your practice change, check this result: Output shows a readable welcome sequence from the server Script, and no unrelated object is changed.
Reading or printing a value leaves it unchanged. Look for assignments, calls that change state, and property updates to explain each change you observe.
Predict before running
Which message will appear first?
Try it
Mark each step after you have tried it.
Common mistake
Putting the Script under a random world Part makes its purpose harder to find. ServerScriptService communicates that this is server behavior and keeps it separate from physical objects.
Checkpoint
Submit once you have considered every question. Retries are unlimited.
Recap
- A complete behavior has a clear location and purpose.
- Named strings make messages easy to change.
- Play and Output let you verify the result.
Next: In Module 2, you will give Coin Quest useful values for player names, coins, state, and selected items.
Studio challenge
A welcoming game message
Checks are formative feedback, not cheat-proof certification. You can finish this lesson without the plugin.
- Target
- ServerScriptService/LearningLuau/Welcome
- Check mode
- source structure
Challenge state: idle
Studio Companion
Not connected
Connect once. Compatible challenges will prepare automatically as you reach them.