M MY Multiplayer: Wiki
Side
Kind

getElementHealth

Shared

Reads the health of a player, ped, vehicle or object.

float|false getElementHealth(element element)

Parameters

NameTypeDescription
elementelementThe element to read.

Returns

The health, or false if the element has none.

Example

local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle and getElementHealth(vehicle) < 300 then
    outputDebugString("Your engine is about to catch fire!")
end

See also