XxMirayxX21

SpoofPropertiesV2

Jan 22nd, 2021 (edited)
1,892
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. _G.objs = {}
  2.  
  3. getgenv().spoof = function(obj, property, value)
  4. local s = pcall(function()
  5. local lol = obj[property]
  6. end)
  7. if s then
  8. table.insert(_G.objs, {obj, property, value})
  9. end
  10. end
  11.  
  12. getgenv().findwithintable = function(o, p)
  13. for i, v in pairs(_G.objs) do
  14. if table.find(v, o) and table.find(v, p) then
  15. return v
  16. end
  17. end
  18. return nil
  19. end
  20.  
  21. getgenv().unspoof = function(obj, property)
  22. local lol = findwithintable(obj, property)
  23. if lol then
  24. table.remove(_G.objs, table.find(_G.objs, lol))
  25. end
  26. end
  27.  
  28.  
  29. local mt = getrawmetatable(game)
  30. setreadonly(mt, false)
  31. old = mt.__index
  32.  
  33. mt.__index = newcclosure(function(o, p)
  34. local t = findwithintable(o, p)
  35. if t ~= nil then
  36. return t[3]
  37. end
  38.  
  39. return old(o, p)
  40. end)
Add Comment
Please, Sign In to add comment