API ReferenceGE Extensionsflowgraphnodesvehicle
Generate License Plate
- **Node Name:** `Generate License Plate`
Overview
- Node Name:
Generate License Plate - Category:
once_instant - File:
extensions/flowgraph/nodes/vehicle/generateLicensePlate.lua
Generates a random license plate text and applies it to a vehicle. Clears any existing plate text first, then regenerates and sets a new one.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
vehId | number | ID of vehicle to apply the plate to. If empty, player vehicle is used |
Internals
Key Methods
| Method | Description |
|---|---|
workOnce() | Clears the current plate, regenerates a random plate string, and applies it to the vehicle |
How It Works
- Resolves the vehicle ID from the pin or defaults to
be:getPlayerVehicleID(0). - Gets the vehicle object via
getObjectByID(vehId)(falls back togetPlayerVehicle(0)). - Calls
core_vehicles.setPlateText(nil, nil, nil, nil, true)to clear/reset the plate text system. - Generates new text via
core_vehicles.regenerateVehicleLicenseText(veh). - Applies the generated text with
core_vehicles.setPlateText(generatedText, vehId).
Usage Example
-- In a flowgraph:
-- [Spawn Vehicle] → vehId → [Generate License Plate] → [Continue]
-- Programmatic equivalent:
local veh = getPlayerVehicle(0)
local vehId = veh:getId()
core_vehicles.setPlateText(nil, nil, nil, nil, true)
local text = core_vehicles.regenerateVehicleLicenseText(veh)
core_vehicles.setPlateText(text, vehId)Key Dependencies
core_vehicles.setPlateText()- sets or clears license plate text on a vehiclecore_vehicles.regenerateVehicleLicenseText()- generates a random plate string based on game settings
See Also
- Align for Coupling (Flowgraph Node) - Related reference
- Apply Velocity to Vehicle (Flowgraph Node) - Related reference
- Boost Vehicle (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide