Advertisement
Devil_Blox

VoxlBlade v000 Autofarm

Dec 20th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.98 KB | None | 0 0
  1. _G.Toggle = true
  2. _G.DipOnLowHealth = true
  3.  
  4. local Events = game.ReplicatedStorage.Events
  5. local Keeper = workspace.NPCS.Keeper
  6. local Heal = game.Players.LocalPlayer.PlayerGui.CoreGUI.Events.DialogEffect
  7. local Sleep = Keeper.ChatInfo.Chats.Sleep
  8. local AttackEvent = Events.Event1
  9. local NPCs = workspace.NPCS
  10. local Player = game.Players.LocalPlayer
  11. local Character = Player.Character
  12. local HRP = Character.HumanoidRootPart
  13. local PlayerHum = Character.Humanoid
  14. local TweenService = game:GetService("TweenService")
  15. local SpawnLocation = Keeper.CFrame * CFrame.new(2, 0, 0)
  16.  
  17. Player.CharacterAdded:Connect(function(char)
  18. HRP = char:WaitForChild("HumanoidRootPart")
  19. PlayerHum = char:WaitForChild("Humanoid")
  20. end)
  21.  
  22. local Mobs = {
  23. "Buni", "DireBuni", "Bumblz", "Budboy", "Drone", "Woof"
  24. }
  25.  
  26. local AllowedTools = {
  27. "BasicSword", "LongSword", "SharpSword", "Dagger"
  28. }
  29.  
  30. while wait() do
  31. if _G.Toggle == false then
  32. break
  33. end
  34.  
  35. for _, v in pairs(NPCs:GetChildren()) do
  36. if table.find(Mobs, v.Name) then
  37. for i = 1, 1000 do
  38. if _G.Toggle == false then
  39. break
  40. end
  41.  
  42. local ActualNPC = v:FindFirstChild(v.Name)
  43.  
  44. for _, v in pairs(Player.Character:GetChildren()) do
  45. if table.find(AllowedTools, v.Name) then
  46. break
  47. else
  48.  
  49. for _, v in pairs(Player.Backpack:GetChildren()) do
  50. if table.find(AllowedTools, v.Name) then
  51. PlayerHum:EquipTool(v)
  52. break
  53. end
  54. end
  55.  
  56. end
  57. end
  58.  
  59. if ActualNPC then
  60.  
  61. local Humanoid = ActualNPC:FindFirstChild("Humanoid")
  62.  
  63. if not Humanoid or not ActualNPC:FindFirstChild("HumanoidRootPart") then break end
  64.  
  65. repeat wait() until HRP
  66.  
  67. repeat wait() until HRP.Anchored == false
  68.  
  69. if Humanoid.Health <= 0 then break end
  70.  
  71. if _G.DipOnLowHealth == true then
  72. if PlayerHum.Health < 20 then
  73. local dist = (SpawnLocation.Position - HRP.Position).Magnitude
  74. local velocity = 160
  75. local info = TweenInfo.new(dist / velocity, Enum.EasingStyle.Linear)
  76. local g = {}
  77. g.CFrame = SpawnLocation
  78.  
  79. local Tween = TweenService:Create(HRP, info, g)
  80. Tween:Play()
  81.  
  82. Tween.Completed:Wait()
  83. Heal:InvokeServer(workspace.NPCS.Keeper, Sleep)
  84. end
  85. end
  86.  
  87. local dist = (v.Position - HRP.Position).Magnitude
  88.  
  89. if dist > 1000 then break end
  90.  
  91. local velocity = 160
  92. local info = TweenInfo.new(dist / velocity, Enum.EasingStyle.Linear)
  93.  
  94. if not ActualNPC:FindFirstChild("HumanoidRootPart") then return end
  95.  
  96. local g = {}
  97. g.CFrame = ActualNPC.HumanoidRootPart.CFrame
  98.  
  99. local Tween = TweenService:Create(HRP, info, g)
  100. Tween:Play()
  101.  
  102. Tween.Completed:Wait()
  103. AttackEvent:InvokeServer("L")
  104. else
  105. break
  106. end
  107. end
  108. end
  109. end
  110. end
  111.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement