Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _G.Toggle = true
- _G.DipOnLowHealth = true
- local Events = game.ReplicatedStorage.Events
- local Keeper = workspace.NPCS.Keeper
- local Heal = game.Players.LocalPlayer.PlayerGui.CoreGUI.Events.DialogEffect
- local Sleep = Keeper.ChatInfo.Chats.Sleep
- local AttackEvent = Events.Event1
- local NPCs = workspace.NPCS
- local Player = game.Players.LocalPlayer
- local Character = Player.Character
- local HRP = Character.HumanoidRootPart
- local PlayerHum = Character.Humanoid
- local TweenService = game:GetService("TweenService")
- local SpawnLocation = Keeper.CFrame * CFrame.new(2, 0, 0)
- Player.CharacterAdded:Connect(function(char)
- HRP = char:WaitForChild("HumanoidRootPart")
- PlayerHum = char:WaitForChild("Humanoid")
- end)
- local Mobs = {
- "Buni", "DireBuni", "Bumblz", "Budboy", "Drone", "Woof"
- }
- local AllowedTools = {
- "BasicSword", "LongSword", "SharpSword", "Dagger"
- }
- while wait() do
- if _G.Toggle == false then
- break
- end
- for _, v in pairs(NPCs:GetChildren()) do
- if table.find(Mobs, v.Name) then
- for i = 1, 1000 do
- if _G.Toggle == false then
- break
- end
- local ActualNPC = v:FindFirstChild(v.Name)
- for _, v in pairs(Player.Character:GetChildren()) do
- if table.find(AllowedTools, v.Name) then
- break
- else
- for _, v in pairs(Player.Backpack:GetChildren()) do
- if table.find(AllowedTools, v.Name) then
- PlayerHum:EquipTool(v)
- break
- end
- end
- end
- end
- if ActualNPC then
- local Humanoid = ActualNPC:FindFirstChild("Humanoid")
- if not Humanoid or not ActualNPC:FindFirstChild("HumanoidRootPart") then break end
- repeat wait() until HRP
- repeat wait() until HRP.Anchored == false
- if Humanoid.Health <= 0 then break end
- if _G.DipOnLowHealth == true then
- if PlayerHum.Health < 20 then
- local dist = (SpawnLocation.Position - HRP.Position).Magnitude
- local velocity = 160
- local info = TweenInfo.new(dist / velocity, Enum.EasingStyle.Linear)
- local g = {}
- g.CFrame = SpawnLocation
- local Tween = TweenService:Create(HRP, info, g)
- Tween:Play()
- Tween.Completed:Wait()
- Heal:InvokeServer(workspace.NPCS.Keeper, Sleep)
- end
- end
- local dist = (v.Position - HRP.Position).Magnitude
- if dist > 1000 then break end
- local velocity = 160
- local info = TweenInfo.new(dist / velocity, Enum.EasingStyle.Linear)
- if not ActualNPC:FindFirstChild("HumanoidRootPart") then return end
- local g = {}
- g.CFrame = ActualNPC.HumanoidRootPart.CFrame
- local Tween = TweenService:Create(HRP, info, g)
- Tween:Play()
- Tween.Completed:Wait()
- AttackEvent:InvokeServer("L")
- else
- break
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement