Advertisement
antraxo9000

Untitled

Apr 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. findTarget = function()
  2. local distance = 10000
  3. local target
  4. for i,v in pairs(workspace:WaitForChild("dungeon"):GetDescendants()) do
  5. local humanoid = v:FindFirstChildOfClass("Humanoid")
  6. local head = v:FindFirstChild("Head")
  7. if humanoid and head then
  8. if localplayer.Character:FindFirstChild("HumanoidRootPart") then
  9. if (head.Position - localplayer.Character.HumanoidRootPart.Position).magnitude < distance then
  10. distance = (head.Position - localplayer.Character.HumanoidRootPart.Position).magnitude
  11. target = head
  12. end
  13. end
  14. end
  15. end
  16. return target
  17. end,
  18. getBossOffset = function(boss)
  19. if boss then
  20. if bosses[boss] then
  21. return bosses[boss].offset
  22. else
  23. error("boss not found")
  24. end
  25. end
  26. end,
  27. Swing = function()
  28. for i,v in pairs(localplayer.Backpack:GetChildren()) do
  29. if v:IsA("Tool") then
  30. if v:FindFirstChild("abilitySlot") then
  31. v:FindFirstChildOfClass("RemoteEvent"):FireServer()
  32. end
  33. end
  34. end
  35. for i,v in pairs(localplayer.Character:GetChildren()) do
  36. if v:IsA("Accessory") then
  37. if v:FindFirstChild("swing") then
  38. v:FindFirstChildOfClass("RemoteEvent"):FireServer()
  39. end
  40. end
  41. end
  42. end,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement