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.
-- 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.
-- ModuleScript named Settingslocal Settings = { StartingCoins = 0, WalkSpeed = 16,}return SettingsPlacement reference
| Type | Runs on | Use it for |
|---|---|---|
| Script | The server, with default settings | Shared game rules: doors, kill bricks, leaderboards |
| LocalScript | One player’s device | Menus, buttons, camera effects |
| ModuleScript | Wherever it is required | Reusable functions and configuration |
If nothing happens
- Confirm you are in Play mode and the script is enabled.
- Read the first error in Output and click its line number.
- Check whether
script.Parentis the object your code expects. - Confirm the script type and its location match the instructions.
- Add a temporary
printat 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