Skip to content

10% off shop orders, applied at checkoutBlack Friday: 30% off until Dec 1Server templatesServer templates

RPScripts

sensei-speedlimiter for FiveM

By RPScripts

Illustration of a car dashboard with a speedometer needle stopped at a limit mark and a speed limit sign
On this page

sensei-speedlimiter by 0takuSensei is a standalone script that limits vehicle speed by spawn code or by vehicle class. It works without any framework: the manifest loads only config.lua and one client.lua, and the creator's forum post puts the code at about 56 lines.

How it works

Once per second the client checks whether the player is in a vehicle. It looks for the vehicle's spawn code in Config.vehicleSpeedLimits first. Without a match it uses the class limit from Config.Categories when Config.useCategories is true, and Config.maxSpeed otherwise. Planes and helicopters are never limited. The limit is set with the native SetVehicleMaxSpeed.

Requirements

  • Framework: standalone
  • No dependencies
  • License: GPL-3.0, per the LICENSE file in the repository

Installation

  1. Download the code from the GitHub repository linked below and put the folder into your server's resources directory.
  2. Add ensure with your folder name to server.cfg. The README says start vehicle-speed-limiter, but the repository is named sensei-speedlimiter; the name in server.cfg must match the folder.
  3. Edit config.lua, then restart the server.

Configuration

  • Config.kmh: false by default, so every value is in mph. Set it to true for km/h.
  • Config.maxSpeed: the fallback limit, 172 by default.
  • Config.useCategories: false by default. When true, the class table applies, with 100 for every ground and water class and no limit for planes and helicopters.
  • Config.vehicleSpeedLimits: limits per spawn code. The shipped config contains only ["police"] = 150.

Before going live

With the shipped values, every car, bike and boat is capped at 172 mph and the police model at 150 mph. The class values use the same unit as Config.kmh, so check them after you switch units. Vehicle classes above 19 are not in the table and fall back to Config.maxSpeed. Test a few of your add-on vehicles, because the script compares the hashes of the spawn codes you list with the model you are driving.

Another standalone option is the SpeedLimit Script, which sets maximum speeds per vehicle category in a single client.lua without a separate config file.

Download

sensei-speedlimiter by 0takuSensei is free. It is published under the GPL-3.0 license. Download it from the creator's original Cfx.re forum release: https://forum.cfx.re/t/free-standalone-vehicle-speed-limiter/5307649

GitHub repository: https://github.com/0takusensei/sensei-speedlimiter