Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.01 KB | None | 0 0
  1. -- AutoFarm
  2. _G.AutoFarm = true -- true or false
  3. _G.TPToSafe = true
  4. _G.AutoMove = true
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. -- Variables
  17. local MainEvent = game:GetService("ReplicatedStorage").RE
  18. local MainInvoke = game:GetService("ReplicatedStorage").RF
  19. local RunService = game:GetService("RunService")
  20. local plr = game.Players.LocalPlayer
  21. local hum = plr.Character.Humanoid
  22. local plrRoot = plr.Character.HumanoidRootPart
  23. local RightHand = plr.Character.RightHand
  24. local Shop = workspace:WaitForChild("Map").Pads.Shop
  25. local counts = 0
  26. local counts2 = 9999
  27. local Rebirths = plr:WaitForChild("leaderstats")["🎉 Rebirths"].Value
  28. local counts3 = 0
  29.  
  30. -- Functions
  31. function BoughtMowers(Mower)
  32. for i,v in pairs(game.Players.LocalPlayer.PlayerGui.gameUI.shopFrame.scrollingFrame:GetChildren()) do
  33. if v:IsA("TextButton") and tonumber(v.Name) < math.huge then
  34. if v:FindFirstChild(Mower) then
  35. if v.Corner.Text ~= "" then
  36. return false
  37. elseif v.Corner.Text == "" then
  38. return true
  39. end
  40. end
  41. elseif v.ClassName ~= "TextButton" and v.ClassName ~= "UIGridLayout" then
  42. game.Players.LocalPlayer.PlayerGui.gameUI.shopFrame.Visible = false
  43. local oldPos = plrRoot.CFrame
  44. plrRoot.CFrame = Shop.CFrame
  45. wait(3)
  46. plrRoot.CFrame = oldPos
  47. print("teleport bc classname isnt textbutton")
  48. end
  49. end
  50. end
  51.  
  52. function Move()
  53. pcall(function()
  54. wait(1)
  55. repeat
  56. wait()
  57. if _G.AutoMove then
  58. local oldPos = plrRoot.Position
  59. part = Instance.new("Part")
  60. part.Parent = workspace
  61. part.Position = Vector3.new(plrRoot.Position.X, plrRoot.Position.Y, plrRoot.Position.Z + 20)
  62. part.Transparency = 1
  63. part.Anchored = true
  64. hum:MoveTo(part.Position)
  65. wait(.5)
  66. hum:MoveTo(oldPos)
  67. wait(.5)
  68. part:Destroy()
  69. end
  70. until not _G.AutoFarm
  71. end)
  72. end
  73.  
  74. function BuyMowers()
  75. pcall(function()
  76. while _G.AutoFarm do
  77. wait()
  78. for i,v in pairs(game:GetService("ReplicatedStorage").Assets.Mowers:GetChildren()) do
  79. local value = BoughtMowers(v.Name)
  80. if value == true then
  81. game:GetService("ReplicatedStorage").RF:InvokeServer("buyOrEquipMower", {v.Name})
  82. MainInvoke:InvokeServer("canRebirth", {})
  83. end
  84. end
  85. end
  86. end)
  87. end
  88.  
  89. local function FindTool()
  90. pcall(function()
  91. for i,v in pairs(plr.Backpack:GetChildren()) do
  92. if v:IsA("Tool") then
  93. v.Parent = plr.Character
  94. return v
  95. elseif v.ClassName ~= "Tool" then
  96. for a,b in pairs(plr.Character:GetChildren()) do
  97. if b:IsA("Tool") then
  98. return b
  99. end
  100. end
  101. end
  102. end
  103. end)
  104. end
  105.  
  106. function AntiAFK()
  107. loadstring(game:HttpGet("https://pastebin.com/raw/sDXcYFhR", true))()
  108. end
  109.  
  110. function Autofarm()
  111. pcall(function()
  112. if _G.AutoFarm then
  113. spawn(BuyMowers)
  114. spawn(Move)
  115. end
  116. while _G.AutoFarm do
  117. RunService.Heartbeat:Wait()
  118. local tool = FindTool()
  119. MainEvent:FireServer("grassCollect", {1})
  120. MainEvent:FireServer("sellGrass", {1})
  121. end
  122. end)
  123. end
  124.  
  125. safe = Instance.new("Part")
  126. safe.Position = Vector3.new(plrRoot.Position.X, plrRoot.Position.Y + 1000, plrRoot.Position.Z)
  127. safe.Size = Vector3.new(99999999999999999999999999, 0.5, 99999999999999999999999999)
  128. safe.Transparency = 0.8
  129. safe.Anchored = true
  130. safe.Name = "Safe"
  131. safe.CanCollide = true
  132. safe.Parent = workspace
  133.  
  134. if _G.AutoFarm and _G.TPToSafe then
  135. pcall(function()
  136. plrRoot.CFrame = CFrame.new(safe.Position.X, safe.Position.Y + 5, safe.Position.Z)
  137. end)
  138. end
  139.  
  140. function count()
  141. while _G.AutoFarm do
  142. wait(1)
  143. counts2 = counts2 + 1
  144. counts3 = counts3 + 1
  145. if counts2 >= 3 then
  146. game.Players.LocalPlayer.PlayerGui.gameUI.shopFrame.Visible = false
  147. local oldPos = plrRoot.CFrame
  148. plrRoot.CFrame = Shop.CFrame
  149. wait(1)
  150. plrRoot.CFrame = CFrame.new(safe.Position.X, safe.Position.Y + 5, safe.Position.Z)
  151. counts2 = 0
  152. end
  153. if counts3 >= 20 then
  154. MainInvoke:InvokeServer("buyUpgrade", {"bagLevel"})
  155. MainInvoke:InvokeServer("buyUpgrade", {"rangeLevel"})
  156. MainInvoke:InvokeServer("buyUpgrade", {"speedLevel"})
  157. end
  158. end
  159. end
  160.  
  161. spawn(count)
  162. spawn(Autofarm)
  163. spawn(AntiAFK)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement