[Release] TrainSportation ~ Drive & Be a Passenger in a train!



Working so far:

  • Spawn Trains with (G) inside the green maker (Two markers for both trains, Requires Config.Debug to be true)
  • Enter Trains as Driver (F)
  • Two types of trains with different speeds/accelerations
  • Able to enter Trolley as passenger. It will teleport you in the back of the Trolley.


  • Fix being able to get into a trailer the train is pulling. :dizzy_face:

TrainSportation allows you to drive trains, as well as spawn them at the locations marked with a T IF Config.Debug is true. This resource will soon let you enter a Trolley as a passenger, but for now lets you drive them.


  • G = Spawn train while in Green circle/marker (Need Config.Debug = true in config.lua)
  • F = Enter/Exit (Your Ped has be looking at the train.)
  • W = Push Accelerate Lever Forwards
  • S = Pull Accelerate Lever Backwards
  • X = Set Accelerate Lever to stop, and E break
  • W+S = Debug instant stop. (requires Config.Debug = true)
  • KP8 = Delete train ped is looking at.


  1. Spawn a train (Use Config.Debug = true, or another resource to spawn a train)
  2. Go to the front of the train, look at it, then Press F (Make sure it’s the drive-able part of the train, otherwise you might end up inside a trailer.)

This resource doesn’t use any networking. Instead it uses ray casts to get into the train.



Trains in FiveM
[Unsupported] Driveable Trains
How can i stream trains
Can someone make this work with FiveM
Train on a track
[Release] TrainJob ~ Simple Job using TrainSportation

How effective is this? I never thought of doing that but it doesnt seem half bad


Train just vanishes every time.


Works fine. Gets the train every time.

You have any other resources? Recuse this doesn’t delete trains, unless you are looking at it and pressing KP8. Something else is deleting your trains.


After 50 tries i got inside the train but not able to drive it. But it does seem to vanish alot for some reason while trying to enter. This is a clean version of the server with no other scripts.


I’m using it on a clean sever just fine. Can you send me your logs?


Lex, I tested this out and I was able to drive the train as two different clients so your method does appear to work. I’m sitting in the train for about 5 minutes now and I even disconnected the user who spawned the train and it didn’t despawn.

One thing I noticed that was a weird behavior was that once I spawned the train and left it. The train started driving by itself. Once I stepped back on the train it was fine.



No idea how to fix this lol! The AI takes over if nothing is driving a train…


have blips on map, but no markers in game and G dont work. What am I missing?


(If the circle is not visible reload the resource I had this happen to me a few times…)

I have to find out what is causing this. In your server console type ‘restart TrainSportation’ without the 's


Yep works like a charm once you restart the resource…


Lex how can we get the train horn to work? I think that would be cool.


Press E? I thought it already worked :o


If the player is actually inside like, driving the vehicle, the horn works like any other, no changes needed


Yes Sorry just seen that… Any future updates like making actual stops or able to charge people to ride the train? Making it an actual job?


No, if any server wants to use this they can! It shouldn’t be that hard to make a job and include this resource. As long as a train is spawned, this resource will let you get into it as a driver, or passenger. :+1:


lol it works fine by yourself, as soon as a few people get on… forget it lol


What do you mean? :o


if people are around its bugs out and lags bad…


What do you mean by bugs out? Let me know if you are having problems with this and I’ll look into it.
I need to know what the problem is to fix it though. D: