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.
COMMUNITY QUESTION
Any way to create a railroad crossing that only triggers when a train is passing?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
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
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?
maybe try a bindable event
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.
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!