SetRandomTrains
DocsSetRandomTrains(toggle)Description
Enables spawning random trains on the preset tracks.
Requires <code>SWITCH_TRAIN_TRACK</code> and <code>SET_TRAIN_TRACK_SPAWN_FREQUENCY</code> to be set.
Parameters
| Name | Type | Description |
|---|---|---|
toggle | BOOL | Whether to enable random trains. |
Vehicle Models

adder
alpha
blade
ardent
asea
cogcabrio
baller
blistaReturns
voidThis native does not return a value.
Examples
Official
SwitchTrainTrack(0, true) -- Setting the Main train track(s) around LS and towards Sandy Shores active
SwitchTrainTrack(3, true) -- Setting the Metro tracks active
SetTrainTrackSpawnFrequency(0, 120000) -- The Train spawn frequency set for the game engine
SetTrainTrackSpawnFrequency(3, 120000) -- The Metro spawn frequency set for the game engine
SetRandomTrains(true) -- Telling the game we want to use randomly spawned trains