Skip to content

Configuration

All options live in config/config.lua.

Options

OptionTypeDefaultNotes
DebugbooleanfalsePrints limiter activity to the client console. Leave off in production.
Unit'mph'|'kph''mph'Applies to every limit value in the config, the keybinds and the statebag.
SpeedToleranceinteger15Max amount over the target you may be and still engage the limiter.
CheckIntervalinteger (ms)2000How often the dynamic limit is re-read. Ignored when EnableDynamicLimits is false.
EnableDynamicLimitsbooleanfalseTrack the road speed limit. Requires a source — see Dynamic speed limits.
MinLimitinteger5Lower bound on every limit, in Config.Unit. Enforced client and server side.
MaxLimitinteger200Upper bound on every limit, in Config.Unit. Enforced client and server side.
RequestCooldowninteger (ms)100Minimum gap between statebag writes the server accepts from one player.
Keybinds.Togglestring'Z'Default key to toggle the limiter.
Keybinds.IncreaseSpeedstring'RIGHT'Default key to raise the limit by 1.
Keybinds.DecreaseSpeedstring'LEFT'Default key to lower the limit by 1.

Default config

lua
---@type Config
Config = Config or {}

Config.Debug = false

Config.Unit = 'mph'

Config.SpeedTolerance = 15

Config.CheckInterval = 2000

Config.EnableDynamicLimits = false

Config.MinLimit = 5
Config.MaxLimit = 200

Config.RequestCooldown = 100

Config.Keybinds = {
  Toggle = 'Z',
  IncreaseSpeed = 'RIGHT',
  DecreaseSpeed = 'LEFT'
}

Notes on individual options

Unit

Set this once and everything follows it — MinLimit, MaxLimit, SpeedTolerance, the limit shown to the player, and the value written to the statebag. If your GetSpeedLimit source returns a different unit, that is handled separately: see dynamic limits.

WARNING

Changing Unit does not convert MinLimit, MaxLimit or SpeedTolerance for you. Switching from mph to kph with a MaxLimit of 200 leaves you with a 200 kph cap, not 322. Set them for the unit you are using.

SpeedTolerance

The grace band for engaging. With the default of 15 on mph, a driver doing 78 in a 70 zone can still engage; at 86 the limiter refuses. Lower it for stricter behaviour, raise it if players complain about it not catching.

MinLimit and MaxLimit

Both are enforced on the client and re-checked on the server before the statebag is written, so a modified client cannot push a value outside this range.

RequestCooldown

Rate-limits statebag writes per player. The default of 100ms is comfortably above normal use (one press = one write) while stopping a spammed key or a script from flooding the server. Raise it if you want to be stricter; there is little reason to lower it.

Debug

Prints the target limit, engagement decisions and the RPM cut to the client console. Useful when wiring up a dynamic limit source. Noisy — turn it off before release.

Built by duckie210