DogeGalaxy

Auto Farm R2DA

Aug 11th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. local lastworking = "38" --put updated version here
  2. assert(tostring(game.PlaceVersion) == tostring(lastworking), "Script version is out of date, please message Turte#8748 on Discord and tell him to update it")
  3.  
  4. local zombiefolder = game:GetService'Workspace':FindFirstChild'Characters':FindFirstChild'Zombies'
  5. local client = game:GetService'Players'.LocalPlayer
  6. local primary = client:FindFirstChild'Settings':FindFirstChild'Primary'
  7. local secondary = client:FindFirstChild'Settings':FindFirstChild'Secondary'
  8. local RepStorage = game:GetService'ReplicatedStorage'
  9. local remotes = RepStorage:FindFirstChild'RemoteEvents'
  10. local FX = remotes:FindFirstChild'FX'
  11. local bullet = remotes:FindFirstChild'BulletHit'
  12. local nofall = remotes:FindFirstChild'SelfDamage'
  13. local transform = 10.3 --quality-security.com
  14. local running = false
  15. local zconn = nil
  16. local codes = {}
  17.  
  18. local Part = Instance.new("Part")
  19. Part.Anchored = true
  20. Part.Size = Vector3.new(100, 2, 100)
  21. Part.Transparency = 0.7
  22.  
  23. local meta = getrawmetatable(game)
  24.  
  25. if setreadonly then
  26. setreadonly(meta, false)
  27. elseif make_writeable then
  28. make_writeable(meta)
  29. end
  30.  
  31. local backup = __namecall or meta.__namecall
  32. getgenv()['__namecall'] = backup
  33.  
  34. local function KillZombie(zchar)
  35. local id = (primary.Value ~= "" and codes[primary.Value] or codes[secondary.Value])
  36. local enum = 1
  37. if id == nil then return nil end
  38. local t = {}
  39. t.Hit = zchar:WaitForChild'Head'
  40. t.Humanoid = zchar:WaitForChild'Humanoid'
  41. t.Perc = 1
  42. t.Position = zchar:WaitForChild'Head'.Position
  43. t.Headshot = true
  44. repeat
  45. bullet:FireServer(t, enum, id)
  46. wait()
  47. until t.Humanoid.Health < 1
  48. end
  49.  
  50. local function MakePart(on)
  51. local root = client.Character:FindFirstChild'HumanoidRootPart'
  52. if root == nil then return end
  53. Part.CanCollide = on
  54. Part.Parent = workspace
  55. Part.CFrame = root.CFrame + Vector3.new(0, 100, 0)
  56.  
  57. if on then
  58. root.CFrame = Part.CFrame + Vector3.new(0, 5, 0)
  59. end
  60. end
  61.  
  62. meta.__namecall = function(self, ...)
  63. local args = {...}
  64. local method = table.remove(args, #args)
  65.  
  66. --[[
  67. if method == "GetChildren" and tostring(self.Name) == primary.Value then
  68. print(debug.getlocal(2, "CODE"))
  69. print('a')
  70. end
  71. ]]
  72.  
  73. if method == "InvokeServer" and tostring(self) == "GetCodes" then
  74. local name = args[#args]
  75. local ret = backup(self, ...)
  76. codes[name] = (ret + transform)
  77. return ret
  78. elseif method == "FireServer" then
  79. if self == nofall then
  80. return wait(9e9)
  81. elseif self == FX then
  82. pcall(function() print("Potential ban from script: " .. getfenv(2).script:GetFullName()) end)
  83. return wait(9e9)
  84. end
  85. end
  86. return backup(self, ...)
  87. end
  88.  
  89. local typecon = game:GetService'UserInputService'.InputBegan:Connect(function(key, ingui)
  90. if key.KeyCode == Enum.KeyCode.Q and not ingui then
  91. running = not running
  92. warn("RUNNING:", running)
  93. MakePart(running)
  94.  
  95. if running then
  96. zconn = zombiefolder.ChildAdded:Connect(function(c)
  97. KillZombie(c)
  98. end)
  99.  
  100. for i, v in pairs(zombiefolder:GetChildren()) do
  101. KillZombie(v)
  102. end
  103. else
  104. if zconn then
  105. zconn:Disconnect()
  106. end
  107. end
  108. end
  109. end)
  110.  
  111. pcall(function() Reset() end)
  112. getgenv().Reset = function()
  113. typecon:Disconnect()
  114. pcall(function()
  115. zconn:Disconnect()
  116. end)
  117. getrawmetatable(game).__namecall = __namecall
  118. running = false
  119. end
Add Comment
Please, Sign In to add comment