If a player click a button, then it opens and when the player get in, it will close.
01 | --Simple Version |
02 | local ting = 0 |
03 | function OnCLick() |
04 | if ting = = 0 then |
05 | ting = 1 |
06 | game.Workspace.Door.CanCollide = false |
07 | wait( 2 ) |
08 | game.Workspace.Door.CanCollide = true |
09 |
10 | local ting = 0 |
11 | end |
12 | end |
13 |
14 | script.Parent.ClickDetector.MouseClick:connect(OnCLick) |
Put this script inside of the button with Click Detector
Create a block in workspace called Door Make sure its anchored