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

Any way to create a railroad crossing that only triggers when a train is passing?

Asked by 6 years ago

Ok, you might be questioning what I mean by the title, let me put it this way: You have made a train in roblox, but want a railroad crossing that activates ONLY when the train is coming, not when a player presses a button or steps on something. in other words, automatic.

0
Might need a RemoteEvent for that, which is sending the server to the client by firing. You can check it out here: https://developer.roblox.com/api-reference/class/RemoteEvent fr2013 88 — 6y
0
Provided you are handling replication well, there is no need for any remotes here. OP, is there anything fundamentally wrong with just running a spawn or coroutine thread from the server when your train is coming, and stopping once the train has passed? SummerEquinox 643 — 6y
0
maybe try a bindable event theking48989987 2147 — 6y
0
You could either have an event that fires when the train gets close, or have a loop checking every few seconds the distance from the crossing to the train using magnitude. User#25115 0 — 6y
0
Thanks guys, I'm no good with scripts and i'm making an extremely basic car game, I have no idea what any of this means but I will try to figure it out and get back to you once I have, cheers! Starminer130 5 — 6y

Answer this question