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
Career BranchesCareer System CoreCareer Save System
Career Computer MenuCareer Fuel SystemInspect VehicleVehicle InventoryLinear TutorialLoaner VehiclesCareer LogLogbookMarketplaceMission WrapperCareer Painting ModuleCareer Part Inventory ModuleCareer Part Shopping ModuleCareer Payment ModuleCareer Permissions ModuleCareer Playbook Writer ModuleCareer Player Abstract ModuleCareer Player Attributes ModuleCareer Player Driving ModuleCareer Quick Travel ModuleCareer Rentals ModuleCareer Reputation ModuleCareer Spawn Points ModuleCareer Speed Traps ModuleCareer Test Drive ModuleCareer Tether ModuleCareer Tuning ModuleCareer UI Utils ModuleCareer Unlock Flags ModuleCareer Value Calculator ModuleVehicle Class GroupingVehicle Deletion ServiceVehicle PerformanceVehicle Shopping

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 Extensionscareermodules

Career Part Shopping Module

Interactive part shop UI for buying, swapping, and removing vehicle parts at garage computers. Maintains a preview vehicle, shopping cart with 7% sales tax, and inventory-part reuse. Uses a tether sys

Interactive part shop UI for buying, swapping, and removing vehicle parts at garage computers. Maintains a preview vehicle, shopping cart with 7% sales tax, and inventory-part reuse. Uses a tether system to cancel shopping if the player walks too far away.


Public API

FunctionSignatureDescription
M.startShopping(inventoryId, originComputerId)Opens part shop for a vehicle; auto-repairs first if needed
M.installPart(part)Adds a part to preview vehicle and shopping cart
M.installPartByPartShopId(partShopId)Installs a part by its temporary shop ID
M.removePartBySlot(slot)Removes a shopping-cart part by slot path
M.updatePreviewVehicle(currentPartConditions)Callback to refresh preview after vehicle config reload
M.cancelShopping()Reverts vehicle to original config and exits
M.applyShopping()Pays total, commits changes, triggers save
M.sendShoppingDataToUI()Pushes full shop data (parts, tree, cart, search) to UI
M.getPartsInShop() → tableReturns all available shop parts
M.getShoppingCart() → tableReturns current shopping cart
M.isShoppingSessionActive() → boolWhether a shopping session is in progress
M.setupTether()Creates capsule tether between computer and vehicle
M.onComputerAddFunctions(menuData, computerFunctions)Registers "Part Customization" button
M.onVehicleSaveFinished()Closes menu after autosave

Key Concepts

  • Preview Vehicle: Deep copy of vehicle data used for live part swaps without saving
  • Shopping Cart: Tracks partsIn (new), partsOut (replaced), total + 7% tax
  • Part Shop IDs: Temporary sequential IDs assigned to each shop part per session
  • Core Slots: Protected slots that cannot be emptied (e.g. frame)
  • Tether: Capsule-shaped boundary between computer and vehicle; cancels session if player leaves

Shopping Cart Structure

shoppingCart = {
  partsIn      = {},    -- {[slotPath] = shopPart}
  partsOut     = {},    -- {[slotPath] = inventoryPart}
  partsInList  = {},    -- ordered list version
  partsOutList = {},    -- ordered list version
  slotList     = {},    -- ordered slot paths
  total        = 1250,  -- price including 7% tax
  taxes        = 82,    -- tax amount
}

Dependencies

  • career_modules_inventory - vehicle data, spawning
  • career_modules_partInventory - existing part lookups, inventory updates
  • career_modules_payment / career_modules_playerAttributes - money check / deduction
  • career_modules_permissions - partBuying/vehicleModification permission
  • career_modules_tether - walk-away boundary
  • career_modules_painting - primer color for new part conditions
  • career_modules_valueCalculator - broken-parts check
  • jbeam/io, jbeam/slotSystem - part compatibility and slot info

Usage Example

-- Start shopping from computer
career_modules_partShopping.startShopping(inventoryId, computerId)

-- Install a part by shop ID from UI
career_modules_partShopping.installPartByPartShopId(42)

-- Apply and pay
career_modules_partShopping.applyShopping()

Hooks Emitted

HookWhen
onPartShoppingStartedSession begins
onPartShoppingPartInstalledA part is installed in preview
onPartShoppingTransactionCompletePurchase finalized

See Also

  • partInventory - Global part storage
  • tuning - Variable-based vehicle tuning
  • tether - Walk-away boundary system

Career Part Inventory Module

M.dependencies = {'career_career'}

Career Payment Module

M.dependencies = {'career_career'}

On this page

Public APIKey ConceptsShopping Cart StructureDependenciesUsage ExampleHooks EmittedSee Also