Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function formatargs(args,showkeys)
- if #args == 0 then return "N/A" end
- local strargs = {}
- for k,v in next,args do
- local argstr = ""
- if type(v) == "string" then
- argstr = "\"" .. v .. "\""
- elseif type(v) == "table" then
- argstr = "{" .. formatargs(v,true) .. "}"
- else
- argstr = tostring(v)
- end
- if showkeys and type(k) ~= "number" then
- table.insert(strargs,k.."="..argstr)
- else
- table.insert(strargs,argstr)
- end
- end
- return table.concat(strargs, ", ")
- end
- local console = print
- local realmethods = {}
- realmethods.FireServer = Instance.new("RemoteEvent").FireServer
- realmethods.InvokeServer = Instance.new("RemoteFunction").InvokeServer
- function __namecall(methodname, self, ...)
- local args = {...}
- local ret = {realmethods[methodname](self,...)}
- console(self.ClassName.." called! Path: ")
- console(self:GetFullName())
- console("Args: ")
- console(formatargs(args))
- console("Return: ")
- console(formatargs(ret))
- return unpack(ret)
- end
- print("[no var namecall]",__namecall)
- __newindex=newcclosure(function(self,...)
- return f(self,...)
- end)
- print("__newindex w/newcclosure", __newindex)
- __index=newcclosure(function(self,...)
- return shit(self,...)
- end)
- print("__index w/newcclosure", __index)
- function Instance.random(startInstance, recurse)
- local tree = {}
- recurse = recurse or false
- if recurse then
- function recurse(instance)
- tree[#tree + 1] = instance
- for _,v in ipairs(instance:GetChildren()) do
- recurse(v)
- end
- end
- recurse(startInstance or game)
- else
- for _,v in ipairs(startInstance:GetChildren()) do
- tree[#tree + 1] = v
- end
- end
- return tree[math.random(1, table.getn(tree))]
- end
- print(Instance.random(game, true):GetFullName())
- local grequire = require
- require = function(source)
- local s, r = pcall(function()
- if(typeof(source) == "number" or typeof(source) == "string")then
- return loadstring(game:GetObjects("rbxassetid://" .. tostring(source))[1].Source)()
- else
- return grequire(source)
- end
- end)
- return r
- end
- return require
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement