Your First Script in Roblox Studio
The short answer: A script is a list of instructions written in Luau that tells your game what to do. Roblox has three kinds: a Script runs on the server (the computer running the game for everybody), a LocalScript runs on one player's own device, and a ModuleScript is a box of shared code that other scripts can borrow. The biggest beginner lesson is this: where a script lives decides what it does — and whether it runs at all.
Meet the Output window
Before you write anything, find the Output window. Studio shows it along the bottom. The Creator Documentation calls it the most basic tool for understanding how your scripts behave, and it is where your scripts talk back to you:
print()writes a normal message there. You will use it constantly to check what your code is doing.warn()writes a warning message there.- When a script has an error, the error appears in Output too — and Studio's Script Analysis window sums up a script's errors and warnings for you.
Keep Output open for everything in this series. When a game does something weird, Output is the first place to look.
Your first script
This follows the shape of Roblox's own first-script tutorial. It spells a word out letter by letter.
- Open the baseplate place from the first page of this series.
- In the Explorer window (the list of everything in your game), hover over ServerScriptService and click the + button that appears.
- Choose Script. A new script appears.
- Rename it HelloScript.
- Double-click it to open the Script Editor, delete anything already in it, and paste this in — or tap Copy and paste:
local letters = {"h", "e", "l", "l", "o"}
for index = 1, #letters do
print(letters[index])
end
print(table.concat(letters))- Make sure the Output window is open, then run your game with Studio's Run (play) button. Stop it with the stop button when you are done looking.
What you should see in Output:
What just happened: the script holds a list (called a table — page 4 of this series covers tables properly) of five letters. The loop prints one letter at a time. The last line joins all the letters into one word with table.concat and prints the finished word. That is a real, working program — small, but real.
The three kinds of script
- Script — the regular kind. By default it runs on the server: the one game world everybody shares. Put game rules, scores, and saving in Scripts. ServerScriptService and Workspace are its usual homes.
- LocalScript — runs on one player's device only (their computer or phone). It handles things that belong to that one player, like what their buttons and screens do. It lives in player places: StarterPlayerScripts, StarterCharacterScripts, StarterGui, or StarterPack. Roblox's guide asks you to use LocalScripts sparingly — those containers get copied to every player, which can make bugs harder to track down.
- ModuleScript — does not run by itself at all. It is a toolbox: other scripts load it with
require()and use the code inside. Roblox recommends putting code you want to share between scripts into ModuleScripts, and keeping shared ones in ReplicatedStorage, where both the server and players' devices can reach them.
Where scripts live — and why it matters
- ServerScriptService — the server's private drawer. Scripts here run on the server, and players never see this code. This is the home for most of your game's brain.
- StarterPlayerScripts (inside StarterPlayer) — scripts here are copied to each player when they join and run on that player's device as LocalScripts.
- Workspace — the 3D world itself: parts, models, the baseplate. A Script can run from here (the server runs it), but Roblox's guide advises against hanging scripts directly on Workspace objects as a habit — keep the world's objects and the game's brain in their own places. (Models you get from the Creator Store are the exception the guide names.)
The mistake every beginner makes once: a script in the wrong place simply never runs — no error, no message, nothing. Roblox's scripting guide makes the point with a second script placed in ReplicatedStorage: sitting there, it does not run, because that container is a storage shelf both sides can see, not a place that starts scripts. When your code "does nothing," check where it lives before you check what it says.
This page is part of the Roblox Luau series:
1. Installing Roblox Studio ·
2. Your First Script ·
3. Luau Basics 1: Variables, Numbers, and Words ·
4. Luau Basics 2: Choices, Loops, and Functions ·
5. Making Things Happen: Events ·
6. Saving a Player's Progress ·
7. The Player Talks to the Server ·
8. Build a Whole Mini-Game ·
9. Stay Safe and Keep Your Game Yours
Sources (official only; read in full November 7, 2026):
- Roblox Creator Documentation, Scripting introduction (create.roblox.com/docs) — Luau is derived from Lua 5.1; the first-script walkthrough (hover ServerScriptService, click +, choose Script, rename it, open the Script Editor, watch the Output window); print() and warn() as the logging tools; the Script Analysis window; the second-script lesson that a script placed in ReplicatedStorage does not run.
- Roblox Creator Documentation, Script locations — the three script types and where each runs: Script (server by default), LocalScript (client only; StarterCharacterScripts, StarterPlayerScripts, StarterGui, StarterPack; use sparingly), ModuleScript (loaded by other scripts with require()); share code through ModuleScripts in ReplicatedStorage; avoid attaching scripts directly to Workspace instances, with Creator Store models as the named exception.
The code example on this page was test-run before this page was written, and its output above is the output it produced. Checked November 7, 2026.