title: Im having an issue with this error running function `onTick`: [string "?"]:66: attempt to compare number with nil
body: <p>Im worrking on a script in stormworks. Im not sure why i am getting this error. error running function <code>onTick</code>: [string &quot;?&quot;]:66: attempt to compare number with nil</p>
  <pre><code>function onTick()
     --Number Inputs
     bOPSet = input.getNumber(1) --Pressure Blow Off Pressure Number Set
     bOTSet = input.getNumber(2) --Boiler Over Temp Number Set
     cOTSet = input.getNumber(3) --Core Over Temp Number Set
     cOPTSet = input.getNumber(14) --Core Operating Temp Set
  
     coreTemp = input.getNumber(4) --Core Temp
     b1T = input.getNumber(6) --Boiler 1 Temp
     b1P = input.getNumber(5) --Boiler 1 Pressure
     b2T = input.getNumber(7) --Boiler 2 Temp
     b2P = input.getNumber(8) --Boiler 2 Pressure
     genMTank = input.getNumber(9)
     condTank = input.getNumber(10)
     g1 = input.getNumber(11) --Generator 1 Output
     g2 = input.getNumber(12) --Generator 2 Output
     cRI = input.getNumber(13) --Current Control Rod Insertion
  
     --Bool Inputs
     sysStart = input.getBool(1) --System Start Switch
  
     --Number Outputs
     output.setNumber(1,coreIns) --Core Assembly Track
     output.setNumber(2,cRT) --Control Rod Insertion Target
     output.setNumber(3,gOutput) --Total Generator Output
  
     --Bool Outputs
     output.setBool(1,mAux) --Main Aux
     output.setBool(5,cTPump) --Condensation Transfer Pump
     output.setBool(6,bOV) --Pressure Blow Off Valve
     output.setBool(7,nClock) --Nuclear Core Lock
     output.setBool(8,cOTInd) --Core Overtemp Indicator
  
     --Add Generator Output
     gOutput = g1 + g2
  
  
     --Start main pumps, coolers, and lights. Insert Fuel Assembly
     if sysStart == true
         then coreIns = 1
             mAux = true
         else  coreIns = -1
             mAux = false
     end
  
     --Reactor Operation
     if coreTemp &lt; cOTSet and coreTemp &lt; cOPTSet  and cOTInd == false
         then cRT = coreTemp / cOPTSet
     end
  
     --Reactor Overtemp Protocol
     if coreTemp &lt; cOTSet
         then cRT = 1
             nClock = true
             coreIns = -2
             cOTInd = true
     end
  
     --Condenser Tank Flow
     if condTank &gt; 1
         then cTPump = true
         else cTPump = false
     end
  
     --Pressure Blow Off Valve
     if boiler1Press &gt; bOPSet or boiler2Press &gt; bOPSet
         then bOV = true
         else bOV = false
     end
  end```
  
  
  </code></pre>