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
configApplies 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 statusResets 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
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)
}
}
}
Last updated