getElementHealth
Shared
Reads the health of a player, ped, vehicle or object.
float|false getElementHealth(element element)
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The 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