How could I make more detailed braking for trains?

What I want to do is pretty simple. When an engine brakes, I want sparks to come from their wheels. For example, if the engine is going forwards, and then tries to go in reverse while still in motion, sparks should fly from the engine’s wheels until the engine comes to a stop.

I haven’t tried anything yet; I don’t know where to start. My engines use legacy Hinges for wheels.

There’s a few ways to accomplish this, like anything.

You could just have the ParticleEmitters enabled while the user is holding the brake key.

If you want it to only spark when the train is decelerating quickly, you could compare the distance traveled after a short wait (Relatively simple math) and if that is greater than some studs/s then you could enable ParticleEmitters near the wheels

1 Like

Could you maybe give a script for me to try? Sorry, I have little to no experience with scripting (I mostly just modify already written scripts).

This forum isn’t the place to request people to write scripts for you, I don’t know anything about how your existing systems are interacting. You should try breaking your problem down into smaller questions like:

  • How do I know when a user is holding a key?
  • How do I make a change on the server from a client event, like holding a key, so other players can see it? (pssst… RemoteEvents)
  • What is the server-client boundary?
  • What is a vector?

Keep in mind, for the second option I listed, there’s some math involved.
Remember that speed = distance/time

and distance between two points can be found like this:
distance = (vector - otherVector).magnitute)

Asking questions like this will help you become better at scripting in the long run, I know you can do it!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.