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

Description:

TrainSportation main goal is to allow you to drive trains. The idea is other resources can spawn trains (like for a job) and this resource will handle the driving of the train.

But, it does comes with a simple train spawning script that you can disable inside config.lua (by setting Config.Debug to false)

If debug is on, you will see two (by default) green T icons on your map. To spawn a train stand in the green circle and press G (can change in config.lua)

Controlling the Train

Thanks to HJDCZY (github)! The latest update (2/4/24) allows you to open/close the doors of the trains!

You can walk into the trolley as a passenger with this! (default is , and . for left and right)

The train acceleration is controlled by a lever, holding SpeedUp increases this lever, and SpeedDown decreases it. EBreak will set the lever to 0 causing the train to break.

Install:

Download from the github below, make sure to ā€˜ensure TrainSportationā€™ in your server config!

Keybinds, changeable in config.lua


Config.KeyBind = {

SpeedUp = 71, -- W Lever Up

SpeedDown = 72, -- S Lever Down

EBreak = 73, -- X Brake

EnterExit = 75, -- F Enter/Exit

LeftDoor = 82, -- , Open/Close Left Doors

RightDoor = 81 -- . Open/Close Right Doors

}

Config.KeyBind.Debug = { -- Only work when Config.Debug is true

SpawnTrain = 58, -- G, Spawn while inside green circle

DeleteTrain = 111 -- Numpad 8, Delete train that you are looking at

}

Download:

https://github.com/LexTheGreat/TrainSportation/archive/master.zip

Images:

https://i.imgur.com/VMzjkLQ.jpeg

30 Likes

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.

Awesome!

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

1 Like

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

1 Like

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ā€¦

1 Like

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: