Configuration
Learn how to use each setting available in config.lua in our script.
Important
Before starting, it’s essential to understand how the speed limit priority works. The script follows this hierarchical order to determine which limit will be applied to each vehicle:
- LimitedModels: If the vehicle is listed here, this value will always be used, ignoring the other settings.
- LimitedClasses: If the vehicle is not listed in LimitedModels, the limit set for its class will be applied, if available.
- LimitGlobal: If the vehicle is not in any of the options above, the global limit will be applied, except for the classes listed in ClassesForbiddenGlobal.
In other words, the value of LimitedModels has the highest priority, followed by LimitedClasses, and lastly, LimitGlobal.
Settings
SpeedUnit
Set the speed unit to km/h or mph.
We use FiveM's official calculation to define the speed limit, meaning km/h is speed * 3.6
and mph is speed * 2.236936
.
Config.SpeedUnit = "kmh" -- kmh or mph
MaxSpeed
Set the default maximum speed that will be used when no custom speed is specified for a class or vehicle.
Config.MaxSpeed = 177.0
LimitGlobal
Set a global limit for all classes, except those listed in ClassesForbiddenGlobal.
Config.LimitGlobal = true
ClassesForbiddenGlobal
Specify here the classes that will be ignored by LimitGlobal. Some are already set by default, such as Helicopters and others.
Config.ClassesForbiddenGlobal = {
[15] = true, -- Helicopters
[16] = true, -- Planes
[19] = true, -- Military
}
LimitedClasses
Control the speed by class easily. For example, set a custom speed like 270.0
,
or just use true
to apply the value from MaxSpeed.
Config.LimitedClasses = {
[7] = 270.0, -- Super - 270.0
[8] = true, -- Motorcycles - Config.MaxSpeed
}
CustomClasses
Create as many custom classes as you want and use them in LimitedModels.
Set a custom speed like 270.0
, or just use true
to apply the value from MaxSpeed.
Config.CustomClasses = {
["S++"] = 290.0,
["S+"] = true, -- Config.MaxSpeed
["PoliceSpeed"] = 300.0,
}
LimitedModels
A granular control of speed limit per vehicle.
Set a custom speed like 270.0
, a CustomClass
you created like PoliceSpeed
, or simply use true
to apply the value from MaxSpeed.
Config.LimitedModels = {
["comet7"] = 180.0, -- 180.0
["prototipo"] = "S", -- Config.CustomClasses
["cyclone"] = true, -- Config.MaxSpeed
}
Types
Prop | Type | Default |
---|---|---|
LimitedModels | table | - |
CustomClasses | table | - |
LimitedClasses | table | - |
ClassesForbiddenGlobal | table | - |
LimitGlobal | boolean | true |
MaxSpeed | float | 177.0 |
SpeedUnit | kmh | mph | kmh |