Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mob = "CCG"
- local distanceFromMob = -3 -- How far you want to be behind the mob
- local travelSpeed = 140 -- higher = faster -- 140 won't kill you, but if you go too high you will die lol
- --[[
- Mobs to pick from -
- -- Ghoul
- -- Human
- -- CCG
- -- SCCG
- -- Boss
- ]]--
- local mobName
- if mob == "Ghoul" then
- mobName = "GhoulSpawns"
- elseif mob == "Human" then
- mobName = "HumanSpawns"
- elseif mob == "CCG" then
- mobName = "CCGSpawns"
- elseif mob == "SCCG" then
- mobName = "AggroSpawns"
- elseif mob == "Boss" then
- mobName = "BossSpawns"
- else
- mobName = "Made by dah GoobsGoobies :D"
- end
- local tweenS = game:GetService("TweenService")
- local player = game.Players.LocalPlayer
- local playerHRP = player.Character:WaitForChild("HumanoidRootPart")
- local playerHumanoid = player.Character:WaitForChild("Humanoid")
- function farm()
- while true do
- if playerHumanoid.Health ~= 0 then
- for i,v in pairs(workspace.NPCSpawns:GetChildren()) do
- if v:FindFirstChildWhichIsA("Model") and v.Name == mobName and not v:FindFirstChild("Athlete") then
- while true do
- if v:FindFirstChildWhichIsA("Model") then
- local parent = v:FindFirstChildWhichIsA("Model")
- if parent:FindFirstChild("Humanoid") then
- if parent.Humanoid.Health ~= 0 then
- local distance = (playerHRP.Position - parent.HumanoidRootPart.Position).magnitude
- local tweenInfo = TweenInfo.new(distance/travelSpeed)
- local tweenGoal = {}
- tweenGoal.CFrame = parent.HumanoidRootPart.CFrame + parent.HumanoidRootPart.CFrame.LookVector * distanceFromMob
- local playTween = tweenS:Create(playerHRP,tweenInfo,tweenGoal)
- if distance <= 10 then
- local parentHRP = parent:WaitForChild("HumanoidRootPart")
- if mob == "Human" then
- playerHRP.CFrame = parentHRP.CFrame + parentHRP.CFrame.LookVector * distanceFromMob
- wait()
- playerHRP.CFrame = parentHRP.CFrame + parentHRP.CFrame.LookVector * ((distanceFromMob * -1) + 2)
- playerHRP.CFrame = CFrame.new(playerHRP.Position,parentHRP.Position)
- else
- playerHRP.CFrame = parentHRP.CFrame + parentHRP.CFrame.LookVector * distanceFromMob
- end
- else
- playTween:Play()
- end
- wait()
- elseif parent.Humanoid.Health == 0 then
- break
- end
- elseif not parent:FindFirstChild("Humanoid") then
- break
- end
- elseif not v:FindFirstChildWhichIsA("Model") or v:FindFirstChildWhichIsA("Model").Humanoid.Health == 0 then
- break
- end
- end
- end
- end
- elseif player.Character.Humanoid.Health == 0 then
- break
- end
- wait()
- end
- end
- farm()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement