# Car Lifts

This system enables **mechanic-style car lifts** that players can raise or lower, with full sync across clients. It's designed to be immersive, configurable, and compatible with custom locations and models.

### Features

* Supports **multiple car lift locations** via config
* Automatically spawns lift + pylon props on resource start
* Lift animation synced across all players using state bags
* Attach/detach nearby vehicles to/from lifts based on movement
* Target interaction to control lift up/down
* Client-side animation and sound effects when operating lift
* Optional **custom model offsets and headings**

***

## How It Works

### Server Side

* On resource start:
  * Spawns pylon and lift props from `Locations` config
  * Applies rotation/offset logic if model adjustments are defined
  * Creates state bag for each lift, storing net IDs and Z positions
* On lift trigger:
  * Updates `liftData` state with new position and status
  * Resets status after timeout (used for cooldown/locking)
* On resource stop:
  * Deletes all lift and pylon entities cleanly

### Client Side

* On player load:
  * Loads lift/pylon models
  * Re-attaches `ox_target` entries to existing lifts
* On `liftData` change:
  * Triggers animation of lift prop moving up/down
  * Attaches or detaches any vehicle sitting on the lift
* Adds interaction options:
  * **Lift UP** (if currently down)
  * **Lift DOWN** (if currently up)
  * 5-second cooldown to prevent spam

### Sound Effects

If enabled in `Config.CarLifts.Sound`:

* Plays crane movement/stop sounds during lift animation if player is nearby.

### Notes

* Fully customizable model, offset, and rotation support per location
* Vehicle detection uses raycasts around lift platform
* Soundbanks are requested/released dynamically
* Compatible with framework load hooks (`onPlayerLoaded`)
* Works with custom props and interiors (MLO-compatible)

### Config Example

```lua
Locations = {
  bennys = {
    Enabled = true,
    carLift = {
      [1] = { coords = vec4(1.0, 2.0, 3.0, 180.0) }
    },
    carLiftModels = {
      lift = "carlift_frame",
      pylons = "carlift_pylons",
      liftOffset = vec3(0.0, 0.0, 0.0),
      pylonOffset = vec3(1.0, 0.5, 0.9)
    }
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jixelpatterns.gitbook.io/docs/paid-assets/jim-mechanic/car-lifts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
