Bablo ResourcesDocs

Client Events

These are net events fired by the server to the client during the race lifecycle. You can hook into them from an external resource using AddEventHandler.

All streetrace.lobby:* events are fired only to players who are participants in the relevant lobby.


streetrace.lobby:OnAccepted

Fired when the player has been accepted into a lobby. Triggers the gather-smoke effect at the start line.

LUA
AddEventHandler('streetrace.lobby:OnAccepted', function(firstCoord)
    -- firstCoord: vector3 — coordinates of the first checkpoint
    print('Accepted into lobby, start is at', firstCoord)
end)
ParameterTypeDescription
firstCoordvector3World position of the first checkpoint

streetrace.lobby:OnMobilizing

Fired when the race enters the mobilization phase (players must reach the start line).

LUA
AddEventHandler('streetrace.lobby:OnMobilizing', function(dto)
    -- dto: table — full race manager data (track, participants, settings)
    print('Race mobilizing')
end)
ParameterTypeDescription
dtotableRace manager DTO containing track, participants, and lobby settings

streetrace.lobby:OnCountdown

Fired when all players are at the start line and the countdown begins.

LUA
AddEventHandler('streetrace.lobby:OnCountdown', function()
    print('Countdown started')
end)

streetrace.lobby:OnStart

Fired when the race officially starts (countdown hits zero).

LUA
AddEventHandler('streetrace.lobby:OnStart', function()
    print('Race started')
end)

streetrace.lobby:OnUpdateLaptime

Fired each time the player completes a lap. Sends the lap time to the UI.

LUA
AddEventHandler('streetrace.lobby:OnUpdateLaptime', function(lastLapTime)
    -- lastLapTime: number — time of the last completed lap in milliseconds
    print('Lap completed in', lastLapTime, 'ms')
end)
ParameterTypeDescription
lastLapTimenumberDuration of the last lap in milliseconds

streetrace.lobby:OnDisqualified

Fired when the local player is disqualified (DNF).

LUA
AddEventHandler('streetrace.lobby:OnDisqualified', function()
    print('Player disqualified')
end)

streetrace.lobby:OnForcedDisqualification

Fired when the server forces the player out of a race (e.g. admin action or integrity check).

LUA
AddEventHandler('streetrace.lobby:OnForcedDisqualification', function()
    print('Player forcefully disqualified')
end)

streetrace.lobby:OnDisband

Fired when the lobby is disbanded while the player is still waiting (before mobilization).

LUA
AddEventHandler('streetrace.lobby:OnDisband', function()
    print('Lobby disbanded')
end)

streetrace.lobby:OnRemoved

Fired when the lobby is removed after the race has finished.

LUA
AddEventHandler('streetrace.lobby:OnRemoved', function()
    print('Lobby removed')
end)