Advertisement
riperroni

sh

Oct 11th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. int opencustomlibs(lua_State* L) {
  2. lua_newtable(L);
  3. lua_pushcfunction(L, Instance_new);
  4. lua_setfield(L, -2, "new");
  5. lua_setglobal(L, "Instance");
  6. lua_settop(L, 0);
  7. lua_newtable(L);
  8. lua_pushcfunction(L, Vector3_new);
  9. lua_setfield(L, -2, "new");
  10. lua_setglobal(L, "Vector3");
  11. lua_settop(L, 0);
  12. lua_getglobal(L, "Vector3");
  13. lua_pushvalue(L, -1);
  14. lua_setfield(L, -2, "__index");
  15. lua_settop(L, 0);
  16. lua_newtable(L);
  17. lua_pushcfunction(L, Color3_new);
  18. lua_setfield(L, -2, "new");
  19. lua_setglobal(L, "Color3");
  20. lua_settop(L, 0);
  21. lua_getglobal(L, "Color3");
  22. lua_pushvalue(L, -1);
  23. lua_setfield(L, -2, "__index");
  24. lua_settop(L, 0);
  25. lua_newtable(L);
  26. lua_pushstring(L, "deadass should already know that this is locked");
  27. lua_setfield(L, -2, "__metatable");
  28. lua_settop(L, 0);
  29. lua_newtable(L);
  30. lua_createtable(L, 0, 1);
  31. lua_pushcfunction(L, GameIndex);
  32. lua_setfield(L, -2, "__index");
  33. lua_pushcfunction(L, GameNewIndex);
  34. lua_setfield(L, -2, "__newindex");
  35. lua_pushcfunction(L, GameCall);
  36. lua_setfield(L, -2, "__call");
  37. lua_setmetatable(L, -2);
  38. lua_setglobal(L, "game");
  39. lua_settop(L, 0);
  40. lua_newtable(L);
  41. lua_createtable(L, 0, 1);
  42. lua_pushcfunction(L, WorkspaceIndex);
  43. lua_setfield(L, -2, "__index");
  44. lua_pushcfunction(L, WorkspaceNewIndex);
  45. lua_setfield(L, -2, "__newindex");
  46. lua_pushcfunction(L, WorkspaceCall);
  47. lua_setfield(L, -2, "__call");
  48. lua_setmetatable(L, -2);
  49. lua_setglobal(L, "workspace");
  50. lua_settop(L, 0);
  51. lua_pushcfunction(L, PrintIdentity);
  52. lua_setglobal(L, "printidentity");
  53. lua_settop(L, 0);
  54. lua_pushcfunction(L, Warn);
  55. lua_setglobal(L, "warn");
  56. lua_settop(L, 0);
  57. lua_pushcfunction(L, Print);
  58. lua_setglobal(L, "print");
  59. lua_settop(L, 0);
  60. lua_pushcfunction(L, Wait);
  61. lua_setglobal(L, "wait");
  62. lua_settop(L, 0);
  63. lua_pushcfunction(L, LuaCAPI);
  64. lua_setglobal(L, "luac");
  65. lua_settop(L, 0);
  66. return 1;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement