Skip to content

Commit 8950fc3

Browse files
authored
Merge branch 'main' into Fix_hyperlink_indenting
2 parents 6c0f3da + d540e95 commit 8950fc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/en-us/tutorials/fundamentals/coding-6/create-with-module-scripts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ So the player can open a chest, create a function in **TreasureManager** that aw
332332
local playerTreasure = getPlayerTreasure(whichCharacter)
333333
playerKeys.Value = playerKeys.Value - chestPickCost
334334
playerTreasure.Value = playerTreasure.Value + chestReward
335-
chestPart:Destroy()
335+
chestPart.Parent:Destroy()
336336
end
337337
```
338338

@@ -479,7 +479,7 @@ end
479479

480480
-- Binds every chest part to the touch function so it works on all parts
481481
for chestIndex = 1, #chestsArray do
482-
local chestPart = chestsArray[chestIndex]
482+
local chestPart = chestsArray[chestIndex]:WaitForChild("Collider")
483483
chestPart.Touched:Connect(function(otherPart)
484484
partTouched(otherPart, chestPart)
485485
end)

0 commit comments

Comments
 (0)