Linked e-resources
Details
Table of Contents
Intro
Table of Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Introduction
What Does This Book Require?
About Lua
Installing Roblox Studio
Roblox Studio Templates
Exploring Roblox Studio's Editor
Scene View: Camera Movement
View Selector
Setting Up the Coding Workspace
Creating Your First Lua Script
Saving and Publishing Your Project
Reopening Your Project
Summary
Chapter 2: Working with Parts
Part Primitives
The Transform
Pitch, Yaw, and Roll
Global vs. Local Coordinate Space
Translating (Moving) a Part
Scaling a Part
Rotating a Part
Studs: Roblox Unit of Measurement
Translation Snapping
Rotation Snapping
Collisions
Anchoring Objects
Commenting Your Code
Summary
Chapter 3: Variables, Scope, Arrays, Operators, and Conditionals
Basic Lua Data Types
Variables and Literals
Naming Variables in Lua
Variable Declaration and Initialization
Variable Scope
Tables, Arrays, and Dictionaries
Creating an Array
Two-Dimensional Array
Creating a Dictionary
Operators (Unary/Binary) and Operands
Assignment Operator
Arithmetic Operators
Compound Assignment Operators
Relational Operators
Length Unary Operator
Concatenation Operator
String Coercion
Escape Sequences
Conditionals
Logical Operators
Operator Precedence and Using Parentheses
Summary
Chapter 4: Loops
While Loops
Infinite Loops
Repeat...Until Loop
Numeric For Loop
Generic For Loops
Nested Loops
Breaking Out of a Loop
Continue Statement of a Loop
Summary
Chapter 5: Objects, Data Types, and Properties
Roblox Parts and Objects
Object Hierarchy Navigation
Roblox (Luau) Additional Data Types
Manipulating Parts: Vector3 Data Type
Changing the Position of a Part
Scaling a Part Using Multiplication
Moving a Part Using Lerp
Computing Distance Between Parts
Manipulating Parts: Cframe Data Type
Offsetting a Part
Rotating a Part
Moving a Part in a Specific Direction
Part Rotation to Face Another Part - (1)
Part Rotation to Face Another Part - (2)
Parenting a Part to Another Part
Color3 Data Type
Instance Data Type
Enum Data Type
Random Data Type
Properties of Parts (Objects)
Summary
Chapter 6: Functions and Events
Functions
Invoking a Function
Function Parameters
Function Return Values
An Arbitrary Number of Parameters
Anonymous Functions
Events
Touched Event
Changed Event
ClickDetector.MouseClick Event
MouseButton1Click Event
PlayerAdded Event
ChildAdded and DescendantAdded Events
Other Miscellaneous Event
Event-Driven Programming
Script vs. LocalScript
BindableEvent
RemoteEvent
RemoteFunction
BindableFunction vs. RemoteFunction
Summary
Chapter 7: Roblox Services
Roblox Services
Workspace Service
Table of Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Introduction
What Does This Book Require?
About Lua
Installing Roblox Studio
Roblox Studio Templates
Exploring Roblox Studio's Editor
Scene View: Camera Movement
View Selector
Setting Up the Coding Workspace
Creating Your First Lua Script
Saving and Publishing Your Project
Reopening Your Project
Summary
Chapter 2: Working with Parts
Part Primitives
The Transform
Pitch, Yaw, and Roll
Global vs. Local Coordinate Space
Translating (Moving) a Part
Scaling a Part
Rotating a Part
Studs: Roblox Unit of Measurement
Translation Snapping
Rotation Snapping
Collisions
Anchoring Objects
Commenting Your Code
Summary
Chapter 3: Variables, Scope, Arrays, Operators, and Conditionals
Basic Lua Data Types
Variables and Literals
Naming Variables in Lua
Variable Declaration and Initialization
Variable Scope
Tables, Arrays, and Dictionaries
Creating an Array
Two-Dimensional Array
Creating a Dictionary
Operators (Unary/Binary) and Operands
Assignment Operator
Arithmetic Operators
Compound Assignment Operators
Relational Operators
Length Unary Operator
Concatenation Operator
String Coercion
Escape Sequences
Conditionals
Logical Operators
Operator Precedence and Using Parentheses
Summary
Chapter 4: Loops
While Loops
Infinite Loops
Repeat...Until Loop
Numeric For Loop
Generic For Loops
Nested Loops
Breaking Out of a Loop
Continue Statement of a Loop
Summary
Chapter 5: Objects, Data Types, and Properties
Roblox Parts and Objects
Object Hierarchy Navigation
Roblox (Luau) Additional Data Types
Manipulating Parts: Vector3 Data Type
Changing the Position of a Part
Scaling a Part Using Multiplication
Moving a Part Using Lerp
Computing Distance Between Parts
Manipulating Parts: Cframe Data Type
Offsetting a Part
Rotating a Part
Moving a Part in a Specific Direction
Part Rotation to Face Another Part - (1)
Part Rotation to Face Another Part - (2)
Parenting a Part to Another Part
Color3 Data Type
Instance Data Type
Enum Data Type
Random Data Type
Properties of Parts (Objects)
Summary
Chapter 6: Functions and Events
Functions
Invoking a Function
Function Parameters
Function Return Values
An Arbitrary Number of Parameters
Anonymous Functions
Events
Touched Event
Changed Event
ClickDetector.MouseClick Event
MouseButton1Click Event
PlayerAdded Event
ChildAdded and DescendantAdded Events
Other Miscellaneous Event
Event-Driven Programming
Script vs. LocalScript
BindableEvent
RemoteEvent
RemoteFunction
BindableFunction vs. RemoteFunction
Summary
Chapter 7: Roblox Services
Roblox Services
Workspace Service