Flashcards
(98 cards)
What is the data type used to store whole numbers in Lua?
Integer
In Lua, how are comments denoted?
–
What keyword is used to define a function in Lua?
function
What is the operator used for concatenation in Lua?
..
What is the correct syntax for a simple if statement in Lua?
if condition then
– code block
end
What is the output of the expression ‘5 % 2’ in Lua?
1
What is the default value of a variable in Lua if not initialized?
nil
What does the ‘local’ keyword do in Lua?
Defines a local variable
What is the purpose of the ‘print’ function in Lua?
To output text to the console
Fill in the blank: Lua is a ________ language.
Scripting
What does API stand for in the context of Roblox Lua?
Application Programming Interface
What is the main purpose of an API in Roblox Lua?
To provide a set of functions for developers to use
True or False: Roblox Lua is object-oriented.
True
What is an event in Roblox Lua?
A signal that something has happened in the game
What is a function in Roblox Lua?
A block of code that can be called
What is the purpose of a ‘for’ loop in Roblox Lua?
To repeat a block of code a certain number of times
What is a ‘variable’ in Roblox Lua?
A placeholder for storing data
What is a ‘table’ in Roblox Lua?
A complex data structure that stores multiple values
True or False: Roblox Lua supports object-oriented programming concepts like inheritance.
True
What is a ‘script’ in Roblox Lua?
A block of code that can be attached to objects in the game
What does the ‘wait’ function do in Roblox Lua?
Pauses the script for a specified amount of time
What is the purpose of an ‘if’ statement in Roblox Lua?
To execute code based on a condition
What is the file extension for Roblox Lua scripts?
.lua
What is the Lua function used to create a new instance of an object in Roblox?
Instance.new()