Learn
Engine Class
ModuleScript

Summary
Properties
LinkedSource:ContentId
Deprecated
Inherited Members
Code Samples
Simple ModuleScript Example
-- Tables store multiple values in one variable
local MyFunctions = {}
-- Add a few functions to the table
function MyFunctions.foo()
print("Foo!")
end
function MyFunctions.bar()
print("Bar!")
end
-- ModuleScripts must return exactly one value
return MyFunctions
Simple ModuleScript Usage
-- The require function is provided a ModuleScript, then runs
-- the code, waiting until it returns a singular value.
local MyFunctions = require(script.Parent.MyFunctions)
-- These are some dummy functions defined in another code sample
MyFunctions.foo()
MyFunctions.bar()

API Reference
Properties
LinkedSource
Deprecated

Source
Read Parallel
Capabilities: PluginOrOpenCloud
ModuleScript.Source:string

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.