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

How Do I make a Gate Go Up And Down?

Ive Tryed 2 Times Neither have worked also i have only made 1 script before so Dont Judge.

3 answers

Well, you possibly want to use a free model if your a starter or possibly just use the X,Y,&Z.

I do this all the time for railroad crossings. You'll want to have a motor part at the rear end of the gate that will move it up and down, the motor must be attached to something on each side of it using a joint. Insert a BodyAngularVelocity into the motor part. Now you need to change the angularvelocity and maxTorque values to make it strong enough to life your gate. (Counterweights can be used for more experienced people, who could also use a Cframe script instead of BodyAngularVelocity.) Now you just need a script to change the BodyAngularVelocity's angularvelocity value. It may look something like this:

script.Parent.Motor.BodyAngularVelocity.angularvelocity = Vector3.new(0,0,-1.5)

You'll have to play around with the X Y and Z values in the BodyAngularVelocity to get it to work in the right direction. (No use having the wrong numbers in making it try to go sideways.) It's not that hard after you do it a few times, but expect a bit of trial and error if this is your first time making a gate. Once you get the hang of it, try to make a gate using Cframing instead of the motor. Contact me via Email DieselElevators@Gmail.com if you want me to show you some of my examples, or need more help.

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