- Documentation
- Server functions
- setTrainDerailed
Function
setTrainDerailed
Stores whether a train is derailed.
Syntax
bool setTrainDerailed(vehicle element, bool value)Arguments
elementvehicle- The train (locomotive or carriage).
valuebooltrue= derailed.
Returns
true on success.
Example
local train = createVehicle(538, 1700, -1950, 14)
setTrainDerailed(train, true)
Notes
State for scripts. Trains in the game do not react to this or the other train functions yet (setTrainSpeed, setTrainTrack, setTrainPosition, setTrainDirection, setTrainDerailable); the values are stored on the server.