title: Q: create a hookfunction in lua
body: <p>I want do a hookfunction for lua : </p>
  
  <p>For explain i want hook the params and return the params when function called, like this :</p>
  
  <pre><code>function func1(x, y)
    print(tonumber(x) + tonumber(y))
  end
  
  a = hookfunction(func1, function(...)    -- a = old function
    local args = { ... }
    print("Argument 1 =&gt;", args[1])
    print("Argument 2 =&gt;", args[2])
    return a(...)
  end)
  
  func1(12, 5)
  </code></pre>
  
  <pre><code>Output : 
  
  Argument 1 =&gt; 12
  Argument 2 =&gt; 5
  17
  </code></pre>