Ectroi

elysian compatibility script

Jan 21st, 2020
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. local function CopyTable(Table)
  2.     local CopyedTable = {}
  3.     for i, v in next, Table do
  4.         if type(v) == "table" then
  5.             CopyedTable[i] = CopyTable(v)
  6.         else
  7.             CopyedTable[i] = v
  8.         end
  9.     end
  10.     return CopyedTable
  11. end
  12. getgenv().debug = CopyTable(debug)
  13. setreadonly(debug, false)
  14. getgenv().debug.getupvalues = function(...)
  15.     local args = {...}
  16.     if type(args[1]) == "number" then
  17.         args[1] = args[1] + 1
  18.     end
  19.     return getupvals(unpack(args)) or {}
  20. end
  21. getgenv().debug.getupvalue = function(...)
  22.     return getupval(...)
  23. end
  24. getgenv().debug.setupvalue = function(...)
  25.     setupval(...)
  26. end
  27. getgenv().debug.getconstants = function(...)  
  28.     local args = {...}
  29.     if type(args[1]) == "number" then
  30.         args[1] = args[1] + 1
  31.     end
  32.     return getconsts(unpack(args)) or {}
  33. end
  34. getgenv().debug.setconstant = function(...)
  35.     setconst(...)
  36. end
  37. getgenv().debug.getregistry = function()
  38.     return getreg()
  39. end
  40. setreadonly(debug, true)
  41. getgenv().hookfunction = replaceclosure
  42. getgenv().hookfunc = replaceclosure
  43. getgenv().is_elysian_function = function(f)
  44.     local Env = getfenv(f)
  45.     local ElyFunc = false
  46.     if Env.script and not Env.script.Parent and Env.script.Name:reverse() == "elysianscript" then
  47.         ElyFunc = true
  48.     end
  49.     return ElyFunc
  50. end
  51. getgenv().compatibility_loaded = true
Advertisement
Add Comment
Please, Sign In to add comment