Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RunService = game:GetService("RunService")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local TweenService = game:GetService("TweenService")
- local Player = game:GetService("Players").LocalPlayer
- warn("~ Praise le vleen! ~")
- local FoundEnemy = false
- local function TweenHandler(TargetPart)
- local tweenInfo = TweenInfo.new(((TargetPart.Position - Player.Character.Head.Position).magnitude / (4 * 10)))
- local Tween = TweenService:Create(Player.Character.HumanoidRootPart, tweenInfo, {CFrame = CFrame.new(TargetPart.Position.x, TargetPart.Position.y, TargetPart.Position.z)})
- Tween:Play()
- return Tween
- end
- local function GetQuest(Name)
- local QuestInfo = {
- ["Village Bandit"] = {
- ["Arguments"] = {["Type"] = "Quest", ["NPCName"] = "Level1Quest", ["ID"] = "Level1Quest", ["Description"] = "Kill 10 Weak Bandits!", ["Job"] = "AcceptDialogue"};
- ["Quest"] = "Level1Quest"
- };
- ["Bandit Assassin"] = {
- ["Arguments"] = {["Type"] = "Quest", ["NPCName"] = "Level12Quest", ["ID"] = "Level12Quest", ["Description"] = "Wack 10 pirate assassins for me mate!", ["Job"] = "AcceptDialogue"};
- ["Quest"] = "Level12Quest"
- };
- ["Bandit Leader"] = {
- ["Arguments"] = {["Type"] = "Quest", ["NPCName"] = "Level18Quest", ["ID"] = "Level18Quest", ["Description"] = "show bandit leader whos the boss", ["Job"] = "AcceptDialogue"};
- ["Quest"] = "Level18Quest"
- };
- }
- if not Player.PlayerValues.Quests:FindFirstChild(QuestInfo[Name]["Quest"]) then
- ReplicatedStorage.Remotes.ClientE:FireServer(QuestInfo[Name]["Arguments"])
- end
- end
- local function Lock(Target)
- if Loop then
- Loop:Disconnect()
- end
- local LastTime = 0
- Loop = RunService.Heartbeat:Connect(function()
- if tick() - LastTime >= 0.1 then
- LastTime = tick()
- if _G.Enabled == false then
- Loop:Disconnect()
- FoundEnemy = false
- end
- if not Target then
- Loop:Disconnect()
- wait(1)
- FoundEnemy = false
- end
- if Target.Parent.Humanoid.Health <= 0 then
- Loop:Disconnect()
- wait(1)
- FoundEnemy = false
- end
- if Player.Character.Humanoid.Health <= 0 then
- Loop:Disconnect()
- wait(3)
- FoundEnemy = false
- end
- if not Player.Character:FindFirstChild(_G.Weapon) then
- Player.Character.Humanoid:EquipTool(Player.Backpack[_G.Weapon])
- end
- Player.Character[_G.Weapon]:Activate()
- Player.Character.HumanoidRootPart.CFrame = Target.CFrame + Target.CFrame.LookVector * -4
- end
- end)
- end
- coroutine.resume(coroutine.create(function()
- if _G.Enabled == true then
- repeat wait(1)
- if FoundEnemy == false then
- for _, v in pairs(workspace.Enemies:GetChildren()) do
- if table.find(_G.NpcName, v.Name) and v:FindFirstChild("HumanoidRootPart") and (v.HumanoidRootPart.Position - Player.Character.HumanoidRootPart.Position).Magnitude <= 1000 then
- FoundEnemy = true
- GetQuest(v.Name)
- local Tween = TweenHandler(v.HumanoidRootPart)
- Completion = Tween.Completed:Connect(function()
- Completion:Disconnect()
- Tween:Destroy()
- Lock(v.HumanoidRootPart)
- end)
- break
- end
- end
- end
- until _G.Enabled == false
- end
- end))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement