Beginning Vocabulary 1 Flashcards

1
Q

Variable

A

A name associated with a value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Local

A

The term local means that the variable is only going to be used in this part of the script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Equal Sign

A

Used to set values of variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

script.Parent

A

script.Parent is used to find the part the script is located in.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Naming Variables

A

Lowercase with every first word being capitalized. (justLikeThis)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Function

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How are properties accessed?

A

Using a dot notation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Calling a function

A

You can call a function by writing its name with parentheses next to it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

While loop

A

A while loop runs the code inside it for as long as the statement after while remains true.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What if a while loop needs to run forever?

A

The statement after while should just be true. (Also known a an while true loop)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Wait function

A

Makes the program wait a number of seconds before going to the next line of code Example wait(4)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why do you never make a while true loop without including a wait function?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Events

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Touched Event

A

A Touched event fires when something touches.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Function Parameters

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Argument

A

Unlike parameters, (placeholders) function arguments are the real values passed through the function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Dot notation

A

Used to separate names of objects, properties, and keywords like “new” Example: game.Workspace.PartName.BrickColor = BrickColor.new (0.9, 0.8, 0.1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Properties

A

Any characteristic of an object Examples: color, visibility, speed, health points

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

While true do

A

Loops the code between while true do and end over and over

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Parents and children

A

The relationship between two objects. For example, If you put a script into a part the part becomes the parent of the script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

script.Parent

A

Directs a script to its parent. Usually a part.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

String Variables

A

Holds groups of letters and/or numbers. Uses quotation marks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Numerical Variables

A

Used to count things. Does not have quotation marks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Print function

A

Displays text on the screen.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Character Model

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

FindFirstChild

A

The purpose of the FindFirstChild function is to find the first child of an object that matches a given parameter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

If statement

A

The code in an if statement run if the condition defined in the first line is true. Example:
if humanoid then

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Boolean Logic

A

In Lua, any other value other than false or nil is evaluated as true in a conditional statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Nil

A

An empty value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Conditional Statement

A

A Conditional statement is one that acts to run other code if its result is true or not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

humanoid.Health

A

The health property of the humanoid.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

For Loop

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Iteration

A

Each loop of the code in a for loop.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

3 Things a for loop is defined as

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Debouncing

A

A debounce system is a set of code which keeps a function from running too many times.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

Negate Operator

A

The Lua not operator reverses the value of whatever follows it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

ServerScriptService

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

Service

A

A service is an object which contains built in properties, functions, events, and callbacks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Callbacks

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

Players Service

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

PlayerAdded Event

A

The PlayerAdded event fires when a players joins a game. This is used to fire an event when a player joins a game, such as loading the players saved GlobalDataStore data

42
Q

PlayerRemoving event

A

The PlayerRemoving event fires right before a Player leaves the game. This event fires before ChildRemoved does on Players.

43
Q

GetService Function

A

Returns a service with the class name requested.

44
Q

Variables for Services

A

When declaring a variable to contain a service, it’s best to name it with the exact name of the service, even though this means breaking the usual naming conventions for variables.

45
Q

Folder

A

A simple container used to hold and organize Roblox objects. Unlike other container classes like Model, it offers no additional functionality.

46
Q

Instance

A

Instance is the base class for all classes in the Roblox class hierarchy. Every other class that the Roblox engine defines inherits all of the members of Instance. It is not possible to directly create Instance objects.

47
Q

IntValue

A

An IntValue is an object that stores a single signed 64-bit integer. Integers do not include decimal points. The highest value that can be stored is 2^63-1, or around 9.2 quintillion.

48
Q

Instance.new Function

A

Instance has a special function called Instance.new which is used to create objects via code. This function takes the name of the class as a parameter and returns the created object. Abstract classes and services cannot be created with the Instance.new function.

49
Q

Get Players Function

A

This method returns a table of all presently connected Player. It functions the same way Instance:GetChildren would except that it only returns Player objects. It functions similarly to Instance:GetChildren when called on Players. 0 When used in conjunction with a for-loop, it is useful for iterating over all players in a game.

50
Q

Array

A

An array is a list of items stored in order. Each item can be accessed by its index position, starting from 1. You can get the length of an array by prefixing it with #.

51
Q

Iterate

A

Iteration in programming means repeating steps, or instructions , over and over again.

52
Q

Accessing Array Values

A

Objects stored in array are accessed using square brackets.

53
Q

CharacterAdded

A

The CharacterAdded event fires when a player’s character spawns (or respawns).

54
Q

Anonymous Functions

A

Functions can be created anonymously, that is without assigning them a name. This is useful when you need to call a function from the result of another function or event, for instance a delay() call or a PlayerAdded event connection.

55
Q

Humanoid

A

The Humanoid is a special object that gives models the functionality of a character. It grants the model with the ability to physically walk around and interact with various components of a Roblox level.

56
Q

Died Event

A

This event fires when the Humanoid dies, usually when Humanoid.Health reaches 0. This could be caused either by disconnecting their head from their Humanoid. Torso, or directly setting the health property. This event only fires if the Humanoid is a descendant of the Workspace. If the Dead HumanoidStateType is disabled it will not fire.

57
Q

WaitForChild

A

Returns the child of the Instance with the given name. If the child does not exist, it will yield the current thread until it does.

58
Q

When should you use WaitForChild?

A

WaitForChild is extremely important when working on code ran by the client (in a LocalScript). Roblox does not guarantee the time or order in which objects are replicated from the server to the client. This can cause scripts to break when indexing objects that do not exist yet.

59
Q

Attributes

A

Attributes allow you to customize objects in Roblox with your own data. An attribute consists of a name and a value.

60
Q

SetAttribute Function

A

This function sets the attribute with the given name to the given value. If the value given is nil, then the attribute will be removed (since nil is returned by default).

61
Q

GetAttribute

A

This function returns the attribute which has been assigned to the given name. If no attribute has been assigned then nil is returned.

62
Q

Constants

A

Constants are a type of variable which do not change.

63
Q

FindFirstChildWhichIsA Function

A

Returns the first child of the Instance for whom Instance:IsA returns true for the given className.

If no matching child is found, this function returns nil. If the optional recursive argument is true, this function searches all descendants rather than only the immediate children of the Instance.

64
Q

IsA Function

A

IsA returns true if the Instance’s class is equivalent to or a subclass of a given class. This function is similar to the instanceof operators in other languages, and is a form of type introspection.

65
Q

FindFirstChildOfClass

A
Returns the first child of the Instance whose ClassName is equal to the given className.
If no matching child is found, this function returns nil. Unlike Instance:FindFirstChildWhichIsA this function uses only returns objects whose class matches the given className, ignoring class inheritance.
66
Q

When should you use Instance:FindFirstChild?

A

Developers looking for a child by name, should use Instance:FindFirstChild.

67
Q

GetChildren Function

A

Returns an array (a numerically indexed table) containing all of the Instance’s direct children, or every Instance whose Parent is equal to the object. The array can be iterated upon using either a numeric or generic for-loop:

68
Q

GetDescendants Function

A

The GetDescendants function of an object returns an array that contains all of the descendants of that object. Unlike Instance:GetChildren, which only returns the immediate children of an object, GetDescendants will find every child of the object, every child of those children, and so on and so forth.

69
Q

Model

A

Models are container objects, meaning they hold objects and group objects together. They are best used to hold collections of BasePart s and have a number of functions that extend their functionality.

70
Q

BasePart

A

BasePart is an abstract base class for in-world objects that render and are physically simulated while in the Workspace.

71
Q

Decal

A

The Decal object is an object which applies an image to a face of a BasePart.

72
Q

pairs and iPairs

A

pairs() and ipairs() are functions that can be used with a for loop to go through each element of an array or dictionary without needing to set starting or ending points. pairs() is used with dictionaries, and ipairs() is used with arrays. The “i” in ipairs() stands for “index.”

73
Q

How is a for loop using ipairs defined?

A
  • Index*: this is equivalent to the control variable in a regular for loop.
  • Value*: this will be populated with each element in the array as the loop iterates. It’s a good idea to name the value variable after what it will actually contain.
  • Array*: the array you want to iterate over is passed to the ipairs function.
74
Q

Tool

A

Tools are objects that a Humanoid object can equip. For players, they are stored in a Backpack object parented to a Player object.

75
Q

MeshPart

A

MeshParts are a form of BasePart that includes a physically simulated custom mesh. Unlike with other mesh classes, such as SpecialMesh and BlockMesh, they are not parented to a BasePart but rather behave as a BasePart in their own right.

76
Q

SpecialMesh

A

The SpecialMesh is an object that allows developers to provide a standard template or user uploaded mesh to a BasePart.

77
Q

BlockMesh

A

The BlockMesh object applies a ‘brick’ mesh to the BasePart it is parented to. It behaves identically to a SpecialMesh with SpecialMesh.MeshType set to ‘brick’.

78
Q

What do all tools that players carry have to contain?

A

Tools that players carry must contain a single part named Handle

79
Q

Collectible Tool

A

A tool can be placed in the workspace if players will be able to collect it as they explore.

80
Q

Starter Tools

A

If you want all players to start out with a tool in their inventory, put it inside the StarterPack folder. When any player spawns, the tool will get copied to their backpack.

81
Q

Earned/Purchased Tool

A

Some tools should be awarded when a player does something special, or offered for sale in an in-game store. These should be put inside ServerStorage and then cloned to the player’s backpack at the proper time.

82
Q

StarterPack

A

A service-level container whose contents are copied into each Player’s Backpack when the player spawns. It is generally used to hold Tools, but is sometimes used to hold LocalScripts to ensure that each player gets a copy.

83
Q

Backpack

A

A container object that holds a Player’s inventory. Any Tool in a player’s Backpack will be displayed in their inventory at the bottom of their screen. Selecting Tools from the inventory will equip the Tool, moving it from the Backpack to the player’s character.

84
Q

Equipped event

A

Fired when a tool is equipped by the player, for example when a tool is selected in the hotbar.

85
Q

Unequipped event

A

Fired when a tool is unequipped by the player, for example when a tool is deselected in the hotbar.

86
Q

Activated

A

Fired when a tool is activated by the player, for example when a player left-clicks.

87
Q

Local Script

A

A LocalScript is a Lua source container that runs Lua code on a client connected to a Roblox server. They are used to access client-only objects, such as the player’s Camera.

88
Q

A LocalScript will only run Lua code if it is a descendant of one of the following objects:

A
A Player’s Backpack, such as a child of a Tool
A Player’s character model
A Player’s PlayerGui
A Player’s Player Scripts.
The ReplicatedFirst service
89
Q

PlayerGui

A

The PlayerGui object is a container that holds a Player’s user GUI.

90
Q

ScreenGui

A

The main storage object for 2D GuiObject displayed on the player’s screen. ScreenGui will only be shown if parented to a player’s PlayerGui.

91
Q

Raycasting

A

Raycasting creates an invisible ray from a start position towards a given direction with a defined length. If the ray collides with objects or terrain in its path, it will return information on the collision such as the position and the object it collided with. AND/OR: At its most basic level, raycasting is the act of sending out an invisible ray from a Vector3 point in a specific direction with a defined length. Once cast, you can detect if the ray hits a BasePart or Terrain cell.

92
Q

Vector3

A

Vector3 describes a vector in 3D space, typically usually used as a point in 3D space or the dimensions of a rectangular prism.

93
Q

UserInputService

A

The UserInputService is a service used to detect and capture the different types of input available on a user’s device.

94
Q

Ray

A

A Ray is a half-line, finite in one direction but infinite in the other. It can be defined by a 3D point, where the line originates from, and a direction vector, which is the direction it goes in.

95
Q

ViewportPointToRay

A

This function creates a unit Ray from a 2D position on the viewport (defined in pixels). This position does not account for the GUI inset. The Ray originates from the Vector3 equivalent of the 2D position in the world at the given depth (in studs) away from the Camera.

96
Q

ScreenPointToRay

A

This function creates a unit Ray from a 2D position on the screen (defined in pixels). This position accounts for the GUI inset. The Ray originates from the Vector3 equivalent of the 2D position in the world at the given depth (in studs) away from the Camera.

97
Q

Raycast Function

A

Casts a ray using an origin, direction, and optional RaycastParams. If it finds an eligible BasePart or Terrain cell, a RaycastResult is returned containing the results of the operation. If no RaycastParams object is provided, the defaults are used (all parts are considered and Terrain water is not ignored).

98
Q

RaycastResult

A

RaycastResult stores the result of a successful raycasting operation performed by WorldRoot:Raycast(). It contains the properties listed below.

99
Q

RaycastParams

A

RaycastParams stores parameters for WorldRoot:Raycast() operations. The FilterDescendantsInstances property stores an array of objects to use as either a whitelist or blacklist based on the FilterType enum. If desired, the IgnoreWater property can be used to ignore Terrain water and the CollisionGroup property can specify a collision group for the raycasting operation.

100
Q

Terrain

A

Terrain lets you create dynamically morphable environments with little to no lag. It is currently based on a 4×4×4 grid of cells, where each cell has a number between 0 and 1 representing how much the geometry should occupy the cell, and the material of the cell. The occupancy determines how the cell will morph together with surrounding cells, and the result is the illusion of having no grid constraint.

101
Q

How to connect functions to events

A

event using a dot notation. then call the connect function using a colon, then pass the function you want to run in parentheses. Example: part.Touched:Connect(destroy)