Answered by
7 years ago Edited 7 years ago
First you need to detect when the ElevatorDoor is destroyed. This can be done like this:
1 | game.Workspace.ChildRemoved:Connect( function (obj) |
2 | if obj.Name = = "ElevatorDoor" then |
The first line is an event that fires when something in the workspace is destroyed. This event returns the object that was destroyed which is why the obj was put in the parentheses.
The event returns the obj that was destroyed. We need to check that the item that was destroyed was the elevator door and not just any object. That is what the if statement is for. Ok, let's add a little more to our previous code:
1 | game.Workspace.ChildRemoved:Connect( function (obj) |
2 | if obj.Name = = "ElevatorDoor" then |
4 | game.Workspace.Elevator.FakeDoor.CanCollide = true |
So basically, translated to english this is what it says:
When something inside the workspace is destroyed,
If the thing that was destroyed is the elevator door,
Set the collision of the fake door to true
end
end
Hope this helps!