1 | function onClicked(playerWhoClicked) |
2 | game.Workspace.Model_CH.Building_Door_House.CanCollide = true |
3 | end |
4 |
5 | script.Parent.ClickDetector.MouseClick:connect(onClicked) |
There is a ClickDetector in the brick and it doesn't work the door stays CanCollide False Thanks!
If the script is a local script that make it a regular script and then also try the script without the "playerWhoClicked". It would look like this.
1 | function onClicked() |
2 | game.Workspace.Model_CH.Building_Door_House.CanCollide = true |
3 | end |
4 |
5 | script.Parent.ClickDetector.MouseClick:connect(onClicked) |
Make sure to put this in a regular script.
1 | local CD = script.Parent:WaitForChild( "ClickDetector" ) -- CD = Click Detector |
2 |
3 | function onClicked(player) |
4 | game.Workspace.Model_CH.Building_Door_House.CanCollide = true |
5 | end |
6 |
7 | CD.MouseClick:connect(onClicked) |