Conditionals

Series Description

Many scripts rely on code running on specific conditions, such as a player touching a trap part, or awarding specific prizes to players in a race. This series will cover using if statements, a topic in computer science where code runs after meeting specific conditions.

Objectives and Prerequisites

Learning Objectives

Understand the logic of how if statements work.

Be able to code with proper syntax if statements, as well as elseif and else forms.

Prerequisites

Have a general understanding of variables in Lua.

Series Contents

ArticleDescription
Intro to If StatementsStart with an understanding of how if statements work and practice one.
If/then Practice: TrapsApply knowledge of if statements to create a trap part for a game.
If/then Practice: Power upsContinue practice with a more advanced if statement that gives players a speed boost.
Multiple Conditions with Else/IfUnderstand the logic and syntax of if statements that compare multiple possible conditions.
Else/If Practice: Giving PointsDemonstrate knowledge to create a part that gives points based off multiple conditions. Applies all topics in this series.