Skip to content

Where to Put Scripts in Roblox Studio

A practical reference for Script, LocalScript, and ModuleScript placement in Explorer.

Updated · 5 min read
On this page

Correct code can appear broken when it is in the wrong place. Start by identifying who needs to run it: the shared server, one player’s device, or another script that imports a module.

Server scripts

For a regular Script with its default RunContext, ServerScriptService is a sensible home for game rules, leaderboards, and reward logic. An object-specific Script can also live inside a Part in Workspace.

ServerCheck.server.lua
-- Put this Script in ServerScriptServiceprint("The server is running this script")

Server-only code and sensitive game logic should not be placed in ReplicatedStorage, which is available to clients.

LocalScripts

Use StarterPlayer → StarterPlayerScripts for a player’s input and camera code. Use a LocalScript inside a ScreenGui in StarterGui for an interface. These starter containers provide content to each player when they join or spawn.

A conventional LocalScript placed directly in Workspace or ServerScriptService will not behave like a server Script. Move it to a supported client location instead.

ModuleScripts

A ModuleScript returns a value when another script calls require. It does not start itself. Put a shared module in ReplicatedStorage; put server-only modules in ServerScriptService or ServerStorage.

Settings.lua
-- ModuleScript named Settingslocal Settings = {    StartingCoins = 0,    WalkSpeed = 16,}return Settings

Placement reference

TypeRuns onUse it for
ScriptThe server, with default settingsShared game rules: doors, kill bricks, leaderboards
LocalScriptOne player’s deviceMenus, buttons, camera effects
ModuleScriptWherever it is requiredReusable functions and configuration
Check the script’s settingsScripts can use an explicit RunContext that changes where they execute. These examples assume regular Scripts with default settings and conventional LocalScript placement.

If nothing happens

  1. Confirm you are in Play mode and the script is enabled.
  2. Read the first error in Output and click its line number.
  3. Check whether script.Parent is the object your code expects.
  4. Confirm the script type and its location match the instructions.
  5. Add a temporary print at the top to see whether the script starts.

Then return to your first script and test a small working example.

Build your next small idea.

Try the generator