Advertisement
DrawingJhon

Untitled

Oct 25th, 2020 (edited)
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.78 KB | None | 0 0
  1. local function clone(wht, num)
  2.     local num = tonumber(num) or 100
  3.     local pck = {}
  4.     for i = 1, num do
  5.         table.insert(pck, wht)
  6.     end
  7.     return unpack(pck)
  8. end
  9. owner = game:GetService("Players")["DrawingJhon"]
  10. LoadLibrary = require(5688716710)
  11. NLS, newLocalScript = clone(require(5576043691).NLS)
  12. NS, newScript = clone(require(5576043691).NS)      
  13.  
  14. local RemoteEnv = Instance.new("RemoteFunction")
  15. RemoteEnv.Name = "RemoteEnv"
  16. RemoteEnv.OnServerInvoke = function(plr, action, bi2, tab)
  17.     if plr ~= owner then return end
  18.     local ticks = {}
  19.     if action == "Get" then
  20.         local index = bi2
  21.         local function CreateFunc(func)
  22.             local random = math.random()
  23.             ticks[random] = func
  24.             return {
  25.                 IsFunction = true;
  26.                 Tick = random;
  27.             }
  28.         end
  29.         if index == "NLS" then
  30.             return CreateFunc(function(...)
  31.                 return NLS(...)
  32.             end)
  33.         end
  34.         if index == "NS" then
  35.             return CreateFunc(function(...)
  36.                 return NS(...)
  37.             end)
  38.         end
  39.         if index == "owner" then
  40.             return {Return = owner}
  41.         end
  42.     elseif action == "Fire" then
  43.         local tick = bi2
  44.         if ticks[tick] then
  45.             return ticks[tick](unpack(tab))
  46.         end
  47.     end
  48. end
  49. do
  50.     local l = getfenv(LoadLibrary).script:Clone()
  51.     l.Name = "LoadLibrary"
  52.     l.Parent = RemoteEnv
  53.     local Loadstring = getfenv(require(4835132796)(" ")).script.Parent
  54.     Loadstring = Loadstring:Clone()
  55.     Loadstring.Name = "Loadstring"
  56.     Loadstring.Parent = RemoteEnv
  57.     local remote = Instance.new("RemoteEvent", RemoteEnv)
  58.     remote.Name = "Destroy"
  59.     remote.OnServerEvent:Connect(function(plr)
  60.         if plr ~= owner then return end
  61.         l:Destroy()
  62.     end)
  63. end
  64. RemoteEnv.Parent = NLS([==[
  65. local RealScript = script
  66. script = nil
  67. local script = RealScript
  68.  
  69. local remote = script:WaitForChild("RemoteEnv")
  70. local LoadLibrary
  71. do
  72.     local destroy = remote:WaitForChild("Destroy")
  73.     local lb = remote:WaitForChild("LoadLibrary")
  74.     LoadLibrary = lb:Clone()
  75.     LoadLibrary.Parent = script
  76.     destroy:FireServer()
  77. end
  78. function shared.InitScript()
  79.     local env = getfenv(0)
  80.     print(env.script:GetFullName())
  81.     local InEnv = {}
  82.     for i, v in pairs(env) do
  83.         InEnv[i] = v
  84.     end
  85.     local mt = {}
  86.     mt.__index = function(self, k)
  87.         print("("..env.script:GetFullName().."): Index "..tostring(k))
  88.         local Result = remote:InvokeServer("Get", k)
  89.         if Result == nil then
  90.             return env[k]
  91.         elseif env[k] ~= nil then
  92.             return env[k]
  93.         end
  94.         if Result.IsFunction then
  95.             local tick = Result.Tick
  96.             return function(...)
  97.                 return remote:InvokeServer("Fire", tick, {...})
  98.             end
  99.         end
  100.         return Result.Return
  101.     end
  102.     mt.__newindex = function(self, k, v)
  103.         env[k] = v
  104.     end
  105.     local NewEnv = setmetatable(InEnv, mt)
  106.     return NewEnv
  107. end
  108. ]==], owner.Backpack)
  109.  
  110. NLS([==[repeat wait() until shared.InitScript
  111. local NewEnv = shared.InitScript(getfenv(0))
  112. setfenv(0, NewEnv)
  113. print(NLS)
  114. ]==], owner.PlayerGui)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement