Koja Scripts
FREE

Test Drives

Let a buyer try the vehicle before they commit.

Test Drives

Let a buyer try the vehicle before they commit. The car spawns at a fixed safe location, runs for a configurable time, and disappears at the end — teleporting the player back to where they started.

How a player starts one

  1. Open the listing in the tablet

    Go to Market → click the vehicle you want to test.
  2. Click "Test drive"

    If Config.TestDrive.Enabled = false or the auction has ended, the button is hidden.
  3. Pay the fee (if any)

    Config.TestDrive.price is deducted from the player's bank.
  4. Drive

    The player is teleported into a fresh copy of the vehicle at Config.TestDrive.coords. The timer starts:
    • Default Config.TestDrive.secondslimit = 20 seconds.
    • Press Config.TestDrive.cancelKey (default X, code 73) to end early.
  5. Auto-return

    When the timer hits zero (or the player cancels), the test vehicle is deleted and the player is teleported back to their original position.

Per-zone configuration

Override the global test-drive settings for a specific zone by adding testDrive to the zone:

shared/config.lua
{
    id = "zone3",
    -- ... other zone fields ...
    testDrive = {
        coords = vec3(1180, 2640, 37.8),
        heading = 90.0,
        secondslimit = 60,
        price = 1000,
        cancelKey = 73,
    },
},

Edge cases

SituationBehavior
Player disconnects mid-testVehicle entity is auto-cleaned by FiveM; player is teleported back on reconnect (best effort)
Resource is restarted mid-testabortMarketTestDriveOnStop kicks in: vehicle deleted, player teleported back
Player tries to start a second testtest_drive_busy notification, ignored
Auction listing, auction endedtest_drive_auction_ended notification, ignored
Vehicle has no resolvable modeltest_drive_no_model notification, no spawn
  • Exchange Zones — A player can own an entire zone and run it like a small business: set listing fees, take commission on every sale, cap how many listings can run concurrently.
  • Auctions — Time-boxed bidding with a clear winner and a buy-out finalization step.
  • Overview — What players can actually do with Koja-Carmarket, from their POV.
  • Parking Slots — Before a player can list a car, they need at least one parking slot in the zone they want to list in.
  • Listings — The simplest flow: a player lists a vehicle from their garage at a fixed price; another player walks up to the market zone, opens the tablet, and buys it.
  • Features — back to the section overview