Advertisement
Guest User

Untitled

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