Youtube_AppealsCat

Dio Farm (improved by attemptingtocode)

Aug 29th, 2024
638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.34 KB | None | 0 0
  1. getgenv().AutoFarmDioBoss = true
  2.  
  3. local Centre = Vector3.new(19091,910,115)
  4.  
  5. -- Remove unnecessary effects more smooth ig
  6. task.spawn(function()
  7.     while getgenv().AutoFarmDioBoss do
  8.         pcall(function()
  9.             local effects = workspace.Effects:GetChildren()
  10.             for i = #effects, 1, -1 do
  11.                 local v = effects[i]
  12.                 if v.Name == "Hold up, aint you Dio?" or v.Name == "FIRE" or v.Name == 'blood' then
  13.                     v:Destroy()
  14.                 end
  15.             end
  16.         end)
  17.         task.wait(0.1) -- Slightly increased wait time for performance bullshit
  18.     end
  19. end)
  20.  
  21. -- Find the Dio boss more efficiently
  22. task.spawn(function()
  23.     while getgenv().AutoFarmDioBoss do
  24.         pcall(function()
  25.             getgenv().Target = nil
  26.             for _, x in ipairs(workspace.Living:GetChildren()) do
  27.                 if string.find(x.Name, "Dio") then
  28.                     getgenv().Target = x
  29.                     break -- Stop searching once the target is found
  30.                 end
  31.             end
  32.         end)
  33.         task.wait(0.1) -- Slightly increased wait time for performance bullshit
  34.     end
  35. end)
  36.  
  37. -- Move towards the target more efficiently
  38. task.spawn(function()
  39.     while getgenv().AutoFarmDioBoss do
  40.         pcall(function()
  41.             local target = getgenv().Target
  42.             if target and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character.Humanoid.Health > 0 then
  43.                 local humanoidRootPart = game.Players.LocalPlayer.Character.HumanoidRootPart
  44.                 local targetPosition = target.HumanoidRootPart.Position
  45.                 humanoidRootPart.CFrame = CFrame.new(targetPosition - Vector3.new(0, 0, 5), targetPosition)
  46.             end
  47.         end)
  48.         task.wait(0.1) -- Slightly increased wait time for performance bullshit
  49.     end
  50. end)
  51.  
  52. local DELAY_BEFORE_ATTACKING = 0.125 -- Reduced delay before attacking
  53.  
  54. -- Attack and respawn
  55. task.spawn(function()
  56.     while getgenv().AutoFarmDioBoss do
  57.  
  58.         if (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - Centre).Magnitude > 10 then
  59.             game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Centre)
  60.             task.wait(0.25)
  61.         end
  62.  
  63.         local cooldown = game.Players.LocalPlayer.Cooldowns:FindFirstChild("Rush Attack")
  64.         if cooldown then
  65.             repeat
  66.                 task.wait(0.01) -- Reduced wait time during cooldown
  67.             until not game.Players.LocalPlayer.Cooldowns:FindFirstChild("Rush Attack")
  68.         end
  69.  
  70.         -- Attack
  71.         task.spawn(function()
  72.             task.wait(DELAY_BEFORE_ATTACKING)
  73.             local args = { [1] = "MouseButton1" }
  74.             game:GetService("ReplicatedStorage"):WaitForChild("ReplicatedModules"):WaitForChild("KnitPackage"):WaitForChild("Knit"):WaitForChild("Services"):WaitForChild("MoveInputService"):WaitForChild("RF"):WaitForChild("FireInput"):InvokeServer(unpack(args))
  75.         end)
  76.  
  77.         -- Respawn
  78.         local args = { [1] = "Spawn Boss Altar", [2] = "Dio", [3] = workspace:WaitForChild("NPCSpawns"):WaitForChild("Boss Altar"):WaitForChild("Spawn"):WaitForChild("Part") }
  79.         game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("NpcFunc"):InvokeServer(unpack(args))
  80.  
  81.         task.wait(1) -- Reduced wait time after respawn
  82.     end
  83. end)
Add Comment
Please, Sign In to add comment