Roblox UtilitiesDevlHub Roblox Documentation

Organizing code

Roblox module scripts are one way of organizing code. This series covers how they work and how to implement them in a game.

Series description#

As you continue to work with code, scripts will become more complex. To address this, coders have a variety of techniques to make coding efficient, easy to understand, and reduce the chance of error. This series covers methods of organizing scripts, such as module scripts, a special type in script that can store functions and variables used by other scripts.

Objectives and prerequisites#

Learning objectives Understand the logic behind module scripts, as well as how to code a module script and access it in other scripts.

Be able to identify patterns of abstraction and algorithms in computer science.

Prerequisites Have an understanding of functions, events, and if/then statements.

Series contents#

Article Description
Intro to module scripts Learn how to use module scripts, a type of script that stores functions and variables that can be called or accessed from other scripts.
Create with module scripts Apply using module scripts to create a mini-game where players gather keys to open chests.
Coding abstraction Abstractions in computer science provide a simplified representation of something larger. They pull out only the most necessary information and hide everything else.
Coding algorithms An algorithm uses a series of steps to determine an outcome. Steps can be a set of directions, comparisons, or even a mathematical formula.