Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _G.farm = false
- _G.tenmob = "Bandit"
- local plr = game:service("Players").LocalPlayer
- function questbandit()
- if game:GetService("Players").LocalPlayer.PlayerGui.GameUI.Quest.QuestFrame.AbsolutePosition.X == -960 then
- local string_1 = "GiveQuest"
- local string_2 = "A group of bandits suddenly swarmed into the village. Can you get rid of a couple?"
- local Target = game:GetService("ReplicatedStorage").Remotes.Player.QuestRemote
- Target:FireServer(string_1, string_2)
- print("Give Quest")
- end
- end
- function attack()
- local string_1 = "Combat";
- local number_1 = 2;
- local Target = game:GetService("ReplicatedStorage").Remotes.Melee.Combat;
- Target:FireServer(string_1, number_1);
- end
- while _G.farm do
- wait()
- for i,v in pairs(game:GetService("Workspace").FightableNPCS:GetChildren()) do
- if v.Name == _G.tenmob then
- if v.Humanoid.Health > 1 then
- repeat wait()
- local plr = game:service"Players".LocalPlayer
- local tween_s = game:service"TweenService"
- local info = TweenInfo.new((plr.Character.HumanoidRootPart.Position - v.HumanoidRootPart.Position).Magnitude/80,Enum.EasingStyle.Quad)
- local tic_k = tick()
- local params = {...}
- local cframe = CFrame.new(v.HumanoidRootPart.Position + Vector3.new(0, -1, 0), v.HumanoidRootPart.Position)
- local tween,err = pcall(function()
- local tween = tween_s:Create(plr.Character["HumanoidRootPart"],info,{CFrame = cframe})
- tween:Play()
- attack()
- questbandit()
- end)
- if not tween then return err end
- until v.Humanoid.Health == 0 or _G.farm == false
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment