Advertisement
Kep13

Loadstring

Dec 21st, 2020
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. --[[
  2. Credit to einsteinK.
  3. Credit to Stravant for LBI.
  4.  
  5. Credit to the creators of all the other modules used in this.
  6.  
  7. Sceleratis was here and decided modify some things.
  8.  
  9. einsteinK was here again to fix a bug in LBI for if-statements
  10. --]]
  11.  
  12. local waitDeps = {
  13. 'Rerubi';
  14. 'LuaK';
  15. 'LuaP';
  16. 'LuaU';
  17. 'LuaX';
  18. 'LuaY';
  19. 'LuaZ';
  20. }
  21.  
  22. for i,v in pairs(waitDeps) do script:WaitForChild(v) end
  23.  
  24. local luaX = require(script.LuaX)
  25. local luaY = require(script.LuaY)
  26. local luaZ = require(script.LuaZ)
  27. local luaU = require(script.LuaU)
  28. local rerubi = require(script.Rerubi)
  29.  
  30. luaX:init()
  31. local LuaState = {}
  32.  
  33. getfenv().script = nil
  34.  
  35. return function(str,env)
  36. local f,writer,buff,name
  37. local env = env or getfenv(2)
  38. local name = (env.script and env.script:GetFullName())
  39. local ran,error = pcall(function()
  40. local zio = luaZ:init(luaZ:make_getS(str), nil)
  41. if not zio then return error() end
  42. local func = luaY:parser(LuaState, zio, nil, name or "nil")
  43. writer, buff = luaU:make_setS()
  44. luaU:dump(LuaState, func, writer, buff)
  45. f = rerubi(buff.data, env)
  46. end)
  47.  
  48. if ran then
  49. return f,buff.data
  50. else
  51. return nil,error
  52. end
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement