lolggeznoob

Untitled

Oct 26th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. local mob = "CCG"
  2. local distanceFromMob = -3 -- How far you want to be behind the mob
  3. local travelSpeed = 140 -- 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.  
  31.  
  32.  
  33. local Players = game:GetService("Players")
  34. local client = Players.LocalPlayer
  35. local plrrem = client.Character:FindFirstChild("Remotes")
  36. local plrr = client.Character:FindFirstChild("Humanoid")
  37. local pressrem = plrrem.KeyEvent
  38. local mouse = client:GetMouse()
  39.  
  40. local tweenS = game:GetService("TweenService")
  41. local player = game.Players.LocalPlayer
  42. local playerHRP = player.Character:WaitForChild("HumanoidRootPart")
  43. local playerHumanoid = player.Character:WaitForChild("Humanoid")
  44.  
  45.  
  46. function grabKey()
  47. local key
  48. for i,v in next,(debug.getregistry()) do
  49. if type(v) == "function" then
  50. for i,v in next, debug.getupvalues(v) do
  51. if tostring(i) == "HRPPosition1" then
  52. key = v
  53. end
  54. end
  55. end
  56. end
  57. return key
  58. end
  59.  
  60. remotepw = grabKey()
  61.  
  62.  
  63. function pressKey(key)
  64. pressrem:FireServer(remotepw, key_list[key], "Down", mouse.Hit)
  65. end
  66.  
  67. function pressMouse1()
  68. local arguments = {
  69. remotepw;
  70. "Mouse1";
  71. "Down";
  72. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
  73. }
  74. local event = game.Players.LocalPlayer.Character.Remotes.KeyEvent
  75. event:FireServer(unpack(arguments))
  76. end
  77.  
  78.  
  79. function checkOff(remotes)
  80. if remotes:FindFirstChild("GetPos") and remotes:FindFirstChild("StatUpdate") and remotes:FindFirstChild("UpdateAll") then
  81. --remotes:FindFirstChild("GetPos").RobloxLocked = true
  82. remotes:FindFirstChild("StatUpdate").RobloxLocked = true
  83. --remotes:FindFirstChild("UpdateAll").RobloxLocked = true
  84. else
  85. warn("checks are off")
  86. end
  87. end
  88.  
  89.  
  90.  
  91.  
  92. function farm()
  93. while true do
  94. pressMouse1()
  95. wait()
  96. if playerHumanoid.Health ~= 0 then
  97. for i,v in pairs(workspace.NPCSpawns:GetChildren()) do
  98. if v:FindFirstChildWhichIsA("Model") and v.Name == mobName and not v:FindFirstChild("Athlete") then
  99. checkOff(plrrem)
  100. wait()
  101. while true do
  102. if v:FindFirstChildWhichIsA("Model") then
  103. local parent = v:FindFirstChildWhichIsA("Model")
  104. if parent:FindFirstChild("Humanoid") then
  105. if parent.Humanoid.Health ~= 0 then
  106. local distance = (playerHRP.Position - parent.HumanoidRootPart.Position).magnitude
  107. local tweenInfo = TweenInfo.new(distance/travelSpeed)
  108. local tweenGoal = {}
  109. tweenGoal.CFrame = parent.HumanoidRootPart.CFrame + parent.HumanoidRootPart.CFrame.LookVector * distanceFromMob
  110. local playTween = tweenS:Create(playerHRP,tweenInfo,tweenGoal)
  111. if distance <= 10 then
  112. local parentHRP = parent:WaitForChild("HumanoidRootPart")
  113. if mob == "Human" then
  114. playerHRP.CFrame = parentHRP.CFrame + parentHRP.CFrame.LookVector * distanceFromMob
  115. wait()
  116. playerHRP.CFrame = parentHRP.CFrame + parentHRP.CFrame.LookVector * ((distanceFromMob * -1) + 2)
  117. playerHRP.CFrame = CFrame.new(playerHRP.Position,parentHRP.Position)
  118. else
  119. playerHRP.CFrame = parentHRP.CFrame + parentHRP.CFrame.LookVector * distanceFromMob
  120. end
  121. else
  122. playTween:Play()
  123. end
  124. wait()
  125. elseif parent.Humanoid.Health == 0 then
  126. break
  127. end
  128. elseif not parent:FindFirstChild("Humanoid") then
  129. break
  130. end
  131.  
  132. elseif not v:FindFirstChildWhichIsA("Model") or v:FindFirstChildWhichIsA("Model").Humanoid.Health == 0 then
  133. break
  134. end
  135. end
  136. end
  137. end
  138. elseif player.Character.Humanoid.Health == 0 then
  139. break
  140. end
  141. wait()
  142. end
  143. end
  144.  
  145. farm()
Advertisement
Add Comment
Please, Sign In to add comment