Bobrix Docs

Script Types & Locations

Roblox uses three core script containers:

Examples

-- Server Script (ServerScriptService) local Players = game:GetService("Players") Players.PlayerAdded:Connect(function(plr) print("Welcome", plr.Name) end) -- LocalScript (StarterPlayer β–Έ StarterPlayerScripts) local UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(input,gp) if not gp and input.KeyCode==Enum.KeyCode.F then print("F pressed") end end) -- ModuleScript local M = {}; function M.add(a,b) return a+b end; return M
Why location matters: LocalScripts only run in specific client containers (PlayerGui, StarterPlayerScripts, Backpack/Tool, Character, ReplicatedFirst). Server scripts don’t run on the client and can access server-only services.