Lesson 1 of 4
Client and server: who owns what
Learn the Roblox client-server model with Beacon Yard. Where each script runs, what replicates and what never travels back up, why the server owns coins, and how StreamingEnabled changes what a client can see.
By the end you can
- Say where Scripts, LocalScripts and ModuleScripts run, and which containers replicate to clients
- Predict whether a change made on one side shows up on the other
- Explain why coins live on the server and leaderstats are only a display copy
Before this: ModuleScripts and require, Playtesting: Play, Run, Team Test, server and client views
Step 1 of 11
Press Play, start two programs
Press Play on the m03-coins-count build and look at Output. One line comes from the client: [Beacon Yard] client started for followed by your name. Every other line in the session comes from the server. Studio has started two separate programs on your computer, and they share no memory. On a real Roblox server they would be on different continents.
local Players = game:GetService("Players")
print("[Beacon Yard] client started for " .. Players.LocalPlayer.Name)
Two players join a Server & Clients test of the m03 build. How many client started lines appear across all Output windows?
Press 1 to 4 to choose, Enter to check.
Step 2 of 11
The referee and the screens at home
The serverServerThe machine Roblox runs for each copy of your game. It holds the authoritative world.Think of it as the referee with the only real scoreboard. is the machine Roblox runs for one copy of your game. It holds the real world: every part, every player's coins, the round timer. Each player's device is a clientClientOne player's device running its own copy of the game for display and input.Think of it as your screen and controller at home.: it draws the world, reads the keyboard and touch screen, and runs its own scripts1.
The server is the referee with the only real scoreboard. Players can shout requests from the stands, but only the referee changes the score.
Think of it as The referee with the only real scoreboard
Server sideRemember: The server is the referee with the only real scoreboard.
| In the picture | In Roblox |
|---|---|
| Your screen | What one player's device draws |
| Your controller | Input that LocalScripts read and send as requests |
| Watching from home | Seeing a copy of the world, not the original |
Match each Beacon Yard job to the side that does it.
Step 3 of 11
Where each kind of script runs
Roblox decides where a script runs from its class and its container2:
- A Script in ServerScriptService runs on the server.
- A LocalScript in StarterPlayerScripts is copied to each player and runs on their client. LocalScripts in ReplicatedStorage do not run at all.
- A ModuleScript runs wherever it is required, on the side that required it.
- A Script with its
RunContextset to Client runs on clients even from ReplicatedStorage; Beacon Yard keeps to the classic layout.
Beacon Yard's project file turns each src folder into one of these.
"ServerScriptService": {
"Server": {
"$path": "src/server"
Client sideRemember: The client is your screen and controller at home.
Match each Beacon Yard source folder to where its code runs.
Step 4 of 11
What gets sent to clients
ReplicationReplicationThe engine copying server changes down to every client.Think of it as the live broadcast of a match. is the engine copying the server's world down to every client. It sends Workspace, ReplicatedStorage, ReplicatedFirst, Lighting, the Players service and each player's own PlayerGui and Backpack. It never sends ServerScriptService or ServerStorage, which is why server code and secret data live there: a client cannot read what it never receives.
| In the picture | In Roblox |
|---|---|
| The match in the arena | The server's instance tree |
| The broadcast feed | Property and instance changes sent to every client |
| The delay on the feed | Network latency |

Select a numbered pin, or a row below, to read what it marks.
The Server view during Play. The yard is built by the server and replicated to every client.
Which of these can a LocalScript read during Play?
Press 1 to 5 to choose, Enter to check.
Step 5 of 11
Changes travel down, never up
When the server changes a part, every client sees the change. When a client changes a part, only that client sees it. The server keeps its own copy and never hears about the change. Try it in the simulation, then watch the same experiment in Studio.
The arena and the broadcast
Goal Change a value on client A, then change it on the server, and see which change reaches client B.

Server on the left, two clients on the right. Change values on each side and watch what travels.
The client command bar creates ClientOnly and the server command bar creates ServerMarker. Only one of them crosses.
Transcript
- 0:05 The client creates a part named ClientOnly.
- 0:12 The server view does not have ClientOnly. A client part does not replicate.
- 0:18 The server creates ServerMarker.
- 0:21 The client view shows ServerMarker. A server part does replicate.
A LocalScript on Player1's device runs this during Play. What does Player2 see?
local pad = workspace.Yard.CoinPads.Pad1
pad.Color = Color3.new(1, 0, 0)
Press 1 to 4 to choose, Enter to check.
Notice where the referee picture stops fitting. A real referee watches the whole stadium. The Roblox server does not watch each player's screen: it is the field itself, and it cannot see anything a LocalScript creates on a client.
Where does it break?“The referee with the only real scoreboard” is a good picture of the server. Where does it stop being true?
It breaks here. The server is also the field itself, and it cannot see things that exist only on a client, such as a player's GUI or a LocalScript's effects.
The true model. The server runs the authoritative copy of the whole game world. Anything that matters (coins, damage, purchases) is decided there, and clients only see what it replicates to them.
A LocalScript creates a Part named ClientOnly in Workspace and creates a new ShopFrame in PlayerGui. What can a server Script see?
Press 1 to 4 to choose, Enter to check.
Step 6 of 11
Where the broadcast picture breaks
A broadcast is one-way and the viewers control nothing. Roblox is not quite that. Each client simulates its own character and sends the movement up, because waiting for the server would make walking feel laggy. That is why a modified client can teleport or run fast, and why the security lesson checks movement on the server.
Where does it break?“The live broadcast” is a good picture of replication. Where does it stop being true?
It breaks here. Only property changes in some containers are sent, and nothing a client changes ever travels back up to the server.
The true model. The server copies changes in replicated containers, such as Workspace and ReplicatedStorage, down to clients. A client's own changes stay on that client unless it asks the server through a remote.
Where does it break?“Your screen and controller at home” is a good picture of the client. Where does it stop being true?
It breaks here. The client also simulates your own character's movement and sends it up, so it is more than a screen.
The true model. Each player's device runs its own copy of the game for display and input. It owns its character's physics by default, which is why movement feels instant and why a cheater can move strangely.
The shop's Speed upgrade sets the player's Humanoid.WalkSpeed to 24 on the server. Why is WalkSpeed a poor place to enforce what a player paid for?
Press 1 to 4 to choose, Enter to check.
Step 7 of 11
leaderstats is a display copy
Coins live in a table on the server, inside DataService. The number in the player list and on the HUD is a copy: DataService writes it into an IntValue inside a folder called leaderstats, Roblox shows that folder in the player list, and the value replicates to clients so the HUD can read it3.
-- DataService owns each player's coins while they are in this server.
-- Only the server changes a coin count. leaderstats is the display copy:
-- Roblox shows a folder with exactly that name in the player list, and
-- the client may read it but never decides anything from it. Nothing is
-- saved yet, so coins reset when you leave. A later milestone adds
-- DataStore saving to this same module.

Select a numbered pin, or a row below, to read what it marks.
The HUD reads the leaderstat. It never decides the number.
A cheater sets their own leaderstats.Coins.Value to 9999 from a client script and opens the shop. What can they buy?
Press 1 to 4 to choose, Enter to check.
Step 8 of 11
StreamingEnabled: not everything arrives at once
In a big world, sending every part to every client wastes memory. With Workspace.StreamingEnabled on, the engine sends each client only the parts near its player, and removes far ones4. Studio turns it on by default for new places, and the later Beacon Yard milestones set it explicitly (m14-ship uses a target radius of 512 studs), so the yard relies on it. Even in a small yard, write client code as if a part might not have arrived yet: wait for it with WaitForChild, or react when it appears.
| In the picture | In Roblox |
|---|---|
| The stage crew building the next set ahead of you | The server generating chunks near players |
| Striking a set nobody is on | Destroying chunks far from every player |
| The set drawings | The seed and generator, which rebuild an identical chunk |
Both sidesRemember: Building the world near the player (chunks and StreamingEnabled) is stage sets built as you walk.
In a streamed place, a LocalScript runs workspace.Yard.CoinPads.Pad6.Color = ... before Pad6 has streamed to the player. What happens?
Press 1 to 4 to choose, Enter to check.
Step 9 of 11
Build it: one part on each side, then the HUD
Where should game logic run? Roblox gives you more than one answer, and it is worth knowing them before you choose.
Where gameplay logic runs
| Option | What it is | When pros pick it | Trade-offs |
|---|---|---|---|
| Server-authoritative rules | The server decides every outcome; clients send requests and draw results. Beacon Yard's model. | Anything with currency, damage, progress or competition. Almost every Roblox game. | Every action waits a round trip, so feedback needs care. |
| Client prediction plus server check | The client shows the result at once (a swing animation, a coin sparkle) and the server confirms or corrects. | Fast actions where waiting feels bad, such as combat. | You must handle the server saying no and roll the effect back. |
| Server authority model | Roblox's newer system where the server simulates characters from client inputs and clients predict and roll back. | Competitive games that need movement the client cannot fake. | Newer and stricter: it needs Workspace.AuthorityMode set to Server and code written for rollback. |
| Client-only logic | Purely visual or personal things: camera, UI animation, local sounds. | Anything nobody else needs to see or trust. | Never for rules: a cheater controls their client completely. |
Build along
src/client/Hud.luausrc/server/Remotes.luau
At
m03-coins-count, press Play. In the client command bar runlocal p = Instance.new("Part") p.Name = "ClientOnly" p.Anchored = true p.Parent = workspace. Switch to the Server view and look for it in Workspace.You should see The server Explorer does not list ClientOnly. The client view does.
In the server command bar run
local p = Instance.new("Part") p.Name = "ServerMarker" p.Anchored = true p.Position = Vector3.new(0, 12, 0) p.Parent = workspace. Switch back to the client view.You should see The client view shows ServerMarker floating above the yard.
Stop, then run
git checkout m04-two-sides.You should see Both parts are gone after Stop. git reports you are at m04-two-sides with Hud.luau and Remotes.luau added.
Press Play and collect a coin. The server paid you and then told your client through a remote, which the next lessons open up.
You should see A +5 toast appears at the bottom of the screen and the coin count in the HUD rises by 5.
Step 10 of 11
Challenges
Level 1, Apprentice
Challenge
Prove to yourself that the client folder only draws and asks.
- Start from
- The game at milestone m06 (download)
Done means
- You list three files in src/client and say what each one draws or reads
- You find the comment in init.client.luau that says nothing there grants coins
Meet the criteria above, then record your own result. No test grades this check.
Level 2, Builder
Challenge
Watch replication with two real clients.
- Start from
- The game at milestone m04 (download)
Done means
- A two-player Server & Clients test is running
- Player1 collects a coin; you report what Player1's and Player2's coin counts show
- You explain why both players see the coin disappear
Meet the criteria above, then record your own result. No test grades this check.
The level 3 challenge wants a part named ServerLesson under Workspace.Yard that every player can see. Where must the code that creates it run?
Press 1 to 4 to choose, Enter to check.
Level 3, Professional
Challenge
Add a server-created marker that every client can see. The solution is challenges/solutions/client-server.md in the game repo.
- Start from
- The game at milestone m06 (download)
- Grade it
- To grade work from an earlier milestone, apply your challenge changes to a checkout based on
m14-ship, which includes the Course Runner. In Studio, press Play, then rungame.ServerScriptService.RunGameTests:Invoke("client-server")in the server command bar. Copy the pass code from Output.
Done means
- MapBuilder.build parents an anchored Part named ServerLesson, size 2, 1, 2, to the yard
- Nothing on the client creates it
- The Course Runner prints TEST PASS client_server_marker and a pass code
Step 11 of 11
Recap
Recap
- Play runs a server and one client per player, with no shared memory. Scripts in ServerScriptService run on the server, LocalScripts in StarterPlayerScripts on each client, ModuleScripts wherever they are required.
- Replication copies the server's world down; a client's own changes never travel up. ServerScriptService and ServerStorage are never sent, which keeps server code and data private.
- The server owns the rules and the real numbers; leaderstats and the HUD are display copies. Clients do simulate their own character, so movement needs server checks, and a streamed client may not have a part yet.
The server is the referee with the only real scoreboard, until the server is also the field itself, and it cannot see things that exist only on a client, such as a player's GUI or a LocalScript's effects.
Replication is the live broadcast, until only property changes in some containers are sent, and nothing a client changes ever travels back up to the server.
The client is your screen and controller at home, until the client also simulates your own character's movement and sends it up, so it is more than a screen.
Building the world near the player (chunks and StreamingEnabled) is stage sets built as you walk, until there are two crews. Your generator decides what exists on the server; StreamingEnabled separately decides which of it each client has received, so a piece can exist on the server and still be missing on a client.
Queued for review
- Which of these can a LocalScript read during Play?
- A LocalScript on Player1's device runs this during Play. What does Player2 see?
- A cheater sets their own leaderstats.Coins.Value to 9999 from a client script and opens the shop. What can they buy?
- The shop's Speed upgrade sets the player's Humanoid.WalkSpeed to 24 on the server. Why is WalkSpeed a poor place to enforce what a player paid for?
- In a streamed place, a LocalScript runs workspace.Yard.CoinPads.Pad6.Color = ... before Pad6 has streamed to the player. What happens?