luaL_register is kind of working. I just don't know how to pass an array of luaL_Reg as the third parameter, so it is creating an empty table :)