Races
constRaces:object
Defined in: client/api.d.ts:5243
Broom-race track and session access (spike).
Type Declaration
Section titled “Type Declaration”abandon()
Section titled “abandon()”abandon(
raceId?):object|null
Force-ends a stuck race and releases its gameplay locks.
Parameters
Section titled “Parameters”raceId?
Section titled “raceId?”string
Returns
Section titled “Returns”object | null
active()
Section titled “active()”active():
string|null
The active race’s id, if any.
Returns
Section titled “Returns”string | null
clearBoosts()
Section titled “clearBoosts()”clearBoosts():
number
Destroys every turbo bubble this session spawned.
Returns
Section titled “Returns”number
clearGhosts()
Section titled “clearGhosts()”clearGhosts():
number
Destroys stray pace-ghost riders left by earlier aborts.
Returns
Section titled “Returns”number
fitBounds()
Section titled “fitBounds()”fitBounds(
raceId,points,padXY?,padZ?):boolean
Grows the race tile’s streaming bounds to cover a track, saving the authored box.
Parameters
Section titled “Parameters”raceId
Section titled “raceId”string
points
Section titled “points”padXY?
Section titled “padXY?”number
number
Returns
Section titled “Returns”boolean
gates()
Section titled “gates()”gates():
RacePoint[]
World positions of every spawned race gate.
Returns
Section titled “Returns”getTrack()
Section titled “getTrack()”getTrack(
raceId):RacePoint[] |null
Reads a race’s current spline points.
Parameters
Section titled “Parameters”raceId
Section titled “raceId”string
Returns
Section titled “Returns”RacePoint[] | null
hasBroom()
Section titled “hasBroom()”hasBroom():
boolean|null
Whether the local player owns a broom; null if the inventory is unreadable.
Returns
Section titled “Returns”boolean | null
hideHud()
Section titled “hideHud()”hideHud():
boolean
Hides a stuck broom-race HUD (RaceHudDismissed does not do this).
Returns
Section titled “Returns”boolean
info()
Section titled “info()”info(
raceId):RaceStatus|null
Race actor location, spline/gate counts and leash state.
Parameters
Section titled “Parameters”raceId
Section titled “raceId”string
Returns
Section titled “Returns”RaceStatus | null
list()
Section titled “list()”list():
RaceInfo[]
Lists loaded race actors.
Returns
Section titled “Returns”RaceInfo[]
onBroom()
Section titled “onBroom()”onBroom(
raceId?):boolean|null
Whether the local player is currently mounted; null if unreadable.
Parameters
Section titled “Parameters”raceId?
Section titled “raceId?”string
Returns
Section titled “Returns”boolean | null
restoreBounds()
Section titled “restoreBounds()”restoreBounds():
number
Restores every tile bounds this session modified.
Returns
Section titled “Returns”number
setLeash()
Section titled “setLeash()”setLeash(
raceId,enabled?):boolean
Toggles the off-track leash (bKeepPlayerCloseToSpline).
Parameters
Section titled “Parameters”raceId
Section titled “raceId”string
enabled?
Section titled “enabled?”boolean
Returns
Section titled “Returns”boolean
setTrack()
Section titled “setTrack()”setTrack(
raceId,points):boolean
Rewrites a race’s spline (>= 3 points).
Parameters
Section titled “Parameters”raceId
Section titled “raceId”string
points
Section titled “points”Returns
Section titled “Returns”boolean
spawnBoosts()
Section titled “spawnBoosts()”spawnBoosts(
raceId,fractions):number
Spawns turbo bubbles at 0..1 fractions along the spline; returns the count.
Parameters
Section titled “Parameters”raceId
Section titled “raceId”string
fractions
Section titled “fractions”number[]
Returns
Section titled “Returns”number
start()
Section titled “start()”start(
raceId):boolean
Starts a race as a non-mission run.
Parameters
Section titled “Parameters”raceId
Section titled “raceId”string
Returns
Section titled “Returns”boolean
timer()
Section titled “timer()”timer(
raceId?):RaceTimer|null
The race’s clock as its HUD shows it; the active race without an id. It holds after the race ends, until it starts again.
Parameters
Section titled “Parameters”raceId?
Section titled “raceId?”string
Returns
Section titled “Returns”RaceTimer | null
watchEvents()
Section titled “watchEvents()”watchEvents():
boolean
Arms ProcessEvent watches for OnRaceStart / OnRaceFinish / OnRaceAbandoned, delivered as ‘gameEvent’.
Returns
Section titled “Returns”boolean