Impact Dynamics / Developers

Server exports

GetCondition

Lua
local condition = exports['ryan-impactdynamics']:GetCondition(vehicle)

The vehicle's Impact Dynamics condition (bent wheels, jammed doors, wrecked engine), or nil when it has none. Save it with the vehicle in your garage. See Vehicle condition state.

SetCondition

Lua
exports['ryan-impactdynamics']:SetCondition(vehicle, condition)   -- -> true / false

Gives a vehicle a condition (e.g. after spawning it from a garage). The table is validated; invalid fields are dropped, and a table with nothing valid in it clears the condition. Returns false only when the vehicle does not exist.

A player driving the car takes over bent wheels and jams at once. A wrecked flag (x) takes effect the next time someone gets in to drive.

ClearCondition

Lua
exports['ryan-impactdynamics']:ClearCondition(vehicle)   -- -> true / false

Clears the stored condition (bent wheels, jams, the wrecked flag) for everyone. It does not touch GTA's own damage, a pending slow tyre leak or an engine that is already dead - fix the car with your mechanic script too.

FreeDoor

Lua
exports['ryan-impactdynamics']:FreeDoor(vehicle, door)   -- -> true / false

Frees a jammed door and swings it open (e.g. from an extrication tool). door defaults to 0. Fires ryan-impactdynamics:doorFreed with how = 'script'.

Returns false when the vehicle does not exist or has no Impact Dynamics condition. Otherwise it returns true - also when that door was not jammed - so check with GetCondition first if that matters to you.

ClearDebris

Lua
local removed = exports['ryan-impactdynamics']:ClearDebris(coords, radius, bucket)
Argument Default
coords - vector3 centre
radius 30.0 Metres
bucket 0 Routing bucket of the fields

Removes every debris field in range for everyone and returns how many were removed.

Still stuck? Open a ticket in the Ryan Studios Discord and we'll help you out.