title: This "choose" function in Lua always results in nil
body: <p>From the past this code does work then suddenly the function results the variables to nil.</p>
  <pre><code>function choose(n1,n2)
      local r = math.random(1,2)
      if not n1 or not n2 then error(&quot;Choosing a number or a string results in nil.&quot;) end -- error if nil
      if r&lt;1.5 then
          return n1
      else
          return n2
      end
  end
  function choose(v1,v2,v3)
      local r = math.random(1,3)
      if not v1 or not v2 or not v3 then error(&quot;Choosing a number or a string results in nil.&quot;) end --error if nil
      if r==1 then
          return v1
      elseif r==2 then
          return v2
      else
          return v3
      end
  end
  
  local Red,Yellow=2,12
  choose(Red,Yellow)
  </code></pre>
  <p>The error that i get is;</p>
  <pre><code>File: &quot;C:\Users\My Computer\Desktop\test.lua&quot; line 3,
      Choosing a number or a string results in nil.
  </code></pre>