> For the complete documentation index, see [llms.txt](https://docs.devhub.gg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devhub.gg/racing/exports.md).

# Exports

```lua
local raceId = exports['devhub_racing']:createRace({
    mapId = 1,              -- required: map ID (number) or "random"
    startDelay = 300,       -- optional: seconds until race starts (default: 60)
    laps = 3,               -- optional: laps for loop maps (default: 3)
    collisions = true,      -- optional: player vehicle collisions (default: true)
    fpv = false,            -- optional: force first person view (default: false)
    entryFee = 500,         -- optional: entry fee (default: 0)
    vehicleClass = "ALL",   -- optional: "ALL", "S", "A", "B", "C", "D" (default: "ALL")
    winnerReward = 10000,   -- optional: money reward for winner (default: 0)
    official = true,        -- optional: MMR-ranked race (default: false)
    creatorIdentifier = "SYSTEM", -- optional: creator identifier (default: "SYSTEM")
})

-- @param data (table) - Race configuration:
--   data.mapId          (number|string) [REQUIRED] - The map ID to use, or "random" for a random verified map
--   data.startDelay     (number)        [OPTIONAL] - Seconds until race starts (default: 60)
--   data.laps           (number)        [OPTIONAL] - Number of laps for loop maps (default: 3)
--   data.collisions     (boolean)       [OPTIONAL] - Enable player vehicle collisions (default: true)
--   data.fpv            (boolean)       [OPTIONAL] - Force first person view (default: false)
--   data.entryFee       (number)        [OPTIONAL] - Entry fee amount (default: 0)
--   data.vehicleClass   (string)        [OPTIONAL] - Vehicle class restriction: "ALL", "S", "A", "B", "C", "D" (default: "ALL")
--   data.winnerReward   (number)        [OPTIONAL] - Money reward for winner (default: 0)
--   data.official       (boolean)       [OPTIONAL] - Whether the race is official / MMR-ranked (default: false)
--   data.creatorIdentifier (string)     [OPTIONAL] - Identifier of the creator (default: "SYSTEM")

-- @return raceId (number|false) - The created race ID, or false on failure
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devhub.gg/racing/exports.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
