ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setTrainSpeed

Function

setTrainSpeed

ServerVehiclesIdentical to MTA:SA

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.

See also