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

How Do I Make A Coaster Gate?

Asked by 4 years ago

I am trying to make a theme park, and one important thing that I would love to know is how do I make opening gates that will open when the roller coaster arrives to the station? In real life, when the roller coaster comes to a complete stop, the gates open and will stay open for a little bit. After it closes, the coaster will begin. How do I make something like that in ROBLOX?

1
You can use a collective tween via TweenService; a singular open & close maneuver that is assigned to each gate, and simply yield for the appropriate completion time; a function is best suited for this manner. Call said function through a trigger of some sort—a BindableEvent called upon coaster arrival is my personal choice. Ziffixture 6913 — 4y
1
You can simply just create a BoolValue instead, and use use it to define arrival, and departure. Have each program (Coaster, and Gate controller) listening for changes in the Value's state, likely True for arrived and False for leaving. If you wish to take the BindableEvent approach, you can simply fire the event back to tell the coaster to leave. Have each program adjust accordingly for gate open Ziffixture 6913 — 4y
1
The most optimal approach would be to have a BoolValue & Bindable together, with a single Tween script in each gate that runs the respective animation given an instruction bias (just a True or False passed in the Bindable for open/close) for when the Bindable is called. Then create another script to handle the firing of the Bindable, and the toggling of the BoolValue; essentially a middle-man. Ziffixture 6913 — 4y
1
If this is all still too difficult to comprehend, contact the discord in my profile bio, and I'll guide you from there. Ziffixture 6913 — 4y

Answer this question