RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Activity ManagerAudio Bank ManagerAudio Ribbon SystemBus Route ManagerCamera SystemCore Chat (IRC)Core CheckpointsCore Command HandlerCoupler Camera ModifierDevices (RGB Peripherals)Dynamic PropsEnvironmentFlowgraph ManagerForestFun StuffGame ContextGame StateGround Marker ArrowsGround MarkersHardware InfoHighscoresHotlappingInventoryJob SystemLap TimesLevelsLoad Map CommandMetricsMod ManagerMultiseatMultiseat CameraMulti SpawnOnlinePaths (Camera Paths)Quick Access (Radial Menu)Recovery PromptRemote ControllerReplayRepositoryRope Visual TestScheme Command ServerCore SnapshotCore SoundsCore TerrainTraffic SignalsTrailer RespawnVehicle Active PoolingVehicle Bridge (GE ↔ VLua Communication)Vehicle MirrorsVehicle PaintsCore VehiclesVehicle TriggersVersion UpdateWeather SystemWindows Console

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionscore

Highscores

Persistent highscore storage for scenario races. Stores per-scenario, per-config lap times with player and vehicle info, sorted by fastest time.

Persistent highscore storage for scenario races. Stores per-scenario, per-config lap times with player and vehicle info, sorted by fastest time.


Public API

FunctionSignatureDescription
M.getHighscores() → tableReturns the full highscore table from settings/highscores.json. Handles migration from old file location.
M.setHighscores(scores)Writes the full highscore table to disk.
M.getScenarioHighscores(levelName, scenarioName, configKey) → tableReturns sorted highscores for a specific scenario+config, with place indices.
M.setScenarioHighscores(timeInMillis, vehicleBrand, vehicleName, playerName, levelName, scenarioName, configKey) → numberRecords a time. Returns placement index (1-based) or -1 if beyond max count.
M.setScenarioHighscoresCustom(timeInMillis, record, levelName, scenarioName, configKey) → numberRecords a custom record table. Returns placement index or -1.

Record Format

{
  playerName = "Player",
  vehicleBrand = "Gavril",
  vehicleName = "D-Series",
  timeInMillis = 63250,
  formattedTime = "01:03.250",
  timeStamp = 1700000000,
  formattedTimestamp = "Tue Nov 14 ...",
  detailed = false,
}

Constants

NameValueDescription
maxHighScoreCount50Maximum number of scores kept per scenario config.
highscoreFilesettings/highscores.jsonStorage file path.

Storage Structure

{
  ["levelName"] = {
    ["scenarioName"] = {
      ["configKey"] = { -- array of records sorted by timeInMillis
        { timeInMillis = 60000, ... },
        { timeInMillis = 61500, ... },
      }
    }
  }
}

Usage Example

-- Record a lap time
local place = core_highscores.setScenarioHighscores(
  63250, "Gavril", "D-Series", "Player1",
  "west_coast_usa", "drag_strip", "default"
)
if place > 0 then
  log('I', 'race', 'New highscore! Place: ' .. place)
end

-- Read scenario scores
local scores = core_highscores.getScenarioHighscores("west_coast_usa", "drag_strip", "default")
for _, s in ipairs(scores) do
  print(s.place .. ": " .. s.formattedTime)
end

Hardware Info

Gathers and reports system hardware information (CPU, GPU, memory, disk, OS, power) with health warnings for low resources, unsupported hardware, and mod overload.

Hotlapping

Full hotlapping / lap timing system. Supports creating custom circuits in freeroam (edit mode), running timed laps with checkpoint splits, best-lap tracking, and integration with both the old scenario

On this page

Public APIRecord FormatConstantsStorage StructureUsage Example