Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make my door move?

Asked by 9 years ago

I am constructing a lab and I have a big vault door that I want to open and close with the push of a button. I tried looking at other scripts but they either apply to single-part doors or they break upon me attempting to edit it. What should I do?

0
You could out the door in a model, define the actual door as the Primary Part, and use either MoveTo or CFrames to open and close it. aquathorn321 858 — 9y

2 answers

Log in to vote
2
Answered by 9 years ago

Change the Rotation of the door.

Note that you have to use Vector3.new when changing the rotation of parts.

For example:

game.Workspace.ExamplePart.Rotation = Vector3.new(NumberHere,NumberHere,NumberHere)
Ad
Log in to vote
0
Answered by 9 years ago

If you want it to go up or down, simply have a variable with an if function to test if the button is pushed, then have a while <var> is true doto change the part's position for it to change. If there is multiple parts, reverse the script for the other part.

Know that if this doesn't work, I'm not THAT good at scripting, but I thought this would help :)

Answer this question