local colour =
{
{ 204, 0, 0 },
{ 0, 0, 0 },
{ 165, 42, 42 },
}
function vehicleHealth ( )
for index, player in ipairs ( getElementsByType ( "player" ) ) do
local vehicle = getPedOccupiedVehicle ( player )
if ( vehicle ) then
local rndm = math.random ( #colour )
local vehicleHealth = getElementHealth ( vehicle )
if ( math.floor ( vehicleHealth / 10 ) < 30 ) then
setVehicleColor ( vehicle, unpack ( colour [ rndm ] ) )
end
end
end
end
setTimer ( vehicleHealth, 1000, 0 )