Advertisement
miissso

4652435erafgeryte34566t3w345qtywrfsg5g

Jun 1st, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. function formatargs(args,showkeys)
  2. if #args == 0 then return "N/A" end
  3. local strargs = {}
  4. for k,v in next,args do
  5. local argstr = ""
  6. if type(v) == "string" then
  7. argstr = "\"" .. v .. "\""
  8. elseif type(v) == "table" then
  9. argstr = "{" .. formatargs(v,true) .. "}"
  10. else
  11. argstr = tostring(v)
  12. end
  13. if showkeys and type(k) ~= "number" then
  14. table.insert(strargs,k.."="..argstr)
  15. else
  16. table.insert(strargs,argstr)
  17. end
  18. end
  19. return table.concat(strargs, ", ")
  20. end
  21.  
  22. local console = print
  23. local realmethods = {}
  24. realmethods.FireServer = Instance.new("RemoteEvent").FireServer
  25. realmethods.InvokeServer = Instance.new("RemoteFunction").InvokeServer
  26.  
  27. function __namecall(methodname, self, ...)
  28. local args = {...}
  29. local ret = {realmethods[methodname](self,...)}
  30. console(self.ClassName.." called! Path: ")
  31. console(self:GetFullName())
  32. console("Args: ")
  33. console(formatargs(args))
  34. console("Return: ")
  35. console(formatargs(ret))
  36. return unpack(ret)
  37. end
  38. print("[no var namecall]",__namecall)
  39.  
  40.  
  41. __newindex=newcclosure(function(self,...)
  42. return f(self,...)
  43. end)
  44. print("__newindex w/newcclosure", __newindex)
  45. __index=newcclosure(function(self,...)
  46. return shit(self,...)
  47. end)
  48. print("__index w/newcclosure", __index)
  49.  
  50. function Instance.random(startInstance, recurse)
  51. local tree = {}
  52. recurse = recurse or false
  53. if recurse then
  54. function recurse(instance)
  55. tree[#tree + 1] = instance
  56. for _,v in ipairs(instance:GetChildren()) do
  57. recurse(v)
  58. end
  59. end
  60. recurse(startInstance or game)
  61. else
  62. for _,v in ipairs(startInstance:GetChildren()) do
  63. tree[#tree + 1] = v
  64. end
  65. end
  66. return tree[math.random(1, table.getn(tree))]
  67. end
  68.  
  69. print(Instance.random(game, true):GetFullName())
  70.  
  71. local grequire = require
  72. require = function(source)
  73. local s, r = pcall(function()
  74. if(typeof(source) == "number" or typeof(source) == "string")then
  75. return loadstring(game:GetObjects("rbxassetid://" .. tostring(source))[1].Source)()
  76. else
  77. return grequire(source)
  78. end
  79. end)
  80. return r
  81. end
  82.  
  83. return require
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement