roblox-architecture
Installation
SKILL.md
Roblox Architecture
Scope
Engine facts that decide where code runs, when it starts, what a require shares, and how places and servers connect. Remotes and replication payloads: roblox-networking; Parallel Luau cost and SharedTable: roblox-performance; teleport behavior in Studio tests: roblox-debugging; saving across a teleport: roblox-data.
"Field case" = seen in the owner's shipped games; re-test in your place.
Traps (symptom -> cause -> fix)
- Script never runs -> a
Scriptdefaults toRunContext.Legacy: server only, and only in a server container (ServerScriptService,Workspace). InReplicatedStorageit needsRunContext = ClientorServer.LocalScriptcan't use RunContext. requirehangs or errors at boot -> a cyclic require: the module guide says it errors (Requested module was required recursively), the class reference says the thread hangs with no error. Treat both as the same bug and break the cycle. A module that yields at top level makes every firstrequireyield.script:GetActor()isnilin a worker -> it returnsnilin a ModuleScript that isn't a descendant of the Actor (a shared module inReplicatedStorage). Pass the Actor in.require()can't run in a desynchronized phase: require in serial first.- ReplicatedFirst loading script errors on
ReplicatedStorage.X-> it runs before the rest of the game loads; onlyReplicatedFirstcontents are safe withoutWaitForChild. Order: ReplicatedFirst scripts -> game loads,game.Loaded-> PlayerScripts and client Scripts inReplicatedStorage-> character spawns -> character scripts. - Join handler misses players or runs out of order -> players who joined before
PlayerAddedwas connected; two services each wiringPlayerAddedrace. Wire the lifecycle once, call owners in order, loopPlayers:GetPlayers()(§1). Decide admission first (field case). - Boot dies quietly, no remotes, blank HUD -> about 10 s of non-yielding boot hit
Script timeout: exhausted allowed execution time; atask.spawninsideInitdied with it (field case). Yield in long boot loops,task.deferoptional warm-up. - Phone freezes ~5 s after joining live, fine in Studio -> live clients often find everything already replicated, so no
WaitForChildyields and the whole client start lands in one frame (field case). Repro withtask.wait(8)at the top of the client bootstrap; pace starts per frame (roblox-luau§1). - Package copies never update in the live game ->
AutoUpdateapplies when a place is opened in Studio; mass update saves but doesn't publish. Any edit marks a copy modified and disables itsAutoUpdate; deleting or moving thePackageLinkturns the copy into a plain object. Nested packages: only the top parent'sAutoUpdatecounts, and nested changes publish first. - Teleport lands in the wrong server or a reserved server never fills -> routing fields conflict or legacy access codes (§2).