Advertisement
Zulkin

MOW MY LAWN 2 Autofarm script (WIP)

Nov 18th, 2022 (edited)
3,224
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.20 KB | Gaming | 0 0
  1. -- Rex. E#0001
  2. -- MOW MY LAWN 2 Get it all done in one package script
  3. -- Has Kill aura (AutoBossKill), Lawn Mower Range Expansion (AutoMow), and Automatic Multiplier Collection. (AutoMults)
  4. -- HIGHLY RECOMMEND DISABLING AUTOMULTS IN A PUBLIC SERVER UNLESS YOU'RE BAN SPEEDRUNNING LOL
  5. -- Todo:
  6. -- Make flying sword exploit (Flying sword bypasses iframes. I think you can understand why I want to exploit it.)
  7. -- Make dungeon autofarm (for levels) (WORK IN PROGRESS)
  8. -- V6.4
  9. local Players = game:GetService("Players")
  10. local Player = Players.LocalPlayer
  11. local Character = Player.Character
  12. local RunService = game:GetService("RunService")
  13. local RenderStepped = RunService.RenderStepped
  14. local Grass = workspace:FindFirstChild("GRASS")
  15. local TweenService = game:GetService("TweenService")
  16. local HeckYeah = workspace["Heck Yeah"]
  17. local BringTheMowingIGuess = HeckYeah.BringTheMowingIGuess
  18. local CutTime = 0.275 -- The time between each lawn cut.
  19. local StudRange = 35 -- The range in which you can MOW THE LAWN.
  20. local AttackDebounce = 0.075 -- for the swordfunction debounce.
  21. local CurrentTarget = nil -- This is for the dungeon autofarm
  22. local CanTweenToTarget = true -- Target movement debounce. Tween stacking is painful.
  23. local CanChangeTarget = true
  24. local TweenSpeed = 3 -- Game has anti-tp by the way.
  25. _G.AutoMow = true
  26. _G.AutoBossKill = true
  27. _G.AutoMults = true
  28.  
  29. function BreakVelocity() -- Taken straight from infiniteyield
  30.     local BeenASecond, V3 = false, Vector3.new(0, 0, 0)
  31.     delay(1, function()
  32.         BeenASecond = true
  33.     end)
  34.     while not BeenASecond do
  35.         for _, v in ipairs(Player.Character:GetDescendants()) do
  36.             if v.IsA(v, "BasePart") then
  37.                 v.Velocity, v.RotVelocity = V3, V3
  38.             end
  39.         end
  40.         wait()
  41.     end
  42. end
  43.  
  44. function SwordFunction(Plr)
  45.     if (Plr.Character or workspace:FindFirstChild(Plr.Name)) then
  46.         if Plr == Player then Character = Plr.Character end
  47.         Chr = Plr.Character
  48.         local Root
  49.         if Chr:FindFirstChild("HumanoidRootPart") then
  50.             local Root = Chr:FindFirstChild("HumanoidRootPart")
  51.         end
  52.         if Chr:FindFirstChildOfClass("Tool") and Chr:FindFirstChildOfClass("Tool"):FindFirstChild("Handle") then
  53.             local Sword = Chr:FindFirstChildOfClass("Tool")
  54.             for i, Boss in pairs(workspace:GetDescendants()) do
  55.                 if Boss:IsA("Model") and Boss:FindFirstChildOfClass("Humanoid") and not Players:GetPlayerFromCharacter(Boss) then
  56.                     if Chr:FindFirstChild("HumanoidRootPart") then
  57.                         local Target = Boss:FindFirstChild("HumanoidRootPart")
  58.                         local Root = Chr:FindFirstChild("HumanoidRootPart")
  59.                         local MagicSword = nil
  60.                         local MagicBlade = nil
  61.                         if (Chr:FindFirstChild("MagicSword1") or Chr:FindFirstChild("MagicSword2")) then
  62.                             MagicSword = Chr:FindFirstChild("MagicSword1") and Chr:FindFirstChild("MagicSword2")
  63.                             MagicBlade = MagicSword:FindFirstChild("Blade")
  64.                         end
  65.                         if Boss:FindFirstChild("HumanoidRootPart") and Chr:FindFirstChild("HumanoidRootPart") then
  66.                             local Dist = (Target.Position - Root.Position).magnitude
  67.                             if Dist <= StudRange then
  68.                                 if Boss:FindFirstChild("Stats") then
  69.                                     local Stats = Boss:FindFirstChild("Stats")
  70.                                     if Stats:FindFirstChild("HP") and Stats:FindFirstChild("HP").Value > 0 then
  71.                                         if MagicSword ~= nil and MagicBlade ~= nil then
  72.                                             firetouchinterest(MagicBlade,Target,0)
  73.                                         end
  74.                                         BringTheMowingIGuess:FireServer(Target,Sword)
  75.                                     else
  76.                                         if MagicSword ~= nil and MagicBlade ~= nil then
  77.                                             firetouchinterest(MagicBlade,Target,0)
  78.                                         end
  79.                                         BringTheMowingIGuess:FireServer(Target,Sword)
  80.                                     end
  81.                                 end
  82.                             end
  83.                         end
  84.                     end
  85.                 end
  86.             end
  87.         end
  88.     end
  89. end
  90.  
  91. function SwordFunctionTargetting()
  92.     if Player.Character and Player.Character:FindFirstChildOfClass("Tool") and Player.Character:FindFirstChild("HumanoidRootPart") and CanChangeTarget and Player.Character:FindFirstChildOfClass("Humanoid") then
  93.         CanChangeTarget = false
  94.         BreakVelocity()
  95.         Character = Player.Character
  96.         local Mower = Character:FindFirstChildOfClass("Tool")
  97.         local Root = Character:FindFirstChild("HumanoidRootPart")
  98.         local Humanoid = Character:FindFirstChildOfClass("Humanoid")
  99.         Humanoid.Destroying:Connect(function()
  100.             CanChangeTarget = false
  101.             CurrentTarget = nil
  102.             CanTweenToTarget = true
  103.             delay(4,function() CanChangeTarget = true end)
  104.         end)
  105.         for i,Target in pairs(workspace:GetDescendants()) do
  106.             if Target:IsA("Model") and Target:FindFirstChildOfClass("Humanoid") and not Players:GetPlayerFromCharacter(Target) then
  107.                 local HumanoidIdentifier = Target:FindFirstChildOfClass("Humanoid")
  108.                 if CurrentTarget == nil or (CurrentTarget.Parent and CurrentTarget.Parent:FindFirstChild("Stats") and CurrentTarget.Parent:FindFirstChild("Stats"):FindFirstChild("HP") and CurrentTarget.Parent:FindFirstChild("Stats"):FindFirstChild("HP").Value <= 0) then
  109.                     if HumanoidIdentifier ~= CurrentTarget then
  110.                         CurrentTarget = HumanoidIdentifier
  111.                         local Stats
  112.                         local HP
  113.                         if CurrentTarget.Parent:FindFirstChild("Stats") and CurrentTarget.Parent:FindFirstChild("Stats"):FindFirstChild("HP") then
  114.                             Stats = CurrentTarget.Parent:FindFirstChild("Stats")
  115.                             HP = Stats:FindFirstChild("HP")
  116.                         end
  117.                         local TargetRoot
  118.                         if Target and Target:FindFirstChild("HumanoidRootPart") then
  119.                             TargetRoot = Target:FindFirstChild("HumanoidRootPart")
  120.                         end
  121.                         if CanTweenToTarget then
  122.                             CanTweenToTarget = false
  123.                             local EndFrame = TargetRoot.CFrame * Root.CFrame.LookVector
  124.                             TargetRoot.CFrame = Root.CFrame
  125.                             TargetRoot.Anchored = true
  126.                             repeat RenderStepped:Wait()
  127.                                 BreakVelocity()
  128.                                 EndFrame = TargetRoot.CFrame * Root.CFrame.LookVector
  129.                                 Root.CFrame = CFrame.new(EndFrame) + Vector3.new(0,-8, 0)
  130.                                 BringTheMowingIGuess:FireServer(TargetRoot,Mower)
  131.                                 for i,movethisguy in pairs(workspace:GetDescendants()) do
  132.                                     if movethisguy:IsA("Model") and movethisguy:FindFirstChildOfClass("Humanoid") and not Players:GetPlayerFromCharacter(movethisguy) and movethisguy ~= Target then
  133.                                         if movethisguy:FindFirstChild("HumanoidRootPart") then
  134.                                             local EnemyRoot = movethisguy:FindFirstChild("HumanoidRootPart")
  135.                                             EnemyRoot.CFrame = CFrame.new(math.random(1,900),900000000,math.random(1,900))
  136.                                             --EnemyRoot.Anchored = true
  137.                                             for i,apart in pairs(movethisguy:GetChildren()) do
  138.                                                 if apart:IsA("BasePart") then
  139.                                                     apart.Anchored = false
  140.                                                 end
  141.                                             end
  142.                                         end
  143.                                     end
  144.                                 end
  145.                             until (CurrentTarget and CurrentTarget.Parent and CurrentTarget.Parent:FindFirstChild("Stats") and Stats:FindFirstChild("HP") and HP.Value <= 0) or CurrentTarget == nil or not CurrentTarget.Parent or Target == nil or TargetRoot == nil or Character == nil
  146.                             CurrentTarget = nil
  147.                             CanTweenToTarget = true
  148.                             CanChangeTarget = true
  149.                         end
  150.                     end
  151.                 end
  152.             end
  153.         end
  154.     end
  155. end
  156.  
  157. coroutine.wrap(function()
  158.     while _G.AutoMow and wait(CutTime) do
  159.         if Player.Character and Player.Character:FindFirstChildOfClass("Tool") and Player.Character:FindFirstChildOfClass("Tool"):FindFirstChild("SmashMouth") and Player.Character:FindFirstChild("HumanoidRootPart") then
  160.             Character = Player.Character
  161.             local Mower = Character:FindFirstChildOfClass("Tool")
  162.             local MowPart = Mower:FindFirstChild("SmashMouth")
  163.             local Root = Character.HumanoidRootPart
  164.             for i,GrassPiece in pairs(Grass:GetChildren()) do
  165.                 if GrassPiece:FindFirstChild("Slapped") and GrassPiece:FindFirstChild("Slapped").Value == false then
  166.                     if GrassPiece.Size == Vector3.new(3, 4, 3) and GrassPiece.CFrame.X ~= 43.5 then
  167.                         local Root = Character.HumanoidRootPart
  168.                         local Dist = (GrassPiece.Position - Root.Position).magnitude
  169.                         if Dist <= StudRange then
  170.                             firetouchinterest(MowPart,GrassPiece,0)
  171.                             firetouchinterest(MowPart,GrassPiece,1)
  172.                         end
  173.                     end
  174.                 end
  175.             end
  176.         end
  177.     end
  178. end)()
  179.  
  180. coroutine.wrap(function()
  181.     RenderStepped:Connect(function()
  182.         if _G.AutoBossKill then
  183.             if game.PlaceId == 4742977291 then
  184.                 SwordFunctionTargetting()
  185.             else
  186.                 SwordFunction(Player)
  187.             end
  188.         end
  189.     end)
  190. end)()
  191.  
  192. coroutine.wrap(function()
  193.     RenderStepped:Connect(function()
  194.         if _G.AutoMults then
  195.             for i,part in pairs(workspace:GetChildren()) do
  196.                 if (part.Name == "Unimportant" and part:IsA("Folder")) or (part.Name == "Strainer" and part:IsA("Model") and part:FindFirstChild("StrainerHitbox")) or (part.Name == "CarePackage" and part:FindFirstChild("Box")) or (part.Name == "Part" and workspace:FindFirstChild("Rain")) or (part.Name == "BallChase") or (part.Name == "Soccer") or (part.Name == "GoldRoller" or part.Name == "Roller") or (part.Name == "RingChase" and part:FindFirstChild("ARingadingding")) or (part.Name == "Graffiti" and part:FindFirstChild("Nodes")) then
  197.                     if Player.Character and Player.Character:FindFirstChild("HumanoidRootPart") and Player.Character:FindFirstChild("Torso") and Player.Character:FindFirstChild("Right Leg") and Player.Character:FindFirstChild("Left Leg") then
  198.                         Character = Player.Character
  199.                         local Root = Character:FindFirstChild("HumanoidRootPart")
  200.                         local Torso = Character:FindFirstChild("Torso")
  201.                         local RLeg = Character:FindFirstChild("Right Leg")
  202.                         local LLeg = Character:FindFirstChild("Left Leg")
  203.                         if Root:FindFirstChild("MultPopup") then
  204.                             Root:FindFirstChild("MultPopup"):Destroy()
  205.                         end
  206.                         if part.Name == "Unimportant" then
  207.                             for i,food in pairs(part:GetChildren()) do
  208.                                 if food.Name ~= "Part" and food.Name ~= "part" and food:IsA("BasePart") then
  209.                                     firetouchinterest(Root,food,0)
  210.                                     firetouchinterest(Root,food,1)
  211.                                 elseif food:IsA("MeshPart") then
  212.                                     firetouchinterest(Torso,food,0)
  213.                                     firetouchinterest(Torso,food,1)
  214.                                 end
  215.                             end
  216.                         elseif part.Name == "Strainer" and part:FindFirstChild("StrainerHitbox") then
  217.                             local StrainHitbox = part:FindFirstChild("StrainerHitbox")
  218.                             firetouchinterest(RLeg,StrainHitbox,0)
  219.                             firetouchinterest(RLeg,StrainHitbox,1)
  220.                         elseif part.Name == "CarePackage" and part:FindFirstChild("Box") then
  221.                             local Box = part:FindFirstChild("Box")
  222.                             firetouchinterest(Torso,Box,0)
  223.                             firetouchinterest(Torso,Box,1)
  224.                         elseif part.Name == "Part" and workspace:FindFirstChild("Rain") then
  225.                             firetouchinterest(Root,part,0)
  226.                             firetouchinterest(Root,part,1)
  227.                         elseif part.Name == "BallChase" then
  228.                             if part:FindFirstChild("Part") then
  229.                                 local Ball = part:FindFirstChild("Part")
  230.                                 firetouchinterest(Root,Ball,0)
  231.                                 firetouchinterest(Root,Ball,1)
  232.                             end
  233.                         elseif part.Name == "Soccer" then
  234.                             local SoccerBall = part.Ball
  235.                             local RGoal = part.RedGoal
  236.                             local BGoal = part.BlueGoal
  237.                             for i,ring in pairs(part:GetDescendants()) do
  238.                                 if (ring:IsA("WeldConstraint") or ring:IsA("Weld")) and ring.Part1 == Root then
  239.                                     if ring.Parent.Color == Color3.fromRGB(255,0,0) then
  240.                                         firetouchinterest(SoccerBall,RGoal,0)
  241.                                         firetouchinterest(SoccerBall,RGoal,1)
  242.                                     elseif ring.Parent.Color == Color3.fromRGB(0,0,255) then
  243.                                         firetouchinterest(SoccerBall,BGoal,0)
  244.                                         firetouchinterest(SoccerBall,BGoal,1)
  245.                                     end
  246.                                 end
  247.                             end
  248.                         elseif (part.Name == "GoldRoller" or part.Name == "Roller") then
  249.                             local Ball = part.Ball
  250.                             local Goal = part.Goal
  251.                             firetouchinterest(Ball,Goal,0)
  252.                             firetouchinterest(Ball,Goal,1)
  253.                         elseif (part.Name == "RingChase" and part:FindFirstChild("ARingadingding")) then
  254.                             local Ring = part:FindFirstChild("ARingadingding")
  255.                             firetouchinterest(Torso,Ring,0)
  256.                             firetouchinterest(Torso,Ring,1)
  257.                         elseif (part.Name == "Graffiti" and part:FindFirstChild("Nodes")) then
  258.                             local Nodes = part:FindFirstChild("Nodes")
  259.                             for i,ring in pairs(part:GetDescendants()) do
  260.                                 if (ring:IsA("WeldConstraint") or ring:IsA("Weld")) and ring.Part1 == Root then
  261.                                     for i,node in pairs(Nodes:GetChildren()) do
  262.                                         -- giant blob of guesswork.
  263.                                         -- pretty sure I cant do anything about the graffiti minigame, I think it uses raycast.
  264.                                         firetouchinterest(ring.Parent,node,0)
  265.                                         firetouchinterest(ring.Parent,node,1)
  266.                                         firetouchinterest(RLeg,node,0)
  267.                                         firetouchinterest(RLeg,node,1)
  268.                                         firetouchinterest(LLeg,node,0)
  269.                                         firetouchinterest(LLeg,node,1)
  270.                                         firetouchinterest(Torso,node,0)
  271.                                         firetouchinterest(Torso,node,1)
  272.                                     end
  273.                                 end
  274.                             end
  275.                         end
  276.                     end
  277.                 end
  278.             end
  279.         end
  280.     end)
  281. end)()
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement