You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many Roblox worlds are dynamic; parts might move or fall and floors may collapse. This can block a computed path and prevent the character from reaching its destination. To handle this, you can connect the `Class.Path.Blocked` event and re-compute the path around whatever blocked it.
345
349
346
350
<Alertseverity="warning">
347
-
Paths may also become blocked somewhere **behind** the agent, such as a pile of rubble falling on a path as the agent runs away, but that doesn't mean the agent should stop moving. The conditional statement on line 31 makes sure that the path is re-computed only if the blocked waypoint is **ahead** of the current waypoint.
351
+
Paths may also become blocked somewhere **behind** the agent, such as a pile of rubble falling on a path as the agent runs away, but that doesn't mean the agent should stop moving. The <TypographynoWrap>`if blockedWaypointIndex >= nextWaypointIndex`</Typography> check makes sure that the path is re-computed only if the blocked waypoint is **ahead** of the current waypoint.
348
352
</Alert>
349
353
350
354
```lua title='LocalScript - Character Pathfinding' highlight='16, 29-37'
Copy file name to clipboardExpand all lines: content/en-us/characters/r6-to-r15-adapter.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,12 +27,12 @@ The adapter parts perform the following:
27
27
28
28
## Enable the R6 to R15 Adapter
29
29
30
-
You can enable the R6 to R15 Adapter by setting the `Class.Workspace.AvatarUnificationMode` property in Workspace. You can only access this property if **Avatar Type** is set to `R6` in your **Game Settings**. At this time, the **Default** setting disables the `Class.Workspace.AvatarUnificationMode|AvatarUnificationMode`.
30
+
You can enable the R6 to R15 Adapter by setting the `Class.Workspace.AvatarUnificationMode|AvatarUnificationMode` property in `Class.Workspace`. You can only access this property if **Avatar Type** is set to `R6` in your **Game Settings**. At this time, the **Default** setting disables unification mode.
31
31
32
32
To enable the R6 to R15 Adapter:
33
33
34
-
1. In the Explorer, navigate to **Workspace**.
35
-
2. In the Properties window, set **AvatarUnificationMode** to **Enabled**.
34
+
1. In the **Explorer**, navigate to **Workspace**.
35
+
2. In the **Properties** window, set **AvatarUnificationMode** to **Enabled**.
Copy file name to clipboardExpand all lines: content/en-us/chat/legacy/legacy-chat-system.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,11 +140,13 @@ Command functions are often used to implement [Admin Commands](../../chat/legacy
140
140
In this example a **ChatModule** is used to create a `Class.Part` if a user types `/part` in the chat. Note that this function returns true if a part was created which will stop the message from proceeding and no message will be displayed. If a part is not created, this function needs to return false so that the message can continue working through the system.
Copy file name to clipboardExpand all lines: content/en-us/luau/functions.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,16 +78,18 @@ Methods are functions that are members of an object, such as a [class](/referenc
78
78
All objects in Roblox descend from `Class.Instance` and have commonly used methods including `Class.Instance:Destroy()`, `Class.Instance:Clone()`, and `Class.Instance:FindFirstChild()`.
You can use `nil` to clear some properties of objects. For example, you can set the `Parent` of an object to `nil` to effectively remove the object from the experience. To return the object to the experience after you remove it, reassign the `Parent`. The following example demonstrates how to use `nil` to remove a `Class.Part`:
30
30
31
31
```lua
32
+
localWorkspace=game:GetService("Workspace")
33
+
32
34
-- Create a new brick
33
35
localpart=Instance.new("Part")
34
-
-- Parent new Part to the workspace, making it viewable
35
-
part.Parent=workspace
36
+
-- Parent new part to the workspace, making it viewable
37
+
part.Parent=Workspace
36
38
task.wait(1)
37
-
-- Remove the Part from view, but not from memory
39
+
-- Remove the part from view but not from memory
38
40
part.Parent=nil
39
41
task.wait(1)
40
-
-- Part still exists because it's referenced by the variable 'part', so it can be returned to view
41
-
part.Parent=workspace
42
+
-- Part still exists because it's referenced by the variable "part", so it can be returned to view
Unlike some languages, Luau uses 1-based indexing for arrays, so the first item in the array is <InlineCode>[1]</InlineCode>, not <InlineCode>[0]</InlineCode>.
46
+
Unlike some languages, Luau uses 1-based indexing for arrays, so the first item in the array is `[1]`, not `[0]`.
47
47
</Alert>
48
48
49
49
### Write to arrays
50
50
51
51
To define or rewrite the value of an array at an index, declare the index number in square brackets (`[index]`) followed by `=` and the value:
@@ -62,10 +62,10 @@ print(testArray[4]) -- New string
62
62
63
63
### Iterate over arrays
64
64
65
-
To iterate over an array, you can use a `for` loop. Because the arrays have numerical indices, you can also use a numeric `for` loop from **1** to the length of the array (`#array`).
65
+
To iterate over an array, you can use a `for` loop. Because the arrays have numerical indices, you can also use a numeric `for` loop from `1` to the length of the array (`#array`).
66
66
67
67
```lua
68
-
localtestArray= {"A string", 3.14159, workspace.Camera, "New string"}
68
+
localtestArray= {"A string", 3.14159, true, "New string"}
Copy file name to clipboardExpand all lines: content/en-us/luau/type-coercion.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,20 +38,22 @@ Some properties expect certain data types, such as an [Enum](#enums) or string,
38
38
Luau coerces numbers and strings of enum values into the full enum name. For example, you can name the value of the `Class.Part.Material` property using a number, string, or full enum name, and the `print()` function always prints the full enum name. It's best practice to be explicit and use the full enum name. For more information on Enums, see [Enums](./enums.md).
39
39
40
40
```lua
41
+
localWorkspace=game:GetService("Workspace")
42
+
41
43
localpart1=Instance.new("Part")
42
44
part1.Material=816
43
-
part1.Parent=workspace
45
+
part1.Parent=Workspace
44
46
print(part1.Material) -- Enum.Material.Concrete
45
47
46
48
localpart2=Instance.new("Part")
47
49
part2.Material="Concrete"
48
-
part2.Parent=workspace
50
+
part2.Parent=Workspace
49
51
print(part2.Material) -- Enum.Material.Concrete
50
52
51
53
-- This is best practice because it's the most explicit
0 commit comments