What does it do exactly?
This is a small resource that allows saving and reapplying of vehicle bodywork deformation. It also
features full synchronization of the damage between all players. No more weird situations where
other players cannot see the damage on your vehicle!
I decided to release this for free for everyone since this is nearly one-of-a-kind now.
Fully compatible to my paid script AdvancedParking where you can park any vehicle anywhere in the world.
Showcase video: (will soon be updated with a new video, although it basically shows the same thing)
Where can I get this?
Latest release:
Requirements
- OneSync (for the sync between players)
Features
- Functions for getting/setting vehicle bodywork deformation.
- Included exports:
- Getting deformation
- Setting deformation
- Fixing deformation
- Checking if two deformations are equal
- Checking if one deformation is worse than the other one.
- Uses entity state bags for full synchronization of bodywork deformation to all players.
Performance
- Client Side: idle: 0.00ms; while applying deformation: 0.01ms
- Server Side: 0.00ms
Installation instructions
- Extract the downloaded folder into your resources.
- Start the resource in your server.cfg:
ensure VehicleDeformation
- Repair the deformation using the
FixVehicleDeformation
export (more below).
Exports usage
-
Getting vehicle deformation (client only)
local deformation = exports["VehicleDeformation"]:GetVehicleDeformation(vehicle)
-
Setting vehicle deformation (client only)
exports["VehicleDeformation"]:SetVehicleDeformation(vehicle, deformation)
-
Fixing vehicle deformation (needs to be called when repairing a vehicle) (client and server)
exports["VehicleDeformation"]:FixVehicleDeformation(vehicle)
-
Check if first deformation is worse than second (client only)
exports["VehicleDeformation"]:IsDeformationWorse(firstDeformation, secondDeformation)
-
Check if first deformation is equal to second deformation (client only)
exports["VehicleDeformation"]:IsDeformationEqual(firstDeformation, secondDeformation)
Patchnotes
Update v2.0.0:
- Now a proper resource and not just two exports and usage example.
- Deformation application now works better for vehicles with a low deformation multiplier.
- Better performance through a better use of state bags.
- No more “in-between-syncing” of damage. This used to cause the crumbling of the whole vehicle.
- Updated the license. If you are using this script in one of your resources, make sure to read it
again if you want to update!
Hotfix v1.0.1:
- Fixed FixVehicleDeformation export from the example not syncing to every client properly.
Support
If you want to further support my work, consider taking a look at my Tebex store. Maybe you can find something you would like