Carhud Config

I am trying to configure my Carhud to look like DOJ’s system, everything looks and works well. When my vehicle is damaged I made it so my “ENG” turns red but and now I am trying to figure out how to make it so if I turn off my engine, the “ENG” will also turn red but will return green if the engine is turned back on. Im very new to lua and I am trying to start small so that probably means I am doing this completely wrong :expressionless:

if (VehEngineHP > 0) and (VehEngineHP < 300) then
					drawTxt(UI.x + 0.619, UI.y + 1.266, 1.0,1.0,0.45, "Fluid", 255, 255, 255, 200)
					drawTxt(UI.x + 0.514, UI.y + 1.266, 1.0,1.0,0.45, "Oil", 255, 255, 255, 200)
					drawTxt(UI.x + 0.645, UI.y + 1.266, 1.0,1.0,0.45, "AC", 255, 255, 255, 200)
					drawTxt(UI.x + 0.620, UI.y + 1.240, 1.0,1.0,0.45, "~g~ENG", 255, 255, 255, 200)
				elseif VehEngineHP < 1 then 
					drawRct(UI.x + 0.159, UI.y + 0.809, 0.005, 0,0,0,0,100)  -- panel damage
					drawTxt(UI.x + 0.619, UI.y + 1.266, 1.0,1.0,0.45, "Fluid", 255, 255, 255, 200)
					drawTxt(UI.x + 0.514, UI.y + 1.266, 1.0,1.0,0.45, "Oil", 255, 255, 255, 200)
					drawTxt(UI.x + 0.645, UI.y + 1.266, 1.0,1.0,0.45, "AC", 255, 255, 255, 200)
					drawTxt(UI.x + 0.620, UI.y + 1.240, 1.0,1.0,0.45, "~r~ENG", 255, 255, 255, 200)
				else
					drawTxt(UI.x + 0.619, UI.y + 1.266, 1.0,1.0,0.45, "Fluid", 255, 255, 255, 150)
					drawTxt(UI.x + 0.514, UI.y + 1.266, 1.0,1.0,0.45, "Oil", 255, 255, 255, 150)
					drawTxt(UI.x + 0.645, UI.y + 1.266, 1.0,1.0,0.45, "AC", 255, 255, 255, 150)
					drawTxt(UI.x + 0.620, UI.y + 1.240, 1.0,1.0,0.45, "~g~ENG", 255, 255, 255, 200)
				end

				if ifVehicleEngineOn then
					drawTxt(UI.x + 0.620, UI.y + 1.240, 1.0,1.0,0.45, "~g~ENG", 255, 255, 255, 200)
				else
					drawTxt(UI.x + 0.620, UI.y + 1.240, 1.0,1.0,0.45, "~r~ENG", 255, 255, 255, 200)
				end
local get_ped_veh = GetVehiclePedIsIn(GetPlayerPed(-1),false) -- Current Vehicle ped is in
local running = Citizen.InvokeNative(0xAE31E7DF9B5B132E,get_ped_veh) -- GetIsVehicleEngineRunning
 
if running then -- unlock
drawTxt(0.709, 1.353, 1.0,1.0,0.44 , "~g~Engine", 255, 255, 255, 255)  -- INT: kmh 
drawRct(0.208, 0.86, 0.030,0.028,0,0,0,130)
else -- lock
drawTxt(0.709, 1.353, 1.0,1.0,0.44 , "~r~Engine", 255, 255, 255, 130)  -- INT: kmh
drawRct(0.208, 0.86, 0.030,0.028,0,0,0,130) 
end

Great thanks for the help