Client

Client-sided exports

IsVehicleOnCarJack

Returns whether a given vehicle entity is on a car jack or not.

exports["t1ger_mechanic"]:IsVehicleOnCarJack(vehicle)

Parameters

  • vehicle(number) – The vehicle entity handle.

Returns

  • booleantrue if vehicle is on car jack, otherwise false.


IsWorkflowActive

Returns whether the mechanic workflow UI is currently active and open.

exports["t1ger_mechanic"]:IsWorkflowActive()

Returns

  • booleantrue if the workflow UI is open, otherwise false.


CreateCarLift

Spawns a car lift at the player's current position and rotation, then triggers the server to create and sync it for all clients.

exports["t1ger_mechanic"]:CreateCarLift()

IsCarryingBodyPart

Checks whether the player is currently carrying a body part prop (e.g., door, hood, etc.).

exports["t1ger_mechanic"]:IsCarryingBodyPart()

Returns

  • booleantrue if the player is carrying a body part, otherwise false.


IsCarryingComponent

Checks whether the player is currently carrying a component prop (core or service part).

exports["t1ger_mechanic"]:IsCarryingComponent()

Returns

  • booleantrue if the player is carrying a component, otherwise false.


CancelBodyPartInstallation

Cancels an ongoing body part installation. Clears the player's animation and deletes any carried body part prop.

exports["t1ger_mechanic"]:CancelBodyPartInstallation()

CancelComponentRepair

Cancels an in-progress component repair by removing any carried props and clearing the player's tasks.

exports["t1ger_mechanic"]:CancelComponentRepair()

CancelInspection

Cancels an ongoing vehicle body inspection by setting the internal inspection flag.

exports["t1ger_mechanic"]:CancelInspection()

QuickRepair

Fully repairs the vehicle the player is currently inside, including body, engine, and optionally fuel and part states based on config settings.

exports["t1ger_mechanic"]:QuickRepair()

CreateShop

Opens the admin-only shop creation interface to create a new mechanic shop at the player’s current location.

exports["t1ger_mechanic"]:CreateShop(returnMenu)

Parameters

  • returnMenu (string, optional) – The ox_lib context menu ID to return to if the dialog is canceled.


ViewShops

Displays a list of all mechanic shops in a context menu using ox_lib.

exports["t1ger_mechanic"]:ViewShops(returnMenu)

Parameters

  • returnMenu (string) – Menu ID to return to if no shops exist or the list is exited.


BillingMain

Opens the mechanic shop billing interface for viewing and/or creating invoices. Only available to mechanic players if billing is enabled in the config.

exports["t1ger_mechanic"]:BillingMain(returnMenu)

Parameters

  • returnMenu (string, optional) – Menu ID to return to if the billing interface is exited.


IsPlayerEmployee

Checks whether the local player is employed at a specific mechanic shop or any shop.

exports["t1ger_mechanic"]:IsPlayerEmployee(shopId)

Parameters

  • shopId (number|nil) – (Optional) Shop ID to check. If omitted, all shops are checked.

Returns

  • booleantrue if the player is an employee, otherwise false.

  • number|nil – The ID of the shop the player is employed at, or nil if not found.


IsPlayerMechanic

Checks whether the local player has a mechanic job assigned to any registered shop.

exports["t1ger_mechanic"]:IsPlayerMechanic(shopId)

Parameters

  • shopId (number|nil) – (Optional) Shop ID to check. If omitted, all shops are checked.

Returns

  • booleantrue if the player has a mechanic job, otherwise false.

  • number|nil – The ID of the matching shop, or nil if not found.


IsPlayerMechanicBoss

Checks whether the local player holds a boss-grade mechanic job in a specific shop or any shop.

exports["t1ger_mechanic"]:IsPlayerMechanicBoss(shopId)

Parameters

  • shopId (number|nil) – (Optional) Shop ID to check. If omitted, all shops are checked.

Returns

  • booleantrue if the player is a boss-grade mechanic, otherwise false.

  • number|nil – The ID of the shop where the player is a boss, or nil if not found.


IsPlayerShopOwner

Checks whether the local player is the owner of a specific mechanic shop or any shop.

exports["t1ger_mechanic"]:IsPlayerShopOwner(shopId)

Parameters

  • shopId (number|nil) – (Optional) Shop ID to check. If omitted, all shops are checked.

Returns

  • booleantrue if the player is the owner of a shop, otherwise false.

  • number|nil – The ID of the shop the player owns, or nil if not found.


IsPlayerDiagnosing

Returns whether the player is currently diagnosing or inspecting a vehicle.

exports["t1ger_mechanic"]:IsPlayerDiagnosing()

Returns

  • boolean


GetVehicleData

Retrieves stored mechanic data for a given vehicle from its statebag.

exports["t1ger_mechanic"]:GetVehicleData(vehicle)

Parameters

  • vehicle (integer) – The vehicle entity handle.

Returns

  • table|nil – Returns a table containing vehicle data if found, otherwise nil.

  • Returned structure:

    {
        mileage = number, -- total mileage in km
        service_parts = {
            [partName] = number, -- mileage since last replacement
            ...
        },
        core_parts = {
            [partName] = number, -- health (0–100)
            ...
        }
    }

SetVehicleData

Sets or updates mechanic data for a vehicle using the statebag. Validates the structure before applying.

exports["t1ger_mechanic"]:SetVehicleData(vehicle, data, replicate)

Parameters

  • vehicle (integer) – The vehicle entity handle.

  • data (table) – Vehicle data to apply (must include mileage, service_parts, and core_parts).

  • replicate (boolean) – (Optional) Whether to replicate the state to clients. Defaults to true.

Returns

  • booleantrue if the data was set successfully, otherwise throws an error.

  • Expected data structure:

    {
        mileage = number,
        service_parts = {
            [partName] = number
        },
        core_parts = {
            [partName] = number
        }
    }

GetVehicleMileage

Returns the current mileage of a given vehicle entity.

exports["t1ger_mechanic"]:GetVehicleMileage(vehicle)

Parameters

  • vehicle(number) – The vehicle entity handle.

Returns

  • number– The vehicle mileage


SetVehicleMileage

Sets the mileage value for a vehicle safely and updates it in the statebag.

luaKopiérRedigerexports["t1ger_mechanic"]:SetVehicleMileage(vehicle, mileage)

Parameters

  • vehicle (integer) – The vehicle entity handle.

  • mileage (number) – New mileage value to set. Must be a non-negative number.

Returns

  • booleantrue if mileage was set successfully, otherwise false.


GetCorePartHealth

Returns the current health value of a specific core part on a given vehicle.

exports["t1ger_mechanic"]:GetCorePartHealth(vehicle, part)

Parameters

  • vehicle (integer) – The vehicle entity handle.

  • part (string) – The name of the core part (e.g., "radiator", "brakes").

Returns

  • number – Health value of the part (0–100), or -1 if not found.


SetCorePartHealth

Sets the health value for a specific core part on a given vehicle. The value is clamped between 0 and 100.

exports["t1ger_mechanic"]:SetCorePartHealth(vehicle, part, health)

Parameters

  • vehicle (integer) – The vehicle entity handle.

  • part (string) – The name of the core part.

  • health (number) – New health value (clamped between 0 and 100).

Returns

  • booleantrue if the part was updated successfully, otherwise false.


SetAllCorePartsHealth

Sets all core parts of the given vehicle to a specified health value — but only if their current health is lower than the new value.

exports["t1ger_mechanic"]:SetAllCorePartsHealth(vehicle, value)

Parameters

  • vehicle (integer) – The vehicle entity handle.

  • value (number) – New health value to apply. Clamped between 0.0 and 100.0.

Returns

  • booleantrue if updated successfully, otherwise false.


GetServicePartMileage

Returns the current mileage driven since installation of a specific service part on a vehicle.

exports["t1ger_mechanic"]:GetServicePartMileage(vehicle, part)

Parameters

  • vehicle (integer) – The vehicle entity handle.

  • part (string) – The name of the service part (e.g., "oil_filter", "brake_fluid").

Returns

  • number – Mileage driven for the part, or -1 if the part is not found.


SetServicePartMileage

Sets the mileage value for a specific service part on a vehicle.

exports["t1ger_mechanic"]:SetServicePartMileage(vehicle, part, mileage)

Parameters

  • vehicle (integer) – The vehicle entity handle.

  • part (string) – The name of the service part.

  • mileage (number) – New mileage value. Negative values are clamped to 0.

Returns

  • booleantrue if updated successfully, otherwise false.


SetAllServicePartsMileage

Sets all service parts to a specified mileage — only affects parts currently above that value.

exports["t1ger_mechanic"]:SetAllServicePartsMileage(vehicle, value)

Parameters

  • vehicle (integer) – The vehicle entity handle.

  • value (number) – New mileage value to apply (must be ≥ 0).

Returns

  • booleantrue if updated successfully, otherwise false.


GetComponentType

Returns the part category type ("core_parts" or "service_parts") for a given part name.

exports["t1ger_mechanic"]:GetComponentType(part)

Parameters

  • part (string) – The name of the part (e.g., "radiator", "oil_filter").

Returns

  • string|nil – Returns "core_parts" or "service_parts" if found, otherwise nil.


SetComponentFixed

Fully restores a specified vehicle component by automatically determining its type (core or service).

  • Core parts: health is set to 100.0 via SetCorePartHealth.

  • Service parts: mileage is reset to 0.0 via SetServicePartMileage.

  • Adds a service history entry and updates the workflow task if applicable.

exports["t1ger_mechanic"]:SetComponentFixed(vehicle, partName, partType)

Parameters

  • vehicle (number) – The vehicle entity handle.

  • partName (string) – The name of the part to restore (e.g., "radiator", "oil_filter").

  • partType (string, optional) – "core_parts" or "service_parts". If omitted, the function auto-detects using GetComponentType.


IsVehicleElectric

Determines whether a given vehicle is electric. Uses native GetIsVehicleElectric on game builds 3258+, otherwise checks the config-defined list.

exports["t1ger_mechanic"]:IsVehicleElectric(vehicle)

Parameters

  • vehicle (integer) – The vehicle entity handle.

Returns

  • booleantrue if the vehicle is electric, otherwise false.


GetMechanicVehicleType

Returns the mechanic-specific vehicle type for the given vehicle: "electric" or "gas".

exports["t1ger_mechanic"]:GetMechanicVehicleType(vehicle)

Parameters

  • vehicle (integer) – The vehicle entity handle.

Returns

  • string"electric" if the vehicle is electric, otherwise "gas".


IsTrackableVehicle

Checks whether the given vehicle should be tracked for mileage, degradation, and service. Excludes blacklisted models and non-trackable vehicle classes (e.g., boats, aircraft, trailers, bicycles).

exports["t1ger_mechanic"]:IsTrackableVehicle(vehicle)

Parameters

  • vehicle (integer) – The vehicle entity handle.

Returns

  • booleantrue if the vehicle is trackable, otherwise false.


DoesVehicleHaveFailuredParts

Checks whether the vehicle has at least one core part in a failed condition (isFailured = true) based on type compatibility.

exports["t1ger_mechanic"]:DoesVehicleHaveFailuredParts(vehicle)

Parameters

  • vehicle (integer) – The vehicle entity handle.

Returns

  • booleantrue if one or more core parts are in failure state, otherwise false.


ApplyCollisionDegradation

Applies random degradation to core parts of a vehicle as a result of collision, based on compatibility and configuration values. Can be used as integration into existing vehicle-failure-damage scripts

exports["t1ger_mechanic"]:ApplyCollisionDegradation(vehicle)

Parameters

  • vehicle (entity) – The vehicle entity handle.

  • Only applies if:

    • The vehicle is trackable (IsTrackableVehicle returns true).

    • The local player is the driver.

    • currentVehicleData is valid.

  • Selects a random number of compatible core parts (gas/electric/shared) and reduces their health by a random percentage within the configured range (MinPercentMaxPercent).

  • Uses Config.VehicleCollision.PartCount to determine how many parts are affected.


Last updated