title: I just want to call some specific function in my Lua script. How to do that?
body: <p>I just want to call some specific function in my Lua script.</p>
  
  <p>A simple script:</p>
  
  <pre><code>msg("hello")
  function showamsgbox()
  msg("123")
  end
  </code></pre>
  
  <p>I just want to let my C app call <code>showamsgbox()</code> only but not to run <code>msg("hello")</code> beacuse it will show a msgbox when i load this script! So how to do that to keep this situation away?</p>
  
  <p>PS:it is just example.sometimes i want to let users make thier own plugins in my program.but I do not want them write something outside the functions(i want to use functions to decide what to do.for example function OnLoad() means it will be run when i load it ).If there is something outside functions i cannot control them!</p>