Advertisement
TheGamer1

ASADSADSDFASD

Jul 31st, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. local gameeditor = {}
  2. function gameeditor:getregistry(name)
  3. for i,v in next, getreg() do
  4. if typeof(v) == "function" then
  5. local func = debug.getupvalue(v, name)
  6. if func then
  7. return func
  8. end
  9. end
  10. end
  11. end
  12. function gameeditor:getregistrytable(name)
  13. for i,v in next, getreg() do
  14. if typeof(v) == "table" then
  15. local func = v[name]
  16. if func then
  17. return func
  18. end
  19. end
  20. end
  21. end
  22. function gameeditor:replacefunc(name, newfunc)
  23. for i,v in next, getreg() do
  24. if typeof(v) == "function" then
  25. local func = debug.getupvalue(v, name)
  26. if func and typeof(v) == "function" then
  27. debug.setupvalue(v, name, newfunc)
  28. end
  29. end
  30. end
  31. end
  32. function gameeditor:replacevalue(name, newvalue)
  33. for i,v in next, getreg() do
  34. if typeof(v) == "function" then
  35. local value = debug.getupvalue(v, name)
  36. if value then
  37. debug.setupvalue(v, name, newvalue)
  38. end
  39. end
  40. end
  41. end
  42. function gameeditor:getgc(name)
  43. for i,v in next, getgc() do
  44. if typeof(v) == "function" then
  45. local func = debug.getupvalue(v, name)
  46. if func then
  47. return func
  48. end
  49. end
  50. end
  51. end
  52. function gameeditor:getgcindex(sd)
  53. for i,v in next, getgc() do
  54. if typeof(v) == "function" and not is_synapse_function(v) then
  55. for i2, v2 in next, debug.getupvalues(v) do
  56. if typeof(v2) == "table" then
  57. if v2[sd] then
  58. return v2
  59. end
  60. end
  61. end
  62. end
  63. end
  64. end
  65. function gameeditor:getgctable(name)
  66. for i,v in next, getgc() do
  67. if typeof(v) == "table" then
  68. local func = v[name]
  69. if func then
  70. return func
  71. end
  72. end
  73. end
  74. end
  75. function gameeditor:replacefuncgc(name, newfunc)
  76. for i,v in next, getgc() do
  77. if typeof(v) == "function" then
  78. local func = debug.getupvalue(v, name)
  79. if func and typeof(v) == "function" then
  80. debug.setupvalue(v, name, newfunc)
  81. end
  82. end
  83. end
  84. end
  85. function gameeditor:replacevaluegc(name, newvalue)
  86. for i,v in next, getgc() do
  87. if typeof(v) == "function" then
  88. local value = debug.getupvalue(v, name)
  89. if value then
  90. debug.setupvalue(v, name, newvalue)
  91. end
  92. end
  93. end
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement