local overheat = 0 function overheatCheck() if getControlState("vehicle_secondary_fire") then -- minigun is active, adding the heat: overheat = overheat + 1 else -- minigun is inactive, cooling down to 0: overheat = math.max(overheat - 1, 0) end -- check for overheating/cooldown, toggle controls accordingly: if overheat >= 1000 and isControlEnabled("vehicle_secondary_fire") then toggleControl("vehicle_secondary_fire", false) outputChatBox("Minigun overheated!", 222, 0, 0) elseif overheat == 0 and not isControlEnabled("vehicle_secondary_fire") then toggleControl("vehicle_secondary_fire", true) outputChatBox("Minigun is back!", 0, 222, 0) end end addEventHandler("onClientPreRender", root, overHeatCheck)