Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
Functions and events
Series description
Use functions and events to make code run when you want, as often as you want. With functions and events you can set up traps, buttons, health pickups, and more.
Covered in this course are functions, parameters, arguments, and returning values.
Objectives and prerequisites
| Learning Objectives | Learn to place code into reusable chunks called functions. |
| Prerequisites | Basic knowledge of Roblox Studio such as moving and rotating parts. Previous experience creating Script objects and using variables, properties, and strings. |
Series Contents
| Article | Description |
|---|---|
| [Code a function](/docs/roblox-tutorials-fundamentals-coding-2-code-a-function) | Set up chunks of code in a way that only runs when you tell it to run. |
| [Use parameters and events](/docs/roblox-tutorials-fundamentals-coding-2-use-parameters-and-events) | How to code a function when you don't have all of the information yet. |
| [Parameters practice - buttons](/docs/roblox-tutorials-fundamentals-coding-2-parameters-practice-buttons) | Practice using events and parameters by making a bridge appear in-world with the push of a button. |
| [Multiple parameters and arguments](/docs/roblox-tutorials-fundamentals-coding-2-multiple-parameters-and-arguments) | Pass multiple pieces of information into a function at once. |