Browse docs

Storage

Reference for Storage in sky_jobs_base.

All client exports

Storage

getNearbyTrunkPropTarget(maxDistance)

  • Purpose: Finds the nearest managed trunk prop within the given distance.
  • Arguments:
    • maxDistance (number) — search radius in game units.
  • Returns: table | nil
    • distance (number) — distance to the prop.
    • label (string) — display label.
local target = exports["sky_jobs_base"]:getNearbyTrunkPropTarget(5.0)

if target then
    print(target.label, target.distance)
end

removeNearbyTrunkProp(maxDistance)

  • Purpose: Removes the nearest managed trunk prop.
  • Arguments:
    • maxDistance (number) — search radius.
  • Returns:
    • boolean — true on success.
    • string? — on failure, a locale key describing the error.
local success, errorKey = exports["sky_jobs_base"]:removeNearbyTrunkProp(5.0)

if not success then
    print("Failed:", errorKey)
end

startTrunkPropPlacement(prop, options)

  • Purpose: Starts the shared preview / place / cancel flow for a prop definition supplied by the calling client resource.
  • Arguments:
    • prop (table) - prop definition with model (or name as its fallback), optional label, and optional preview settings.
    • options (table?) - optional placement settings:
      • placementToken (string?) - token issued by the built-in registered PropItems item flow.
      • placeCallback (string?) - Sky.Cb server callback invoked after the shared prop is registered.
      • placeContext (table?) - payload passed to placeCallback; Jobs Base adds the new propId before invoking it.
      • amount (number?) - finite number of placements the client may confirm; defaults to 1.
      • unlimited (boolean?) - keep placement mode open until the player cancels it.
      • stopAfterPlace (boolean?) - when true, placement mode closes after one successful placement.
      • radialInteraction (boolean?) - mark the preview for radial-only confirmation/removal flows.
  • Returns: boolean - true when placement mode started.
Sky.Cb.Register("my_resource:confirmRepairCratePlacement", function(source, context)
    if not canUseRepairCrate(source, context) or not consumeRepairCrate(source) then
        return { success = false }
    end

    return { success = true }
end)
When placeCallback is set, it must return true or { success = true }. A rejected or invalid response removes the newly registered prop and ends placement. Canceling the preview does not invoke the callback.