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
boolean–trueif vehicle is on car jack, otherwisefalse.
IsWorkflowActive
Returns whether the mechanic workflow UI is currently active and open.
exports["t1ger_mechanic"]:IsWorkflowActive()Returns
boolean–trueif the workflow UI is open, otherwisefalse.
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.
IsCarryingBodyPart
Checks whether the player is currently carrying a body part prop (e.g., door, hood, etc.).
Returns
boolean–trueif the player is carrying a body part, otherwisefalse.
IsCarryingComponent
Checks whether the player is currently carrying a component prop (core or service part).
Returns
boolean–trueif the player is carrying a component, otherwisefalse.
CancelBodyPartInstallation
Cancels an ongoing body part installation. Clears the player's animation and deletes any carried body part prop.
CancelComponentRepair
Cancels an in-progress component repair by removing any carried props and clearing the player's tasks.
CancelInspection
Cancels an ongoing vehicle body inspection by setting the internal inspection flag.
QuickRepair
Fully repairs the vehicle the player is currently inside, including body, engine, and optionally fuel and part states based on config settings.
CreateShop
Opens the admin-only shop creation interface to create a new mechanic shop at the player’s current location.
Parameters
returnMenu(string, optional) – Theox_libcontext menu ID to return to if the dialog is canceled.
Only works for players with admin permissions (_API.Player.isAdmin must return true).
ViewShops
Displays a list of all mechanic shops in a context menu using ox_lib.
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.
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.
Parameters
shopId(number|nil) – (Optional) Shop ID to check. If omitted, all shops are checked.
Returns
boolean–trueif the player is an employee, otherwisefalse.number|nil– The ID of the shop the player is employed at, ornilif not found.
IsPlayerMechanic
Checks whether the local player has a mechanic job assigned to any registered shop.
Parameters
shopId(number|nil) – (Optional) Shop ID to check. If omitted, all shops are checked.
Returns
boolean–trueif the player has a mechanic job, otherwisefalse.number|nil– The ID of the matching shop, ornilif not found.
IsPlayerMechanicBoss
Checks whether the local player holds a boss-grade mechanic job in a specific shop or any shop.
Parameters
shopId(number|nil) – (Optional) Shop ID to check. If omitted, all shops are checked.
Returns
boolean–trueif the player is a boss-grade mechanic, otherwisefalse.number|nil– The ID of the shop where the player is a boss, ornilif not found.
IsPlayerShopOwner
Checks whether the local player is the owner of a specific mechanic shop or any shop.
Parameters
shopId(number|nil) – (Optional) Shop ID to check. If omitted, all shops are checked.
Returns
boolean–trueif the player is the owner of a shop, otherwisefalse.number|nil– The ID of the shop the player owns, ornilif not found.
IsPlayerDiagnosing
Returns whether the player is currently diagnosing or inspecting a vehicle.
Returns
boolean
GetVehicleData
Retrieves stored mechanic data for a given vehicle from its statebag.
Parameters
vehicle(integer) – The vehicle entity handle.
Returns
table|nil– Returns a table containing vehicle data if found, otherwisenil.Returned structure:
SetVehicleData
Sets or updates mechanic data for a vehicle using the statebag. Validates the structure before applying.
Parameters
vehicle(integer) – The vehicle entity handle.data(table) – Vehicle data to apply (must includemileage,service_parts, andcore_parts).replicate(boolean) – (Optional) Whether to replicate the state to clients. Defaults totrue.
Returns
boolean–trueif the data was set successfully, otherwise throws an error.Expected
datastructure:
SaveVehicleData
Saves vehicle data client-side and sends it to the server for persistence.
Parameters
vehicle(number) – The vehicle entity handle (must be valid and exist).
GetVehicleMileage
Returns the current mileage of a given vehicle entity.
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.
Parameters
vehicle(integer) – The vehicle entity handle.mileage(number) – New mileage value to set. Must be a non-negative number.
Returns
boolean–trueif mileage was set successfully, otherwisefalse.
GetCorePartHealth
Returns the current health value of a specific core part on a given vehicle.
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-1if not found.
SetCorePartHealth
Sets the health value for a specific core part on a given vehicle. The value is clamped between 0 and 100.
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
boolean–trueif the part was updated successfully, otherwisefalse.
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.
Parameters
vehicle(integer) – The vehicle entity handle.value(number) – New health value to apply. Clamped between0.0and100.0.
Returns
boolean–trueif updated successfully, otherwisefalse.
GetServicePartMileage
Returns the current mileage driven since installation of a specific service part on a vehicle.
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-1if the part is not found.
SetServicePartMileage
Sets the mileage value for a specific service part on a vehicle.
Parameters
vehicle(integer) – The vehicle entity handle.part(string) – The name of the service part.mileage(number) – New mileage value. Negative values are clamped to0.
Returns
boolean–trueif updated successfully, otherwisefalse.
SetAllServicePartsMileage
Sets all service parts to a specified mileage — only affects parts currently above that value.
Parameters
vehicle(integer) – The vehicle entity handle.value(number) – New mileage value to apply (must be ≥0).
Returns
boolean–trueif updated successfully, otherwisefalse.
GetComponentType
Returns the part category type ("core_parts" or "service_parts") for a given part name.
Parameters
part(string) – The name of the part (e.g.,"radiator","oil_filter").
Returns
string|nil– Returns"core_parts"or"service_parts"if found, otherwisenil.
SetComponentFixed
Fully restores a specified vehicle component by automatically determining its type (core or service).
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 usingGetComponentType.
IsVehicleElectric
Determines whether a given vehicle is electric.
Uses native GetIsVehicleElectric on game builds 3258+, otherwise checks the config-defined list.
Parameters
vehicle(integer) – The vehicle entity handle.
Returns
boolean–trueif the vehicle is electric, otherwisefalse.
GetMechanicVehicleType
Returns the mechanic-specific vehicle type for the given vehicle: "electric" or "gas".
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).
Parameters
vehicle(integer) – The vehicle entity handle.
Returns
boolean–trueif the vehicle is trackable, otherwisefalse.
DoesVehicleHaveFailuredParts
Checks whether the vehicle has at least one core part in a failed condition (isFailured = true) based on type compatibility.
Parameters
vehicle(integer) – The vehicle entity handle.
Returns
boolean–trueif one or more core parts are in failure state, otherwisefalse.
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
Parameters
vehicle(entity) – The vehicle entity handle.
Last updated