[RELEASE] FiveM-Trains : Complete standalone AI trains system and enterable trains

Have you had the issue where a whole bunch of ghost random train cars sit static on the tracks. A moving train will drive right through them.
Like these just spawn all over the place…

then the trains comes

willemde20 kan mie tedeapols spelen

Why does this not appear to be working on my server?

A few artifacts ago I had to do some tweaking to make it work. Problem is my memory sucks and I cannot remember wtf I did! I was just messing around with it by looking at by client error logs from FiveM and also server logs/console. Sorry I wish I could remember what I did but it was like 2 months ago.

Every now and then it will cause a client crash on load in. When it tries to load the trains, then the crash happens to someone who is first to join server. But its rare.

Note: I dont use the ticket system or stations I just use it for trains to drive around.

Odd, mine seem to have stopped working suddenly too

Edit I now have OneSync Infinity and thats why it doesnt work.
It DOES work with OneSync though.

I am using OneSync (not Infinity), But whenever I load into my server, My game crashes. It is something todo with this train script. My game only crashes when I have this script in sever.

Update, I made sure to force the latest game build. I’m still using OneSync Infinity and it IS WORKING for me. I do not use the ticketing system though. I just let the trains drive around for a nice effect.

Hello, I have been trying to find a working script that allows the trains to simply drive around in my FiveM server that is using onesync which has brought me to this thread. My question for you is when you say you have it working are you referring to the downloadable version of the script which is the first post (release) on this page. Like TheNickoos release that’s a few years old on github? Or is there a different download or resource that you are using to get this working?

1 Like

Release 1.2 · TheNickoos/FiveM-Trains · GitHub is what I’m using

Would you be willing to share the script you came up with after those tweaks?

1 Like

have the same problem. did you already find out why?

No, I have stopped trying to get this to work with OneSync. I decided to create my own AI train script in C#.
It kind of works. Still a tiny issue with trains spawning after the old host leaves.

My script is working fine, but when the subway arrives, it opens the doors automatically, and because of that sometimes the player enters the subway and ends up leaving alone a few seconds later. Is there any way to block the doors from opening or hitch the ped to the train?

Does it still not work with latest FxServer build?

It seems finnicky. Sometimes it works sometimes it doesnt

Are you able to share how you made the stations work with coords?

Hello Guys
Has anyone of you an resolution that i can make it work with ESX Legacy 1.7.5?
It doesnt work and i insert the variables for ESX to make it work with ESX

Wouldnt it be much easier to dig in and find out what exactly the native does to just reconstruct it on the server? I am thinking to invest some work to try and extract the trainpath used by this native. This shouldnt pose a problem anymore then I guess.

I believe it is the CreateMissionTrain() functions with the variation set as 24 (For the Metro). I am not 100% sure though.
I went through everything, one by one removing code, adding code. and I believe it crashes due to that.
It was a couple months ago. I may be wrong though.

I will try and test it the other Day and let you know, thank you :slight_smile:

1 Like