- Documentation
- Server functions
- setTrainSpeed
Function
setTrainSpeed
Stores a train's speed along the track.
Syntax
bool setTrainSpeed(vehicle train, float speed)Arguments
trainvehicle- The train.
speedfloat- Speed (units, negative = backwards).
Returns
true on success.
Example
local train = createVehicle(538, 1700, -1950, 14)
setTrainSpeed(train, 0.5)
Notes
State for scripts. See setTrainDerailed.