STG ScriptsDocumentation
Auto Pilot

Configuration

Every option in STG Auto Pilot config.lua, from the framework and command to speed limits, driving style, allowed vehicles and notifications.

All settings live in stg-autopilot/config.lua. The file stays editable in the escrow version. Restart the resource after a change.

Framework

Config.Framework = "auto"

Prop

Type

The getFramework function at the bottom of config.lua loads the framework object. Only change it if your core resource uses another name.

Language

Config.Language = "en"

Available: en, es, fr, de, pt, it, nl, pl, sv, fi, no, tr, he, ar, ja, zh. To change a text, edit the matching file in stg-autopilot/locales/. The web block in each file holds the texts of the menu and the trip panel.

Command and pause menu

Config.Command = {
    Enabled = true,
    Name = 'autopilot',
    PauseMenu = true
}

Prop

Type

Keep at least one of Enabled and PauseMenu on, otherwise players have no way to open the autopilot.

Speed limits

Config.SpeedLimits = {
    50,
    80,
    120
}

Speed options in km/h shown as buttons in the menu. The first entry is selected by default. While the autopilot drives, the vehicle's top speed is capped at the chosen value, and the cap is removed when the trip ends. The car can still drive slower in traffic and corners.

Each trip in the travel history keeps the speed it was started with. If you later remove that speed from the list, the trip starts with the first entry instead.

Driving style

Config.ObeyTrafficLaws = true

With true the driver stops at red lights and drives carefully. With false the driver rushes through traffic and does not wait at lights.

Allowed vehicles

Config.allCarsAllowed = true
Config.allowedCars = {
    't20',
    'adder',
    'neon'
}

Prop

Type

To find the right name for a vehicle, sit in it and run vehicleModel in the F8 console. It prints the model name exactly as allowedCars expects it. The player always has to be in the driver seat, whatever this setting is.

Hide command

Config.hideCmd = 'hideap'

Players run /hideap to turn the autopilot off for themselves: the trip panel is hidden and the map prompt and command stop working. Running it again turns everything back on. A trip that is already driving keeps going, only its panel is hidden.

Config.MenuScale = 0.85

Overall size of the menu. 1.0 is the original size, lower values make it smaller.

Debug

Config.debug = false

Prints what the autopilot is doing to the F8 console, for example why a vehicle was not allowed. Leave it off on a live server.

Notifications

Config.Notify = function(msg)
    lib.notify({
        title = getMessage('notify_title'),
        description = msg,
        type = "info"
    })
end

Used for messages like a missing waypoint or a vehicle that is not allowed. Replace the body to use your own notification system.

Still having trouble?

Open a ticket on our Discord. Our team answers around 15 hours a day.

Get help on Discord

On this page