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

How would i make a opening and closing gate with a button?

Asked by 4 years ago

Trying to make a big stone gate so when you press a green button both sides of the gate retract so you can walk through like a automatic door. Then you can press the red button to shut them again to let the cycle continue. The problem is i tried using cframe with the click detectors but it was quickly teleporting the walls instantly to the other sides as i wanted a smooth opening. The other times it just broke when i wanted it to close. Any help or suggestions would be great!!

3 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

Try using Tween Service

This video should help

https://www.youtube.com/watch?v=qgGDwTn0zgo

Ad
Log in to vote
0
Answered by 4 years ago

Try using a for loop moving the door a little bit at a time.


for i = 0, 100, 1 do --move the door .1 stud end
Log in to vote
0
Answered by
Farsalis 369 Moderation Voter
4 years ago

Wow, I totally over-complicated this by a landslide xD. You should just be able to use, TweenService for the Gate. Like thoughtless_space said. Anyways, if you want, take a look at this:

https://drive.google.com/drive/folders/1AmOHigix6vZ5cTZY-CUPyjXDtBd7VKkQ?usp=sharing

0
Thanks! ill look into this Coneyard 23 — 4y

Answer this question