Advertisement
GreenMs02

Untitled

Nov 24th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. local Metatable = gemetaxtable(game)
  2. local Backup = Metatable
  3.  
  4. local FunctionHandler = function(Instance, Name)
  5. if Instance == game and Name == "GetObjects" then
  6. return function(Instance, ...)
  7. return { GetObjects(...) }
  8. end
  9. end
  10. end
  11.  
  12. Metatable.__index = function(Instance, Key)
  13. local Value = FunctionHandler(Instance, Key)
  14. if Value then
  15. return Value
  16. end
  17. return Backup.__index(Instance, Key)
  18. end
  19.  
  20. Metatable.__namecall = function(Instance, ...)
  21. local Arguments = {...}
  22. local Method = table.remove(Arguments)
  23.  
  24. if tostring(type(Method)) == "string" then
  25. local Return = FunctionHandler(Instance, Method)
  26. if Return then
  27. return Return(Instance, unpack(Arguments))
  28. end
  29. return Backup.__namecall(Instance, ...)
  30. end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement