Beginning Vocabulary 1 Flashcards
Variable
A name associated with a value.
Local
The term local means that the variable is only going to be used in this part of the script.
Equal Sign
Used to set values of variables
script.Parent
script.Parent is used to find the part the script is located in.
Naming Variables
Lowercase with every first word being capitalized. (justLikeThis)
Function
A function is a named block of code that help you organize your code and use it in multiple places without writing it again.
How are properties accessed?
Using a dot notation
Calling a function
You can call a function by writing its name with parentheses next to it.
While loop
A while loop runs the code inside it for as long as the statement after while remains true.
What if a while loop needs to run forever?
The statement after while should just be true. (Also known a an while true loop)
Wait function
Makes the program wait a number of seconds before going to the next line of code Example wait(4)
Why do you never make a while true loop without including a wait function?
If you do this, your game will freeze because Studio would never have a chance to leave the loop and do anything else. (Also don’t test your game either)
Events
Events send out signals when specific things happen in the game. To fire an event is to send out a signal. You can connect to events to run functions when they fire.
Touched Event
A Touched event fires when something touches.
Function Parameters
Also known as placeholders passed through a function. Parameters are definitions of what a function expects to receive when it’s called. Parameter variables are used to import arguments into functions. Parameters are the names listed in the functions definition.
Argument
Unlike parameters, (placeholders) function arguments are the real values passed through the function.
Dot notation
Used to separate names of objects, properties, and keywords like “new” Example: game.Workspace.PartName.BrickColor = BrickColor.new (0.9, 0.8, 0.1)
Properties
Any characteristic of an object Examples: color, visibility, speed, health points
While true do
Loops the code between while true do and end over and over
Parents and children
The relationship between two objects. For example, If you put a script into a part the part becomes the parent of the script.
script.Parent
Directs a script to its parent. Usually a part.
String Variables
Holds groups of letters and/or numbers. Uses quotation marks.
Numerical Variables
Used to count things. Does not have quotation marks.
Print function
Displays text on the screen.
Character Model
the Character model contains all of the objects that make up the player’s avatar in the game, including: The individual body parts of the player, any clothing and accessories worn by the player, The Humanoid, a special object which contains many properties related to the player, including the players health.
FindFirstChild
The purpose of the FindFirstChild function is to find the first child of an object that matches a given parameter.
If statement
The code in an if statement run if the condition defined in the first line is true. Example:
if humanoid then
Boolean Logic
In Lua, any other value other than false or nil is evaluated as true in a conditional statement.
Nil
An empty value.
Conditional Statement
A Conditional statement is one that acts to run other code if its result is true or not.
humanoid.Health
The health property of the humanoid.
For Loop
A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.
Iteration
Each loop of the code in a for loop.
3 Things a for loop is defined as
Control Variable: The variable created and used to count the loops.
End Value: The value it has to get to for the loop to stop.
Step increment: Determines what to add to the control variable each loop. If left out, defaults to 1.
Debouncing
A debounce system is a set of code which keeps a function from running too many times.
Negate Operator
The Lua not operator reverses the value of whatever follows it.
ServerScriptService
Scripts placed in ServerScriptService will automatically run when the game starts. ServerScriptService is a container service for scripts and module scripts, and other scripting related assets that are only meant for server use. The contents are never replicated to player clients at all, which allows for a secure storage of important game logic.
Service
A service is an object which contains built in properties, functions, events, and callbacks.
Callbacks
Callbacks are write-only members of objects that are set to functions. You cannot invoke a callback directly — Roblox will internally trigger the callback function, and pass to it relevant information your callback handler/function will need.
Players Service
The players game service contains only player objects. for presently connected clients to a game server. It also contains information about a place’s configuration (such as bubble chat or classic chat). It can fetch information about players not connected to the server, such as character appearances, friends and avatar thumbnail.