Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. local mob = "CCG"
  2. local distanceFromMob = -1 -- How far you want to be behind the mob
  3. local travelSpeed = 130 -- higher = faster -- 140 won't kill you, but if you go too high you will die lol
  4.  
  5. --[[
  6. Mobs to pick from -
  7. -- Ghoul
  8. -- Human
  9. -- CCG
  10. -- SCCG
  11. -- Boss
  12. ]]--
  13.  
  14. local mobName
  15.  
  16. if mob == "Ghoul" then
  17. mobName = "GhoulSpawns"
  18. elseif mob == "Human" then
  19. mobName = "HumanSpawns"
  20. elseif mob == "CCG" then
  21. mobName = "CCGSpawns"
  22. elseif mob == "SCCG" then
  23. mobName = "AggroSpawns"
  24. elseif mob == "Boss" then
  25. mobName = "BossSpawns"
  26. else
  27. mobName = "Made by dah GoobsGoobies Big Grin"
  28. end
  29.  
  30. local tweenS = game:GetService("TweenService")
  31. local player = game.Players.LocalPlayer
  32. local playerHRP = player.Character:WaitForChild("HumanoidRootPart")
  33. local playerHumanoid = player.Character:WaitForChild("Humanoid")
  34.  
  35. function farm()
  36. while true do
  37. if playerHumanoid.Health ~= 0 then
  38. for i,v in pairs(workspace.NPCSpawns:GetChildren()) do
  39. if v:FindFirstChildWhichIsA("Model") and v.Name == mobName and not v:FindFirstChild("Athlete") then
  40. while true do
  41. if v:FindFirstChildWhichIsA("Model") then
  42. local parent = v:FindFirstChildWhichIsA("Model")
  43. if parent:FindFirstChild("Humanoid") then
  44. if parent.Humanoid.Health ~= 0 then
  45. local distance = (playerHRP.Position - parent.HumanoidRootPart.Position).magnitude
  46. local tweenInfo = TweenInfo.new(distance/travelSpeed)
  47. local tweenGoal = {}
  48. tweenGoal.CFrame = parent.HumanoidRootPart.CFrame + parent.HumanoidRootPart.CFrame.LookVector * distanceFromMob
  49. local playTween = tweenS:Create(playerHRP,tweenInfo,tweenGoal)
  50. if distance <= 10 then
  51. local parentHRP = parent:WaitForChild("HumanoidRootPart")
  52. if mob == "Human" then
  53. playerHRP.CFrame = parentHRP.CFrame + parentHRP.CFrame.LookVector * distanceFromMob
  54. wait()
  55. playerHRP.CFrame = parentHRP.CFrame + parentHRP.CFrame.LookVector * ((distanceFromMob * -1) + 2)
  56. playerHRP.CFrame = CFrame.new(playerHRP.Position,parentHRP.Position)
  57. else
  58. playerHRP.CFrame = parentHRP.CFrame + parentHRP.CFrame.LookVector * distanceFromMob
  59. end
  60. else
  61. playTween:Play()
  62. end
  63. wait()
  64. elseif parent.Humanoid.Health == 0 then
  65. break
  66. end
  67. elseif not parent:FindFirstChild("Humanoid") then
  68. break
  69. end
  70.  
  71. elseif not v:FindFirstChildWhichIsA("Model") or v:FindFirstChildWhichIsA("Model").Humanoid.Health == 0 then
  72. break
  73. end
  74. end
  75. end
  76. end
  77. elseif player.Character.Humanoid.Health == 0 then
  78. break
  79. end
  80. wait()
  81. end
  82. end
  83.  
  84. farm()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement