Skip to content

ReferenceStates, zones, net events, instances, decals

Routes of checkpoints ​

Deliveries, races, a driving school, a taxi fare. The server decides when a checkpoint is passed, from the player's real position: it follows the path between two checks, so a checkpoint crossed at full speed counts, and a client cannot pass them for itself. The player sees GTA's checkpoints (with the arrow to the next one), a blip and the GPS line, and a timer with timeLimit.

lua
RLX.ShowCountdown(source, { seconds = 3, text = "GO" })   -- GTA's 3, 2, 1, GO (-1: everyone)
lsmp.wait(3000)
RLX.StartRoute(source, {
  id = "delivery",
  points = { { x = 120.0, y = -1300.0, z = 29.0 }, { x = 400.0, y = -1100.0, z = 29.0 } },
  radius = 6.0,          -- how close counts as passed
  kind = "ground",       -- ground, water, air, ring, flag
  vehicle = true,        -- only in a vehicle
  laps = 1, timeLimit = 300, blip = true, gps = true, color = { r = 240, g = 200, b = 80 },
}, function(source, event, info)
  -- "point" { index, total, lap, time }   "finish" { time } (ms)
  -- "fail" { reason }: time, stopped, replaced, died, left, unloaded
end)
RLX.GetRoute(source)    -- { id, index, total, lap, laps, time } or nil
RLX.StopRoute(source)

One route per player (a new one replaces it, fail "replaced"). Event rlx:routeEnded (source, resource, id, event, info).