Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I open and close a door (CanCollide) with buttons?

How do I make it so if I click on a brick it opens Part1 and Part2 to let people in and then how do I make it so if I click on another brick it closes Part1 and Part2 so no body can get in. Also, how do I make it so only I can open and close Part1 and Part2?

2 answers

✓ Accepted answer

Here it is. It's fairly simple to program. Also, inorder for this script to work, you must have a ClickDetector in the part that you are using.

print("fireking100489's door script loaded") --Credits. You can remove 'em, if you want to.

function onClicked(part)
    game.Workspace.Part.Transparency = 0.5
    game.Workspace.Part.CanCollide = false
    wait(5)
    game.Workspace.Part.Transparency = 0
    game.Workspace.Part.CanCollide = true
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

This is not a request site.

4 comments

0

Its okay i guess.

0

No when you ask a quesion it says "This is not a request site."

1

Its called Scripting Helpers beacuse it helps you on scripts that dont work. you havent even shown one.

0

There are differences between requesting for a script and requesting for help, a big one being one of those two isn't welcome here. As the question currently stands, it is quite close to being a valid question but is pretty far from asking for the script.

This discussion is preserved as it was. New answers, comments, and votes are closed.