This script handles the core client-side initialization for the Altair Roblox project using Luau and Rojo. It dynamically loads modules from the modules folder, connects tag-based behavior using CollectionService, and manages per-frame logic and player events.
The modules folder can contain the following module types, auto-detected by naming convention or the type field:
controllerβ logic modules initialized on the client, supporting lifecycle callbacks.moduleβ standard shared utility modules.tagβ modules bound to instances tagged viaCollectionService.local_tagβ similar totag, but filtered for instances relevant only to the local player.
- All non-template modules from
modulesare loaded. - Each module is categorized by its
type(default:module). - Controllers with an
indexfield are loaded first (loadFirst), then others. - Tag modules are connected to instance-added/removed signals.
- Player and character lifecycle events are connected.
- Runtime frame-based updates (
Heartbeat,Stepped,Render) are routed.
Controllers and tag classes may implement the following optional methods:
Init(self)β Called once during initialization.PlayerAdded(self, player: Player)CharacterAdded(self, character: Model)(for local player only)CharacterAppearanceLoaded(self, character: Model)(for local player only)AnyCharacterAdded(self, player: Player, character: Model)AnyCharacterAppearanceLoaded(self, player: Player, character: Model)Died(self, character: Model)(for local player only)AnyDied(self, player: Player, character: Model)Physics(self, deltaTime: number)β Called every frame onHeartbeat.Stepped(self, deltaTime: number)β Called every frame onPreSimulation.Render(self, deltaTime: number)β Called every frame onPreRender.
Tags are connected using CollectionService:
tagmodules respond globally.local_tagmodules only react to instances belonging to the local player or their character.- When an instance with the specified tag is added, the module's
new(instance)function is called and stored. - When removed, if the class instance has a
Destroy()method, it is called.
All ScreenGui instances in PlayerGui have ResetOnSpawn set to false unless they have a custom attribute SkipResetOnSpawn.
Players.PlayerAddedandCharacterAddedCharacterAppearanceLoadedHumanoid.DiedRunService.HeartbeatRunService.PreSimulationRunService.PreRenderPlayerGui.ChildAdded
- Modules containing the word
"template"in their name are ignored. - Errors in requiring a module are silently caught via
pcall. - Module references are stored in the
pathtable based on type.