- Documentation
- Server functions
- setTrainPosition
Function
setTrainPosition
Stores a train's position on the track as the distance from the start of the track.
Syntax
bool setTrainPosition(vehicle train, float position)Arguments
trainvehicle- The train.
positionfloat- Distance from the start of the track in metres.
Returns
true on success.
Example
local train = createVehicle(538, 1700, -1950, 14)
setTrainPosition(train, 1200)
Notes
State for scripts. See setTrainDerailed.