bodyHealth

Used to set or get body health on the vehicle.

Returns a number.

Declaration

vehicle.bodyHealth: number

Usage

const bodyHealth = vehicle.bodyHealth;

// OR

vehicle.bodyHealth = 255;

Real World Example

Set the body health of the vehicle when entering the vehicle.

function enteredVehicle(player, vehicle, seat) {
    vehicle.bodyHealth = 1000;
    console.log(`Body Health set to ${vehicle.bodyHealth}`);
}

alt.on('playerEnteredVehicle', enteredVehicle);

These examples assume you have vehicle created or available on server-side

results matching ""

    No results matching ""