Brick = game.Workpsace.Part --[You may need to edit this line]
enabled = true
function onTouched(hit)
if not enabled then return end
enabled = false
Brick.CanCollide = false
wait(3)
Brick.CanCollide = true
wait(15)
enabled = true
end
Brick.Touched:connect(onTouched)
I would rather prefer to use 2 bricks and partially CFrame them together so that if someone is trying to come in from the other side of the brick they cannot go in through that side. If you do use 2 bricks heres a script for that.
Brick = game.Workspace.Part1 --[You may ned to edit this line]
Bricktwo = game.Workspace.Part2 --[You may need to edit this line]
enabled = true
function onTouched(hit)
if not enabled then return end
enabled = false
Brick.CanCollide = false
Bricktwo.CanCollide = false
wait(3)
Brick.CanCollide = true
Bricktwo.CanCollide = true
wait(15)
enabled = true
end
Brick.Touched:connect(onTouched)
|