Entries and folders
The boot scripts decide what loads and in what order. Each entry is a group of folders:
Init.start({
{ Folders = { ReplicatedStorage.Network } }, -- 1st: every module in Network
{
Folders = { ReplicatedStorage.Services, ServerScriptService.Services },
Predicate = Init.matchesName("Service$"), -- 2nd: only names ending in Service
},
{ Folders = { ReplicatedStorage.Binders.Shared, ServerScriptService.Binders } }, -- 3rd
})
- Order: entries load in list order. Inside an entry, the
Priorityattribute (lower first) then Explorer order. - Predicate: a function
(module) -> boolean.Init.matchesName(pattern)makes one from a string pattern:"Service$"ends in Service,"^Admin"starts with Admin. - Shared folders (in ReplicatedStorage) go in both boot scripts.
Adding your own folder
Say you want ReplicatedStorage.Systems with modules named ...System:
-
Make the folder.
-
Add an entry to
InitServerandInitClient(or just one, if it's one-sided):{ Folders = { ReplicatedStorage.Systems }, Predicate = Init.matchesName("System$") },
Attributes
Set these on a ModuleScript in the Properties window:
| Attribute | Type | Effect |
|---|---|---|
Ignore | boolean | true: Init skips it |
Priority | number | lower loads earlier inside its entry (default 0) |
The old Entries modules
The old Init kept entries in SharedEntries/ServerEntries/ClientEntries modules as named dictionaries with Order. That format still works: Init.start(require(path.to.ServerEntries)) sorts it by Order. See Migrating.