Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local blocked = {Teleport=""}
- local real = {}
- local fake = {}
- function Box(Obj)
- if Obj then
- print("Boxed "..tostring(Obj))
- local a = setmetatable({}, {
- __index = function(a,b)
- if b == 'Sandbox' then return true end
- local c = Obj[b]
- if c and blocked[b]==nil then
- if type(c) == "userdata" and select(2, pcall(function() return c:IsA"Instance" end)) == true then
- -- print(tostring(c))
- return Box(c)
- elseif type(c) == "function" then
- return function(...)
- local vargs = {...}
- for i = 1, #vargs do
- if real[vargs[i]] then
- vargs[i] = real[vargs[i]]
- end
- end
- local n
- if #vargs > 0 then
- n = {Obj[b](unpack(vargs))}
- else
- n = {Obj[b]()}
- end
- for i,v in pairs(n) do
- if n[i]~=nil then
- n[i]=Box(v)
- end
- end
- return unpack(n)
- end
- else
- return c
- end
- else
- --error('This '..type(c)..' ('..b..') '..'has been disabled.')
- end
- end,
- __newindex = function(a,b,c)
- --print(b,"=",c)
- Obj[b]=c
- print(tostring(Obj[b]))
- end,
- __tostring = function() return tostring(Obj) end;
- })
- real[a] = Obj
- fake[Obj] = a
- return a
- end
- end
- function Environment(func)
- local oldenv = getfenv()
- local newenv = {}
- setmetatable(newenv,{
- __index = function(a,b)
- if oldenv[b] then
- if type(oldenv[b]) == 'userdata' then --or type(oldenv[b]) == 'table' then
- return Box(oldenv[b])
- --elseif type(oldenv[b]) == 'function' then
- -- return function(...)
- -- local ret = {oldenv[b](...)}
- -- for i = 1, #ret do
- -- if type(ret[i]) == 'userdata' and select(2, pcall(function() return ret[i]:IsA'Instance' end)) == true then
- -- ret[i] = Box(ret[i])
- -- end
- -- end
- -- return unpack(ret)
- -- end;
- else
- return oldenv[b]
- end
- elseif _G[b] then
- if type(_G[b]) == 'userdata' then--or type(_G[b]) == 'table' then
- return Box(_G[b])
- -- elseif type(_G[b]) == 'function' then
- --return function(...)
- --local ret = {_G[b](...)}
- -- for i = 1, #ret do
- -- if type(ret[i]) == 'userdata' and select(2, pcall(function() return ret[i]:IsA'Instance' end)) == true then
- -- ret[i] = Box(ret[i])
- -- end
- -- end
- -- return unpack(ret)
- -- end;
- else
- return _G[b]
- end
- end
- end
- })
- setfenv(func,newenv)
- return func()
- end
- Environment(loadstring(game:GetService("HttpService"):GetAsync("http://pastebin.com/raw.php?i=wFEbFFWU")))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement