Reconstruct the operation of handling lua script event