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
–true
if vehicle is on car jack, otherwisefalse
.
IsWorkflowActive
Returns whether the mechanic workflow UI is currently active and open.
exports["t1ger_mechanic"]:IsWorkflowActive()
Returns
boolean
–true
if 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.
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
boolean
–true
if the player is carrying a body part, otherwisefalse
.
IsCarryingComponent
Checks whether the player is currently carrying a component prop (core or service part).
exports["t1ger_mechanic"]:IsCarryingComponent()
Returns
boolean
–true
if 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.
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) – Theox_lib
context 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
.
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
boolean
–true
if the player is an employee, otherwisefalse
.number|nil
– The ID of the shop the player is employed at, ornil
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
boolean
–true
if the player has a mechanic job, otherwisefalse
.number|nil
– The ID of the matching shop, ornil
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
boolean
–true
if the player is a boss-grade mechanic, otherwisefalse
.number|nil
– The ID of the shop where the player is a boss, ornil
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
boolean
–true
if the player is the owner of a shop, otherwisefalse
.number|nil
– The ID of the shop the player owns, ornil
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, otherwisenil
.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 includemileage
,service_parts
, andcore_parts
).replicate
(boolean
) – (Optional) Whether to replicate the state to clients. Defaults totrue
.
Returns
boolean
–true
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
boolean
–true
if mileage was set successfully, otherwisefalse
.
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
boolean
–true
if 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.
exports["t1ger_mechanic"]:SetAllCorePartsHealth(vehicle, value)
Parameters
vehicle
(integer
) – The vehicle entity handle.value
(number
) – New health value to apply. Clamped between0.0
and100.0
.
Returns
boolean
–true
if updated successfully, otherwisefalse
.
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 to0
.
Returns
boolean
–true
if updated successfully, otherwisefalse
.
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
boolean
–true
if updated successfully, otherwisefalse
.
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, otherwisenil
.
SetComponentFixed
Fully restores a specified vehicle component by automatically determining its type (core
or service
).
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 usingGetComponentType
.
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
boolean
–true
if the vehicle is electric, otherwisefalse
.
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
boolean
–true
if 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.
exports["t1ger_mechanic"]:DoesVehicleHaveFailuredParts(vehicle)
Parameters
vehicle
(integer
) – The vehicle entity handle.
Returns
boolean
–true
if 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
exports["t1ger_mechanic"]:ApplyCollisionDegradation(vehicle)
Parameters
vehicle
(entity
) – The vehicle entity handle.
Last updated