Skip to content

Modules

Modules logo

Seriously, another dependency loader for Roblox? –Somebody, probably

Modules is a simple dependency loader for the Roblox engine. It's a single ModuleScript named "Modules" which exists in ReplicatedStorage, and it is designed to replace the built-in require function.

local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Modules"))

local MyModule = require("MyNamespace:MyModule")

Visit the Getting Started guide to learn the basics →

Download & Install

There's several ways you can get it:

Once available, insert the Model into your Roblox place, then move the root "Modules" ModuleScript into ReplicatedStorage.

Structure

Modules also includes some super common patterns as included ModuleScripts. Check out the structure here:

└ ReplicatedStorage
  └ Modules           ← This is the root ModuleScript
    ├ EventMaidStateMachine
    │ └ Stateclass

Each of these can be required by simply providing its name without a namespace. For example:

local Event = require("Event")
local State = require("StateMachine.State")